I am porting my Android app over to iOS and need to integrate encryption for communication with an existing server.
I need to be able to use AES-CBC and RSA-ECB.
My research has led me to the CommonCrypto library, but I have been stuck on this for days now, not finding how to integrate the library into my XCode project.
I am using XCode version 12.2 (not sure what version of swift comes with that though).
The methods I have tried to get CommonCrypto into the project are adding import CommonCrypto into the swift file, or adding #import <CommonCrypto/CommonCrypto.h> into the bridging header. Both of these makes XCode complain saying it cannot compile the Obective-C module.
In addition, I have not been able to find documentation explaining the correct way of using the library.
I need to :
- Generate public and private keys for AES
- Generate public and private keys for RSA
- Encrypt and decrypt with AES-CBC with PKCS5 padding
- Encrypt and decrypt with RSA-EBC with PKCS1 padding
Please note that I cannot change the encryption standards used.
Should I stick with CommonCrypto, go with OpenSSL, another fairly future proof solution ?
I would really appreciate help and guidance with this, please.
(Sorry, could not find any better tags)