Skip to content
Advertisement

PHP Libsodium default encryption method

I’m sure this must’ve been asked and answered but can’t find where…

With libsodium in PHP (7.0 / 7.1), what is the default encryption method employed (or where to find it) when you do something like this?

$enc = sodium_crypto_secretbox($data, $mykey, $sodiumkey);

A client wants it stated in the handover documentation but I can’t find what it is.

Advertisement

Answer

Algorithm details

  • Encryption: XSalsa20 stream cipher
  • Authentication: Poly1305 MAC

Taken from https://doc.libsodium.org/secret-key_cryptography/secretbox

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement