Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageHere 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 "stig" <_nospam_stigerikson@yahoo.se> wrote in message news:c1puld$a21$1@oden.abc.se...[col or=darkred] > 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[/color]
Post Follow-up to this message-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 "stig" <_nospam_stigerikson@yahoo.se> ha scritto nel messaggio news:c1puld$a21$1@oden.abc.se... | 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 -----BEGIN PGP SIGNATURE----- Version: PGP 8.0 iQA/ AwUBQEPGFZ4sPKh9SaicEQJasgCgysbl54qGsbTq xQ7B8iNMoipLTdgAnjTY 36vTsba/OpFMTGPk0898Az/l =8bkv -----END PGP SIGNATURE-----
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.