java - Password Encryption and Decryption with Jasypt and random salt -
hi have java application. want utilize jasypt encrypt , decrypt passwords random salt generated based on size , algorithm.
this want achieve.
create random salt. encrypt password salt. save salt , encrypted password user.i want salt size, algorithm given input.
the reason why want decryption that, have configuration files created application , values passwords want save encrypted in file , decrypt when want utilize it.
i have this java class creates salt , creates hash code , utilize validating user (i can save salt , hascode instead of encrypted password.). changed , created method create random salt in example. there no decryption method.
that's why take jasypt. havn't seen proper illustration of how utilize it.
i tried next , returns same salt.
public static void main(string[] args) { randomsaltgenerator saltgenerator = new randomsaltgenerator(); byte[] salt = saltgenerator.generatesalt(24); system.out.println(salt); } can provide proper illustration or how utilize in own way? want accomplish jasypt have mentioned in article. there no codes available.
this article password encryption jasypt describes standard best practices of storing encrypted user passwords one-way encryption. 1 time you've stored password using such techniques, there way decrypt it.
if need encrypt , decrypt passwords application configuration, should consider using standardpbestringencryptor provided jasypt (or whatever provider best fits info type). page contains explanation , illustration code.
even better, jasypt provides first class back upwards encrypted application configuration using .properties files (also back upwards spring).
java encryption jasypt
No comments:
Post a Comment