Can I encrypt passwords in base64? I want to do this because its as easy as
import os
os.popen(f"echo {userinput} | base64").read()
I was wondering if it is safe because its not hard to decrypt base64.
CodePudding user response:
Base 64 is NOT a valid encryption method for passwords if you want it to be secure. It is barely better than plaintext.
Usually, the password is hashed and salted, and then checking passwords involves hashing the new string with the same method and checking against the stored hash.
CodePudding user response:
You just answered yourself ;] If it is "not hard to decrypt base64", you wouldn't like to use it for any secure way of storing passwords, right?
Here are more details regarding the problems with base64.
I think that a valid option for you would be to use some higher level popular library. It's a hard topic, and it's easy to mess it up, so it's better to use some trusted and battle-tested solutions. You can take a look here for some overview of available libraries.