import java.io.*;
import java.security.*;
import javax.crypto.*;
class Encrypt {
private Cipher RSAtransform;
public Encrypt()
{
Provider rsajca = new com.sun.rsajca.Provider();
Security.addProvider(rsajca);
try
{
RSAtransform = Cipher.getInstance("RSA",rsajca);
}
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
catch (NoSuchPaddingException e) {
e.printStackTrace();
}
}
...
...
But when I run it on winxp (using Java 1.4.2) I get:
java.security.NoSuchAlgorithmException: No such algorithm: RSA
at javax.crypto.SunJCE_b.c(DashoA6275)
at javax.crypto.SunJCE_b.a(DashoA6275)
at javax.crypto.Cipher.a(DashoA6275)
at javax.crypto.Cipher.getInstance(DashoA6275)
at keys.Encrypt.<init>(Encrypt.java:18)
at keys.Encrypt.main(Encrypt.java:115)
java.lang.NullPointerException
at keys.Encrypt.encrypt(Encrypt.java:73)
at keys.Encrypt.main(Encrypt.java:128)
Why is it not possible to use the RSA algorithm?
I would prefer to use an asymmetric algorithm instead of DES.
Hope someone can help
JOhs
Johs