This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Generating key for RC2

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to write a very basic program to encrypt a string using RC2. I am stuck in the first step itself...KeyGenerator class does not support the RC2 algorithm. So what do I do? If there are any existing (simple) examples using RC2, please do point them out.
Thanks,
Kashmira
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to implement RC2 or just get a string encrypted by RC2?
I found a web page giving javadoc for someone's implementation here.
There was also another site with this question (related to JCE):
"How do I encrypt/decrypt using RC2?" (needs a membership to view the answer)
 
Kashmira Patel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Richard Jensen:
Are you trying to implement RC2 or just get a string encrypted by RC2?
I found a web page giving javadoc for someone's implementation here.
There was also another site with this question (related to JCE):
"How do I encrypt/decrypt using RC2?" (needs a membership to view the answer)


Just trying to get a string encrypted by RC2.
This is what I did:
KeyGenerator kgen = KeyGenerator.getInstance("RC2");
SecretKey deskey = kgen.generateKey();
This is the error I get:
java.security.NoSuchAlgorithmException: Algorithm RC2 not available
at javax.crypto.SunJCE_b.a(DashoA6275)
at javax.crypto.KeyGenerator.getInstance(DashoA6275)
----------
Thanks,
Kashmira
 
Author
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The sun JCE provider doesn't provide RC2. Are you asking for another provider that does handle RC2 or are you looking for non-JCE code that does RC2? For the former, look to the sun website. There are provider lists for each JCE version. I can't help with the latter...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!