我是一名iOS开发人员,试图使用Secure enclave生成ECC对密钥。我可以在这里使用示例应用程序成功地做到这一点:https://github.com/agens-no/EllipticCurveKeyPair。当我将此密钥与Python实现一起使用以执行此处提到的加密和解密时:https://gist.github.com/dschuetz/2ff54d738041fc888613f925a7708a06它可以工作
问题是我需要一个Java代码来做同样的事情。有谁能帮我实现这一点,或者给我指出一个与Python代码做相同工作的代码
在iOS端,我正在执行eciesEncryptionStandardX963SHA256AESGCM
加密和解密逻辑
我知道我应该自己解决这个问题。但我是一名iOS工程师,正在尝试Java后端。如果有人能指导我,我会很有帮助的
根据答案创建了一个示例Java代码。链接到代码:https://gist.github.com/balrajOla/fa2f6030538b20a396c086377a6f7114
使用此处提供的示例iOS应用程序:https://github.com/agens-no/EllipticCurveKeyPair。我生成了ECC密钥。 然后将公钥传递给Java代码以创建加密消息。此加密消息将传回上述iOS应用程序示例,并使用ECIE加密标准X963SHA256AESGCM算法进行解密。 但是我们得到了下面提到的一个错误。
在Java中有两个有趣的类-ECGenParameterSpec和KeyPairGeneratorECGenParameterSpec指定用于生成椭圆曲线域参数的参数,KeyPairGenerator用于生成公钥和私钥对
在Nokilay Elenkov的书Android Security Internals中,有一个很好的代码示例,说明了它们的组合可以生成密钥对
这是对前面代码的解释
我们也有同样的问题。我们希望在iOS安全enclave上使用Java后端实现EC密钥交换
经过三天的审讯,;错误,我们终于找到了一个正在工作的Java实现
Java代码取自https://github.com/O2-Czech-Republic/BC-ECIES-for-iOS
和iOS代码,使用ECiseEncryptionCofactorVariableIVX963SHA256AESGCM算法:
相关问题 更多 >
编程相关推荐