php8.5
Home/ Manual/ sodium / functions/ sodium_crypto_auth

sodium_crypto_auth

PHP function Edit on GitHub ✎

(PHP 7 >= 7.2.0, PHP 8)

Compute a tag for the message

Description

sodium_crypto_auth(string $message, string $key): string

Symmetric message authentication via sodium_crypto_auth() provides integrity, but not confidentiality.

Unlike with digital signatures (e.g. sodium_crypto_sign_detached()), any party capable of verifying a message is also capable of authenticating their own messages. (Hence, symmetric authentication.)

Parameters

message

The message you intend to authenticate

key

Authentication key

Return Values

Authentication tag

Source: reference/sodium/functions/sodium-crypto-auth.xml · from the official PHP manual (php/doc-en)