RSA algorithm library for Java

java, open-source, rsa

Solution

Just use the `javax.crypto` and `java.security` packages. It's in the Java standard platform.

KeyPair keys = KeyPairGenerator.getInstance("RSA").generateKeyPair();
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, keys.getPublic());
byte[] encrypted = cipher.doFinal(rawData);

Links for the official documentation:

- Package `javax.crypto` documentation

- Package `java.security` documentation

Problem

I want to provide my application with simple licensing mechanism based on RSA algorithm. Are there any free RSA libraries?

Original source