I am using jasypt to encrypt and decrypt passwords. Jasypt provides excellent libraries to do this. However, the issue that I am facing revolves around encrypting/decrypting an already encrypted password. The encrypted password that I am speaking is not encrypted by jasypt. However, it contains characters that are not contained in normal passwords. As a result, the decrypted password (first encrypted by jasypt and then decrypted by jasypt) contains an extra character. Are there alternative classes that take into account already encrypted or hashed passwords with abnormal characters? I am utilizing the BasicTextEncryptor.
Asked
Active
Viewed 377 times
0
-
Passwords should be hashed, not encrypted, so there is something fundamentally wrong with the entire system in which this question is embedded. See [tag:password-encryption] for why. – user207421 Jun 17 '16 at 03:51
-
@EJP there is no mention of user password. what about the password used for connecting to a system (DB), maintained in a property file. – Amit Parashar Jun 17 '16 at 05:28
-
@Albert could you share a simple void main type of sample snippet to let us understand the issue. – Amit Parashar Jun 17 '16 at 05:28
-
I fixed the issue by not using quotations when encrypting the value. Similar to this question: http://stackoverflow.com/questions/26388928/how-can-my-password-contain-special-characters-using-jasypt-and-encrypt-sh – Albert Jun 17 '16 at 13:58