Home / IOS Development / What’s new in CryptoKit – Discover

What’s new in CryptoKit – Discover



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.

HKDF

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

4, you can now use standalone APIs for HKDF. Integrate the easy-to-use one-shot variant for quick tasks, such as retrieving multiple keys from a key secret, or two-step snippet, and expand the API with fine-grained control over the key diversion process. In previous versions of iOS, HKDF was only supported when a symmetric key was retrieved from an elliptical wrench protocol.

HKDF

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.

Portability

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.

Resources

We present Swift Crypto

See “Cryptography in Swift” from dotSwift 2020


Source link