tags:

views:

140

answers:

2

While trying to encrypt a given input using Elliptic Curve Cryptography in Java I'm using the following algorithms for generating the cipher and the key:

KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA"); Cipher cipher = Cipher.getInstance("ECIES");

Now as expected, the cipher isn't accepting the keys generated by the ECDSA algorithm. I get the error as - must be passed IE key.

I searched for the ciphers being supported by these 2 methods here: http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#Cipher

Unfortunately no else algo is supported for ECC. Has anyone used ECC generated keys to encrypt/decrypt an input? Which algo should I use for both so that they don't clash with each other?

A: 

According to http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator, you need to pass "EC" for an instance of the KeyPairGenerator for ECC.

Marc
Even when I use EC, the cipher using ECIES doesn't recognise it as a valid key.
Rookie_22
A: 

Also for a more feature-rich cryptography implementation take a look at Bouncycastle.

dynomite24
Already using it.
Rookie_22