I want public-private key encryption and hence try to use RSA.
A few I have used are:
My Java implementation is:
BigInteger d = new BigInteger("1f3fac65c4ae222e3a3074dd4c38fbb72c0705c4bbac0385b867c12c25a44e01", 16); BigInteger e = new BigInteger("65537"); BigInteger N = new BigInteger("b42e91fbca364cf2a125aec67ffbdab624fd401100c40ea05189ba34d1028b0d", 16); String messageToEncrypt = "kishor"; byte  messageByte = messageToEncrypt.getBytes(); BigInteger message = new BigInteger(messageByte); //Encrypting and Decrypting messages //Encrypt a message using N and e: BigInteger ciphertext = message.modPow(e, N); //Decrypt the message using N and d: BigInteger plaintext = ciphertext.modPow(d, N); byte plainTextByte = plaintext.toByteArray(); String decryptMessage = new String(plainTextByte); /*System.out.println("p : " + p); System.out.println("q : " + q);*/ System.out.println("N : " + N.toString(16)); System.out.println("e : " + e.toString(16)); System.out.println("d : " + d.toString(16)); /*System.out.println("PhiN : " + PhiN);*/ System.out.println("ciphertext : " + ciphertext.toString(16)); System.out.println("decryptMessage : " + decryptMessage); }
Kindly let me know if it is possible as I have searched many questions (on Stack Overflow itself) but am unable to find a solution. I am searching for a well tested pre-built library.