|
From: Eldon <el...@gm...> - 2011-09-05 15:31:52
|
Dear Joe Hindsley,
I do that you say, I am using checkPassword() for verify if the password did
enter match with the password stored in may database. I did put a password
in database using
<code>
StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
String encryptPwd = passwordEncryptor.encryptPassword(plainpwd);
</code>
and after user's login I try
<code>
StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
String encryptedPassword = passwordEncryptor.encryptPassword(pwdStored);
if (passwordEncryptor.checkPassword(plainPwd, encryptedPassword)) {
"true";
} else {
"false";
}
</code>
The return was "false"
Joe Hindsley wrote:
>
> +------------------------+
> Jasypt Users List
> http://www.jasypt.org
> +------------------------+
> Hi Carlo,
>
> The Encrypting Passwords page has code examples:
>
> http://www.jasypt.org/encrypting-passwords.html
>
> Each time you encrypt the password with the StrongPasswordEncryptor, you
> will get a different digest value (this is because a random salt value
> is used each time). So comparing two values encrypted with the
> StrongPasswordEncryptor will not work. Instead, use the checkPassword()
> method which takes the plain text password and the already digested
> password as arguments. This method will use the salt of the already
> digested password to digest the plain text password and compare the
> results.
>
> Hope this helps,
>
> Joe Hindsley
>
>
> Carlo Camerino wrote:
>> +------------------------+
>> Jasypt Users List
>> http://www.jasypt.org
>> +------------------------+
>>
>>
>> ------------------------------------------------------------------------
>>
>> hi,
>>
>> how can i use strongpasswordencryptor to encrypt a password and then
>> compare it with another password which i encrypted using a
>> strongpasswordencryptor as well..
>>
>>
>> from my experience,
>>
>> i try to use matches but it doesn't seem to work for this ....
>>
>> Can anyone explain the output of a strongpasswordencryptor?
>>
>> like where is the salt located etc....
>>
>> Thanks A Lot
>> Carlo
>>
>>
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------------
>> Protect Your Site and Customers from Malware Attacks
>> Learn about various malware tactics and how to avoid them. Understand
>> malware threats, the impact they can have on your business, and how you
>> can protect your company and customers by using code signing.
>> http://p.sf.net/sfu/oracle-sfdevnl
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> jasypt-users mailing list
>> jas...@li...
>> https://lists.sourceforge.net/lists/listinfo/jasypt-users
>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand
> malware threats, the impact they can have on your business, and how you
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> jasypt-users mailing list
> jas...@li...
> https://lists.sourceforge.net/lists/listinfo/jasypt-users
>
>
--
View this message in context: http://old.nabble.com/Question-on-How-To-Use-StrongPasswordEncryptor-tp30719062p32401933.html
Sent from the Jasypt - Users mailing list archive at Nabble.com.
|