How do I implement Scrypt in Java?

I was really struggling to get Bouncy Castle Scrypt to use my web app to encrypt passwords. I am new to Java programming and security.

I tried looking through the Bouncy Castle documentation for their Scrypt class . However, I am really having a hard time understanding how this works. It doesn't seem to provide a lot of information on how to create a class or something.

I searched Stack Exchange and Google to find anything that could give me a good example of what I should do to create this class. I found this question and answer and I tried it without creating the class, but that didn't seem to work either.

To top it off, my import doesn't want to work either.

This is all the code I have:

import org.bouncycastle.crypto.generators;

public class SCrypt extends java.lang.Object {

    public Scrypt(){}

    public static byte[] generate(byte[] P,byte[] S,int N,int r,int p,int dkLen) {

    }
}

      

I want to use Scrypt as it seems to be the most secure when encrypting passwords, but it cannot be implemented further on. I'm really close to just switching to PBKDF2 as there is more documentation on it, but I hope there is someone who can help me with this.

+3


source to share


1 answer


Thanks Hugo for the feedback! After a lot of struggle and searching, I found this site: http://www.itcsolutions.eu/2011/08/22/how-to-use-bouncy-castle-cryptographic-api-in-netbeans-or-eclipse-for- java-jse-projects /



This helped me step by step into what I need to get Bouncy Castle running on my computer. Hope this helps others, as I struggled with it for so long to find something that broke this on unprofessional terms. :)

+1


source







All Articles