I want to encrypt and decrypt a file containing usernames and passwords. Since this file will be available for checking the correctness of the entered user name and password, I am sure that every time the program starts, another key will not work, because it will decrypt the file incorrectly (since it was previously encrypted using a different key). Is there a better way to do what I want to do? I want to just provide a static key here:
cipher.init (Cipher.ENCRYPT_MODE, KEY_HERE);
But I'm not sure what data type for this parameter if it will ever work. I appreciate any help.
source share