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 simply need to compute a hash or are implementing 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 everywhere Swift runs.

HKDF

Key derivation functions allow you to derive one or more secrets of the size of your choice from a master key or passcode. Starting in iOS 14, you can now use standalone APIs for HKDF. Integrate the easy to use one-shot variant for quick tasks such as deriving multiple keys from a master secret, or the two-step extract and expand API with fine-grained control over the key derivation process. In prior versions of iOS, HKDF was supported only when deriving a symmetric key from an elliptic curve key agreement protocol.

HKDF

PEM and DER formats for encoding elliptic curve keys

PEM and DER formats are now supported directly in CryptoKit. You can now directly pass 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 cross-platform solutions using the CryptoKit APIs on all platforms that Swift supports, including Linux and servers. Portability is important when you need to run the same code on your client and server, such as supporting two-factor authentication using a One-Time Password.

Resources

Introducing Swift Crypto

Watch “Cryptography in Swift” from dotSwift 2020

Recent Articles

How to log out of Facebook Messenger

Facebook decided a while back to make Messenger its own standalone app....

Migrating Jupiter May Have Made Venus Uninhabitable Long Ago | Planetary Science

Early in the formation of Jupiter as a planet, it moved closer to and then away from the Sun due to interactions with the...

Jordyn Woods Explains How Shared Family Tragedy ‘Connected’ Her & New BF Karl-Anthony Towns

Jordyn Woods is opening up about her sweet new romance with Karl-Anthony Towns and how tragic family losses unexpectedly brought them together. In case you...

How to file great bug reports – Discover

Bugs are an inevitable part of the development process. Though they can be frustrating to bump up against, you can help squash these sorts...

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox