You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the matches operation, SCryptPasswordEncoder retains the instance keyLength rather than the target digest keyLength. It makes it very difficult to verify non-homogenous digests with different key lengths.
Why is that? A security consideration?
Actual Behavior
SCryptPasswordEncoder matches operation fails if instance keyLength differs from target digest key length.
Expected Behavior
SCryptPasswordEncoder matches operation ought to use the target digest key length.
Configuration
SCryptPasswordEncoder instance keyLength differs from target digest key length.
Version
4.2.3.RELEASE
Sample
Simple example prints true
SCryptPasswordEncoder encoder = new SCryptPasswordEncoder(8192, 16, 1, 32, 32);
String raw = "password";
String digest = encoder.encode(raw);
System.out.println(encoder.matches(raw, digest));
Instance parameters differ from digest parameters, except key length - prints true
SCryptPasswordEncoder encoder = new SCryptPasswordEncoder(8192, 16, 1, 32, 32);
SCryptPasswordEncoder tester = new SCryptPasswordEncoder(1024, 8, 1, 32, 24);
String raw = "password";
String digest = encoder.encode(raw);
System.out.println(tester.matches(raw, digest));
Only the key length differs - prints false
SCryptPasswordEncoder encoder = new SCryptPasswordEncoder(8192, 16, 1, 32, 32);
SCryptPasswordEncoder tester = new SCryptPasswordEncoder(8192, 16, 1, 24, 32);
String raw = "password";
String digest = encoder.encode(raw);
System.out.println(tester.matches(raw, digest));
The text was updated successfully, but these errors were encountered:
Summary
During the
matches
operation, SCryptPasswordEncoder retains the instancekeyLength
rather than the target digestkeyLength
. It makes it very difficult to verify non-homogenous digests with different key lengths.Why is that? A security consideration?
Actual Behavior
SCryptPasswordEncoder
matches
operation fails if instancekeyLength
differs from target digest key length.Expected Behavior
SCryptPasswordEncoder
matches
operation ought to use the target digest key length.Configuration
SCryptPasswordEncoder instance
keyLength
differs from target digest key length.Version
4.2.3.RELEASE
Sample
Simple example prints
true
Instance parameters differ from digest parameters, except key length - prints
true
Only the key length differs - prints
false
The text was updated successfully, but these errors were encountered: