3

Here's what I'm trying to do:

Multiple users with different devices will share the same copy of a file which is encrypted on server-side using AES with a randomly generated passphrase, the passphrase is then stored on a database, along with each user's public key. If a user wanted to decrypt and access the file, they would send their private key to the server over HTTPS (which I'm not sure if this is a right thing to do) which gets matched with the public keys (private key will not be stored on DB), then a response is sent with the passphrase and is used to decrypt the file.

I'm doing this because the data on the file is extremely sensitive and should not be stolen in any way. The usual password authentication is not safe enough, as the password could be stolen. Is there any technique or best practice that I've missed, and is this method secure?

  • Why do you think that sending a private key ( this is very strange by the way) is more secure than the user password for authentication if you set up good password rules? – kelalaka Apr 25 at 20:59
  • Passwords could be easily stolen (using phishing attacks for example), however a private key that "physically" exists on the user device is not easy to steal. – Muizz Mahdy Apr 25 at 21:11
  • The same phishing attack can happen for the private key, too. – kelalaka Apr 25 at 21:13
  • How could one steal a private key that's stored on a file locally within the user's device using an email or a fake webpage ? – Muizz Mahdy Apr 25 at 21:18
  • 2
    The point of using asymmetric crypto is that you never need to send your private key to anyone. Instead, if you're developing an authentication scheme based on asymmetric crypto, you would usually end up with a challenge-response scheme. – Lie Ryan Apr 25 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.