[英]iOS swift3 equivalent of “RSA/NONE/OAEPWithSHA256AndMGF1Padding”
使用SwiftyRSA在客户端上使用publicKey加密文本时,服务器上出现解密错误。
我已经提到了RSA:在iOS中加密,在Java中解密,但这是针对SHA1的。
我正在使用https://github.com/TakeScoop/SwiftyRSA库。
kSecPaddingOAEP
和RSA/NONE/OAEPWithSHA1AndMGF1Padding
起作用。 但是如何使它适用于RSA/NONE/OAEPWithSHA256AndMGF1Padding
let str = "Clear Text"
let clear = try ClearMessage(string: str, using: .utf8)
let encrypted = try clear.encrypted(with: publicKey, padding: .OAEP)
我想在swift3中加密数据而不接触服务器代码。
据我所知,Apple的安全框架不支持带有SHA256哈希摘要的OAEP填充,但是可以通过OpenSSL库完成。 https://github.com/x2on/OpenSSL-for-iPhone
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.