Question

Is there PBKDF2 implementation for Android. I am trying to derive a key using PBKDF2 function. I couldn't find an example to do so.

Was it helpful?

Solution

Free options would be:

IF a commercial component is an option see for example http://www.chilkatsoft.com/java-encryption.asp (sample code http://www.example-code.com/android/crypt2_pbkdf2.asp).

Another option is to use javax.crypto and implement it yourself although I wouldn't recommend that...

OTHER TIPS

Late to the party, but a lot of Android devices DO include PBKDF2 with the standard SecretKeyFactory. However, a lot of people recommend using something like Spongycastle to guarantee that you'll have that algorithm available.

It does throw an exception if it can't find one

    SecretKeyFactory keyFactory = null;
    try
    {
        keyFactory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
    } 
    catch (NoSuchAlgorithmException e)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top