SecurePacketEnvelope is a hybrid cryptosystem that encrypts user sensitive data efficiently and securely, supporting symmetric and asymmetric encryption algorithms. SecurePacketEnvelope uses AES256-CBC-PKCS7 and RSA-2048 by default.
It is created with UIKit, CommonCrypto, Combine.
SecurePacketEnvelope requires iOS 13.0 or later. If you are developer, you can set its deployment target to lower iOS version if needed.
Public-key ciphers (ie. RSA) are generally slow, inefficient, and have a plaintext size limit. Symmetric ciphers (ie. AES) require secure key exchange, which may not always be possible. Hybrid cryptosystems use both types of ciphers in tandem to efficiently encrypt plaintext, without requiring secure key exchange.
- No third-party dependencies
- Lightweight implementation of AES256-CBC with generated Random Key + IV.
- Cryptography logic derived from Apple's reliable CommonCrypto library
I have explained about SecurePacketEnvelope in the form of a post on Medium.
https://medium.com/@mehran.kmlf/build-a-secure-envelope-in-ios-swift-f1f0297d2562
SecurePacketEnvelope is available under the MIT license. See the LICENSE file for more info.