I want to provide my application with simple licensing mechanism based on RSA algorithm.
Are there any free RSA libraries?
Whether it is as difficult as the factoring problem is an open question. There are no published methods to defeat the system if a large enough key is used. RSA is a relatively slow algorithm. Because of this, it is not commonly used to directly encrypt user data.
It took 8 million core hours to crack RSA-240, and computing the discrete logarithm was even more time-intensive, taking 27 million core hours. The RSA keys most commonly used by ordinary computers today are larger in size, around 2048 bits, so the calculation isn't a threat to computer security.
Disadvantages of RSAIt may fail sometimes because for complete encryption both symmetric and asymmetric encryption is required and RSA uses asymmetric encryption only. It has slow data transfer rate due to large numbers involved. It requires third party to verify the reliability of public keys sometimes.
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:
javax.crypto
documentationjava.security
documentationIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With