People expect apps to be secure and their data to be protected. You may need to perform cryptographic operations to implement features such as authentication, message encryption, or to meet regulatory requirements. CryptoKit is a Swift framework that makes it easier and safer to perform common cryptographic operations, whether you just need to compute a hash or implement a more advanced authentication protocol. This year, CryptoKit adds new APIs for HMAC-based Extract-and-Expand Key Derivation Functions (HKDF), support for PEM and DER formats, and with Swift Crypto, your code can now run anywhere Swift runs.
Key diversion features allow you to derive one or more secrets of the size you want from a master key or password. As of iOS 1
PEM and DER formats for encoding elliptical curve keys
PEM and DER formats are now directly supported in CryptoKit. You can now send a PEM string or DER-encoded data to initialize CryptoKit public and private keys, without using another library to perform the conversion.
With Swift Crypto, you can create platform solutions using CryptoKit APIs on all platforms that Swift supports, including Linux and servers. Portability is important when you need to run the same code on the client and server, such as supporting two-factor authentication using a one-time password.
We present Swift Crypto
See “Cryptography in Swift” from dotSwift 2020