Encrypted password on files

Hello!I have a program that creates encrypted text, and in order to improve security and prevent unwanted readers, I put a password system that writes the password into the file and reads it in order to grant access to the right reader. Right now, the password is pretty vunerable, since you could just read it from the file. Any way to write an encrypted password and decrypt it from the program, without being too resource heavy?
Last edited on
I think a common strategy is:
- apply a hash algorithm to the password and store the result;
- when the user gives the password, apply the same hash and compare this result to the one you stored - they must match.

You need to choose a hash method which is hard to reverse, of course!
Storing the password decreases security, no matter what you do to it.

As long as your cryptographic function is secure, any attempt to decrypt will require a correct, user-supplied password.
Topic archived. No new replies allowed.