Search code examples
javapublic-keyencryption-asymmetric

Any tutorials on public key encryption in java?


I've been able find information on symmetric encryption and hashing but I've been having quite a bit of trouble finding much information on any sort of public key encryption for java. What I'd like to do is make a very simple proof of concept program that takes a string ( or a file I suppose), encrypts it with a public key and then decrypts it with a private key.

Any tutorial links or examples would be appreciated. I just want to make something demonstrating how you can use public key encryption in Java.


Solution

  • There are quite a few resources on the web about that. Basically it turns around the KeyPairGenerator class.

    See http://www.informit.com/articles/article.aspx?p=170967&seqNum=4 for an example program.