Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / March 2004

Tip: Looking for answers? Try searching our database.

encrypt using RSA? (newbee)

Thread view: 
stig - 28 Feb 2004 11:35 GMT
hi
wanted to make a test to encrypt/decrypt using RSA.

ia managed to create the public and private key but have problem using
them to encrypt anything.

i try to create a Cipher (as one can do using DES), but then i get:

Cipher rsaCipher;
rsaCipher = Cipher.getInstance("RSA");

when i run the proram i get:
java.security.NoSuchAlgorithmException: Cannot find any provider
supporting RSA

maybee i should do it in a rather different way, but how?

thanks
stig
Michel Gallant - 28 Feb 2004 16:09 GMT
Here are some simple samples which compare RSA encryption in Java2, .NET
and CryptoAPI:
  http://www.jensign.com/JavaScience/dotnet/RSAEncrypt

- Michel Gallant
  MVP Security
  http://www.jensign.com

> hi
> wanted to make a test to encrypt/decrypt using RSA.
[quoted text clipped - 15 lines]
> thanks
> stig
GianpieroP - 01 Mar 2004 23:24 GMT
| java.security.NoSuchAlgorithmException: Cannot find any provider
| supporting RSA

You're using Java Cryptography Architecture (JCA).
To work with it, you must use one or more
cryptographic provider.

A Cryptographic provider provides you some implementation of
known cryptographic algorithms (including RSA).

Exception (reported above) indicates you that Security System can't
find
any provider implementing RSA algorithm.

You can get a free provider (called BouncyCastle Provider)
from web at http://www.bouncycastle.org or .com (I don't remember).

Now you must proceeded in this way:

1. Add the jar file that you have downloaded from BC
   site (as indicated above) to your classpath.

2. Register BC provider dinamically into your Security
   System as below:
       Security.addProvider(new
         org.bouncycastle.jce.provider.BouncyCastleProvider());

3. Use RSA implementation provided by BC (Bouncy Castle)
   as follow:
   rsaCipher = Cipher.getInstance("RSA"); or explicity
   rsaCipher = Cipher.getInstance("RSA","BC");

I hope that my english is readable :-(

Hi,
GianpieroP


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.