Salsa20-8
Bernstein's eSTREAM-portfolio ARX stream cipher and the core of scrypt and NaCl
Experimental or unclassified. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About Salsa20-8
Salsa20-8 is one of 4 Salsa20 variants in the NextSSL registry, a stream cipher. It uses a 32-byte (256-bit) key and an 8-byte nonce. Its registry entry cites Salsa20/8 (scrypt core). NextSSL lists it in the research tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
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–2008ECRYPT launches eSTREAM to find new stream ciphers
eSTREAM projectSalsa20 submitted to eSTREAM
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
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 32 | Secret key |
| nonce | 8 | Nonce / IV |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'research' is reachable from the root API only
ct = root.call("stream_apply", "salsa20-8", None, key, nonce, b"secret")[0] # same call decrypts
nextssl_root_stream_apply("salsa20-8", NULL, key, nonce, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_streamcipher_in(reg::all(), Policy::Any, "salsa20-8", &Params::new())?;
let ct = alg.apply_keystream(&key, &nonce, b"secret")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other Salsa20 variants
3Similar names
Looking for something else?More stream ciphers
All 37Frequently asked questions
What is Salsa20-8?
Salsa20-8 is a stream cipher in the Salsa20 family. Salsa20 is a stream cipher designed by Daniel J. Bernstein in 2005 and selected for the eSTREAM software portfolio.
What are the Salsa20-8 sizes?
In NextSSL, Salsa20-8 uses: key 32 bytes, nonce 8 bytes.
Who designed Salsa20-8 and when?
Salsa20-8 belongs to the Salsa20 family, first published in 2005 by Daniel J. Bernstein. Its origin: eSTREAM portfolio (software profile).
Which standards define Salsa20-8?
Salsa20-8 is referenced by Salsa20/8 (scrypt core).
Is Salsa20-8 safe to use?
Salsa20-8 is in the research tier. Experimental or unclassified. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other Salsa20 variants are there?
NextSSL also registers salsa20, salsa20-12, xsalsa20 in the Salsa20 family.
Related families
ARX stream cipher with a one-time Poly1305 MAC; fast and constant-time in software
Poly1305Bernstein's fast one-time authenticator, paired with ChaCha20 in RFC 8439
scryptColin Percival's memory-hard key derivation function, standardised in RFC 7914
ChaChaBernstein's ARX stream cipher; ChaCha20 secures much of today's TLS, SSH and VPN traffic