import de.rtner.misc.BinTools; import de.rtner.security.auth.spi.*; /** *
* Request for Comments: 6070 PKCS #5: Password-Based Key Derivation Function 2 (PBKDF2) Test Vectors *
* Ad-hoc test program that checks test #6.
* Values are hard-coded. Compile and run with
*
* javac -cp PBKDF2-1.0.4.jar RFC6070Test6.java
* java -cp PBKDF2-1.0.4.jar;. RFC6070Test6
*
*
* This piece of code is in the public domain. * * @see RFC 2898 * @see RFC 6070 * @author Matthias Gärtner * @version 1.0 */ class RFC6070Test6 { public static void main( String[] args ) { PBKDF2Parameters p = new PBKDF2Parameters("HmacSHA1","ISO-8859-1",null,0); new PBKDF2HexFormatter().fromString(p, "7361006C74:4096:56fa6aa75548099dcc37d7f03425e0c3"); boolean verifyOK = new PBKDF2Engine(p).verifyKey("pass\0word"); System.out.println(verifyOK ? "OK" : "FAIL"); } }