A hash-based message authentication algorithm.
- iOS 13.0+Beta
- macOS 10.15+Beta
- Mac Catalyst 13.0+Beta
- tvOS 13.0+Beta
- watchOS 6.0+Beta
- Xcode 11.0+Beta
- Apple Crypto
Use hash-based message authentication to create a code with a value that’s dependent on both a block of data and a symmetric cryptographic key. Another party with access to the data and the same secret key can compute the code again and compare it to the original to detect whether the data changed. This serves a purpose similar to digital signing and verification, but depends on a shared symmetric key instead of public-key cryptography.
As with digital signing, the data isn’t hidden by this process. When you need to encrypt the data as well as authenticate it, use a cipher like
Cha to put the data into a sealed box (an instance of