SealedBox

A secure container for your data that you can access using a cipher.

AES-GCM.swift:115
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
struct SealedBox

Use a sealed box as a container for data that you want to transmit securely. Seal data into a box with one of the cipher algorithms, like seal(_:using:nonce:).

The box holds an encrypted version of the original data, an authentication tag, and the nonce during encryption. The encryption makes the data unintelligible to anyone without the key, while the authentication tag makes it possible for the intended receiver to be sure the data remains intact.

The receiver uses another instance of the same cipher, like the open(_:using:) method, to open the box.