Elliptic Curve Encryption in Java 7... Is it implemented?
According to this documentation JAVA 7 supports Elliptic Curve encryption.
Standard Algorithm Name Documentation
I've tried
Code:
Cipher cipher = Cipher.getInstance("ECIES");
but I get
Code:
Exception in thread "main" java.security.NoSuchAlgorithmException: Cannot find any provider supporting ECIES
at javax.crypto.Cipher.getInstance(Cipher.java:523)
at com.company.poc.apps.test.urlcipher.impl.ECPurePKI.crypt(ECPurePKI.java:36)
at com.company.poc.apps.test.urlcipher.PkiPerformance.testEncryption(PkiPerformance.java:139)
at com.company.poc.apps.test.urlcipher.PkiPerformance.execute(PkiPerformance.java:297)
at com.company.poc.apps.test.urlcipher.PkiPerformance.main(PkiPerformance.java:265)
I can't see it listed when I run that code either:
Code:
private static void debugProviders() throws Exception {
if (log.isDebugEnabled()) {
log.debug("**************** JCE PROVIDERS BEGIN ***************");
Set<String> set = new TreeSet<String>();
Provider[] providers = Security.getProviders();
for (Provider p: providers) {
//log.debug("Provider class: " + provider);
/*Class<?> providerClass = Class.forName(provider);
Object o = providerClass.newInstance();*/
//Provider p = (Provider)o;
for (Entry<Object, Object> entry: p.entrySet()) {
String key = entry.getKey().toString();
String value = entry.getValue().toString();
if ((key.startsWith("Cipher.")) && (value.indexOf('.') > 0)) {
set.add(key.toString().substring(7) + ": " + value.toString());
}
}
}
for (String s: set) {
log.debug(s);
}
//log.debug(" ");
log.debug("**************** JCE PROVIDERS end ***************");
}
}
I'm using the Unlimited Strength downloaded from Sun Website. I've generated a key pair using
Quote:
keytool -genkeypair -keyalg EC -keysize 160 -keystore test-ie.jks -storepass password -alias ec160 -dname "CN=Yoram Halberstam, OU=Test EC 160, O=COMPANY, L=London, ST=London, C=GB"