ideawu / Objective-C-RSA

Doing RSA encryption and decryption with Objective-C on iOS
http://www.ideawu.com/blog/post/132.html
Other
1.15k stars 280 forks source link

并发的加解密会导致失败 #54

Closed Tylor12 closed 4 years ago

Tylor12 commented 4 years ago

并发的加解密会导致加密和解密失败

ideawu commented 4 years ago

RSA 在这个地方使用了公共的资源: https://github.com/ideawu/Objective-C-RSA/blob/master/RSA.m#L131 所以不是线程安全的. 目前的解决方案是在你的代码中避免多线程调用 encryptString().