RSA Encrypt/Decrypt in Java?

I was interested as well, I went "Google-ing" and found this interesting page. It is a lot of information, but very interesting in my opinion. di-mgt.com.au/rsa_alg.html.

Saying it is in base64 format is not enough information. There are at least two common ways that an RSA public key may be formatted, and either one may be base64 encoded. If you are lucky, the key is an X509EncodedKeySpec.

If so, you need to base64 decode it, create a KeyFactory, then use the KeyFactory to generate the public key. Here some untested, not even compiled, code that hopefully shows these steps. // Example using the base64 class from iharder.sourceforge.net/current/java/bas... byte x509Key = Base64. Decode(base64Key); KeyFactory kf = KeyFactory.

GetInstance("RSA"); RSAPublicKey rsaPub = (RSAPublicKey) kf.generatePublic(); If there are -----BEGIN and ----END lines surrounding your base64 key just delete them.

The public key is used to decrypt ciphertext which has been encrypted by the private key. Each user that want to communicate has a pair of cryptographic keys—a public encryption key and a private decryption key. You can encrypt using the public key becuse the keys are derived mathematically, but parameters are chosen so that determining the private key from the public key is prohibitively expensive.

Let say user A generated keys (public/private) and supplies user B the public key. I thought user B encrypts using the public key. User A can then decrypt on his end using the private/public keys.

– AbbIbb Oct 18 at 16:36.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions