1

在尝试使用 Java 中的椭圆曲线密码术加密给定输入时,我使用以下算法生成密码和密钥:

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

现在正如预期的那样,密码不接受 ECDSA 算法生成的密钥。我收到错误 - 必须通过 IE 密钥。

我在这里搜索了这两种方法支持的密码:http: //java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#Cipher

不幸的是,ECC 不支持其他算法。有没有人使用 ECC 生成的密钥来加密/解密输入?我应该为两者使用哪种算法,以免它们相互冲突?

4

2 回答 2

1

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.

于 2010-06-01T16:13:31.817 回答
0

另外,对于功能更丰富的密码学实现,请查看Bouncycastle

于 2010-06-01T17:19:20.590 回答