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?
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!