Hi,
I am trying to export a file with all the passwords that we need to have on web
password safe, I am trying to insert them directly in the database by inserting
the required information in all the tables that are modified at the moment when
a password is added by a user of the web app. But I found that the table
password_data new a hash of the password, I tried to make a simple program in
Java to produce that hash, using the same libraries that you used, jasypt and
bounce castle, but I can't get the same hash that your system produce. Can you
help out with that.
This is my code:
public static void main(String[] args) {
String password="CTcZD7Q7QXr1fcHWRq4c";
//Security.addProvider(new BouncyCastleProvider());
StandardPBEStringEncryptor mySecondEncryptor = new StandardPBEStringEncryptor();
mySecondEncryptor.setProvider(new BouncyCastleProvider());
mySecondEncryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC");
mySecondEncryptor.setPassword(password);
mySecondEncryptor.setKeyObtentionIterations(1000);
FixedStringSaltGenerator gen = new FixedStringSaltGenerator();
gen.setSalt("jasypt");
mySecondEncryptor.setSaltGenerator(gen);
String encryptedText = mySecondEncryptor.encrypt("test");
System.out.println(encryptedText);
}
I tried with the password "test" and in the webpassword database the row in
password_data is 2vOb41KkpSMLolkazBcrf+qARHaEnpIHiO37Y0wFSU8= , but my program
give me a distinct result everytime.
Can you help me out with this? I will really apreciate that.
Thanks.
Original issue reported on code.google.com by danieljo...@gmail.com on 11 Sep 2013 at 2:33
Original issue reported on code.google.com by
danieljo...@gmail.com
on 11 Sep 2013 at 2:33