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