Stream cipher family

Salsa20

Bernstein's eSTREAM-portfolio ARX stream cipher and the core of scrypt and NaCl

standard 4 variants eSTREAM portfolio (software profile)

Overview

Salsa20 is a stream cipher designed by Daniel J. Bernstein in 2005 and selected for the eSTREAM software portfolio. It is the predecessor of ChaCha and is used in NaCl's secretbox as XSalsa20 and inside scrypt as Salsa20/8.

Salsa20 keeps a 4x4 matrix of 32-bit words with constants on the diagonal, the key, a 64-bit nonce and a 64-bit counter. Its quarter-round updates words with addition, rotation and XOR in a different order from ChaCha, and rounds alternate between columns and rows. The input is added to the output after all rounds to produce a 64-byte keystream block.

NextSSL includes Salsa20 (20 rounds), Salsa20/12, the eSTREAM portfolio recommendation, Salsa20/8, the core used by scrypt, and XSalsa20, which extends the nonce to 192 bits via HSalsa20 and is used in NaCl and libsodium. Salsa20's design was later refined into ChaCha for better diffusion. Like ChaCha, it is seekable and needs no padding.

History

2004–2008
  1. ECRYPT launches eSTREAM to find new stream ciphers

    eSTREAM project
  2. Salsa20 submitted to eSTREAM

  3. Selected in the eSTREAM software portfolio

Security notes

No practical attacks on Salsa20/20 or Salsa20/12 are known; the best attacks reach eight rounds. Salsa20/8 is used inside scrypt as a mixing function, not as a cipher. As with any stream cipher, never reuse a key and nonce pair.

Typical uses

NaCl/libsodium secretbox (XSalsa20-Poly1305)scrypt's internal mixingFast software encryption

Variants in NextSSL

4
AlgorithmTierSizes (bytes)StandardsAPI
Salsa20
salsa20
standard key 32 · nonce 8 eSTREAM portfolio (software profile) safe
Salsa20-12
salsa20-12
standard key 32 · nonce 8 eSTREAM Salsa20/12 safe
XSalsa20
xsalsa20
standard key 32 · nonce 24 NaCl crypto_stream_xsalsa20 safe
Salsa20-8
salsa20-8
research key 32 · nonce 8 Salsa20/8 (scrypt core) root

Frequently asked questions

Which Salsa20 variants does NextSSL include?

NextSSL registers 4 Salsa20 variants: salsa20, salsa20-12, xsalsa20, salsa20-8.