要求是,有两个设备(alice 和 bob)使用 diffie hellman 生成公钥和私钥。公钥将在两个设备(alice 和 bob)之间交换,并使用其私钥生成 key 。
这适用于 iOS,无论是 Objective C 还是 Swift。我尝试过raorafat(GitHub代码)和其他源代码;但是,并没有真正针对我的要求制定解决方案。
如果我将我的公钥共享给服务器,服务器将如何处理我的公钥以生成对称 key 。
最佳答案
您可以从 Swift 使用 Apple 的 CommonCrypto 库。有关使用 CCDH 的示例,请参阅 https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60118.50.1/test/CommonCrypto/CommonDHtest.c.auto.html
您可以使用
导入它import CommonCrypto
在您的 Swift 项目中。
关于ios - 在iOS swift/Objective C中实现Diffie Hellman生成公钥和私钥的方法有哪些?(除了Chilkat),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56884666/