This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RSA Encryption

 
Ramesh Pappala
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If generated public and private key pairs using RSA algorithm, and after that I want to encrypt some data with the public key. How I can achieve it.
I need an example program to encrypt data using rsa public key. Is it necessary to use rsa algorithm in encyption, when we used rsa algorithm to created public and private keys. Please give me the answer with an example.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java API for encryption is called JCE; a code sample can be found here. This one in particular uses DES, not RSA, but by reading the relevant javadocs you should be able to adapt it easily.

And yes, RSA keys can be used with RSA only.
 
Ramesh Pappala
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou Ulf Dittmer, for giving an example.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic