在Java中尝试使用椭圆曲线加密算法加密给定的输入时,我使用以下算法来生成密码和密钥:
KeyPairGenerator g= KeyPairGenerator.getInstance("ECDSA");Cipher cipher = Cipher.getInstance("ECIES");
现在,正如预期的那样,密码不接受由ECDSA算法生成的密钥。我得到了错误,因为-必须传递IE键。
我在这里搜索了这两种方法支持的密码:http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#Cipher
不幸的是,ECC不支持其他算法。是否有人使用ECC生成的密钥来加密/解密输入?我应该为两者使用哪种算法,这样它们就不会相互冲突?
发布于 2010-06-02 00:13:32
根据http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator的说法,您需要为ECC的KeyPairGenerator实例传递"EC“。
发布于 2010-06-02 01:19:21
另外,要获得功能更丰富的加密实现,请看一下Bouncycastle。
https://stackoverflow.com/questions/2950371
复制相似问题