No such algorithm: RSA
hi
i tried this encryption
I am geting no such algorithm
Cipher cipher = Cipher.getInstance("RSA","SunJCE");
cipher.init(Cipher.ENCRYPT_MODE, getPublicKey());
//byte encrypted[] = cipher.doFinal(getBytes(abc));
byte encrypted[] = cipher.doFinal(abc.getBytes());
byte output[] = cipher.doFinal(encrypted);
System.out.println("The string was ");
System.out.println(new String(output));
returnnew String(output);
# 2
> hi
>
> i tried this encryption
>
> I am geting no such algorithm
>
>
>
> Cipher cipher = Cipher.getInstance("RSA","SunJCE");
>
> ...
For all I know about Java/Sun's cryptograhy provider (which is not a lot!), JDK version >= 1.4 should be able to run that code without throwing exceptions: the RSA algorithm from the SunJCE is shipped with those versions of the JDK. If you have a JDK before 1.4, try to upgrade, or if you have a JDK >= 1.4, try to reinstall it.
If the above does not help you (which is probably the case ; ) ), try posting your message in the cryptography section of this forum:
http://forum.java.sun.com/forum.jspa?forumID=9
Good luck.
Edit:
Christ, I must've had this window open for more than an hour! I just saw sabre's post...