Ask HN: Encrypted File as a Login Method

https://news.ycombinator.com/item?id=40085010
by anbardoi • 2 years ago
2 13 2 years ago

I'm developing an anonymous blogging website that exemplifies user privacy and instead of going the ol' tried-and-true route of requiring an email/password for account creation/login, I want to do this:

Generate a file containing a random string of text, then encrypt it

Calculate the sha256 checksum of the encrypted file and store it in a database. Then provide the file and the decryption key to the user for download.

When the user wants to login, they upload that file to my server in a buffer, where the sha256 is calculated and checked against the database. If it matches, user gains access to their account data, associated with the checksum. If it doesnt, the file is rejected. Either way, the encrypted file is deleted after checking.

I think this would be really secure because if my server is compromised, the only thing an attacker would have is sha256 checksums as user identifiers. I know there's probably hashing/file-handling attack vectors, as well as file-collision scenarios(although rare, still possible)

Are there any additional considerations I should take into account with this project? Also, security QA's as recovery in case they lose their file.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com