Salsa20
Salsa20 (formerly known as Snuffle 2005 ) and the closely related ChaCha are stream ciphers developed by Daniel J.[src] Bernstein.[src] Salsa20, the original cipher, was designed in 2005, then later submitted to the eSTREAM European Union cryptographic validation process by Bernstein.[src] ChaCha is a modification of Salsa20 published in 2008.[src] It uses a new round function that increases diffusion and increases performance on some architectures.[src] Both ciphers are built on a pseudorandom function based on add–rotate–XOR (ARX) operations — 32-bit addition, bitwise addition (XOR) and rotation operations.[src] The core function maps a 256-bit key, a 64-bit nonce, and a 64-bit counter to a 512-bit block of the key stream (a Salsa version with a 128-bit key also exists).[src] This gives Salsa20 and ChaCha the unusual advantage that the user can efficiently seek to any position in the key stream in constant time.[src] Salsa20 offers speeds of around 4–14 cycles per byte in software on modern x86 processors, and reasonable hardware performance.[src] It is not patented, and Bernstein has written several public domain implementations optimized for common architectures.[src]
Salsa20 (formerly known as Snuffle 2005 ) and the closely related ChaCha are stream ciphers developed by Daniel J.[src] Bernstein.[src] Salsa20, the original cipher, was designed in 2005, then later submitted to the eSTREAM European Union cryptographic validation process by Bernstein.[src] ChaCha is a modification of Salsa20 published in 2008.[src] It uses a new round function that increases diffusion and increases performance on some architectures.[src] Both ciphers are built on a pseudorandom function based on add–rotate–XOR (ARX) operations — 32-bit addition, bitwise addition (XOR) and rotation operations.[src] The core function maps a 256-bit key, a 64-bit nonce, and a 64-bit counter to a 512-bit block of the key stream (a Salsa version with a 128-bit key also exists).[src] This gives Salsa20 and ChaCha the unusual advantage that the user can efficiently seek to any position in the key stream in constant time.[src] Salsa20 offers speeds of around 4–14 cycles per byte in software on modern x86 processors, and reasonable hardware performance.[src] It is not patented, and Bernstein has written several public domain implementations optimized for common architectures.[src] b ^= (a + d) QR(a, b, c, d) to each of the four columns in the 4×4 matrix, and even-numbered rounds apply it to each of the four rows.[src] Two consecutive rounds (column-round and row-round) together are called a double-round: // Odd round QR( 0, 4, 8, 12) // column 1 QR( 5, 9, 13, 1) // column 2 QR(10, 14, 2, 6) // column 3 QR(15, 3, 7, 11) // column 4 // Even round QR( 0, 1, 2, 3) // row 1 QR( 5, 6, 7, 4) // row 2 QR(10, 11, 8, 9) // row 3 QR(15, 12, 13, 14) // row 4 An implementation in C/C++ appears below.[src] include define ROTL(a,b) (((a) > (32 - (b)))) define QR(a, b, c, d)( \ b ^= ROTL(a + d, 7), \ c ^= ROTL(b + a, 9), \ d ^= ROTL(c + b,13), \ a ^= ROTL(d + c,18)) define ROUNDS 20 void salsa20_block(uint32_t out[16], uint32_t const in[16]) { int i; uint32_t x[16]; for (i = 0; i In the last line, the mixed array is added, word by word, to the original array to obtain its 64-byte key stream block.[src] This is important because the mixing rounds on their own are invertible.[src] In other words, applying the reverse operations would produce the original 4×4 matrix, including the key.[src] Adding the mixed array to the original makes it impossible to recover the input.[src] (This same technique is widely used in hash functions from MD4 through SHA-2.) Salsa20 performs 20 rounds of mixing on its input.[src] However, reduced-round variants Salsa20/8 and Salsa20/12 using 8 and 12 rounds respectively have also been introduced.[src] These variants were introduced to complement the original Salsa20, not to replace it, and perform better in the eSTREAM benchmarks than Salsa20, though with a correspondingly lower security margin.[src] a += b; d ^= a; d include define ROTL(a,b) (((a) > (32 - (b)))) define QR(a, b, c, d) ( \ a += b, d ^= a, d = ROTL(d, 16), \ c += d, b ^= c, b = ROTL(b, 12), \ a += b, d ^= a, d = ROTL(d, 8), \ c += d, b ^= c, b = ROTL(b, 7)) define ROUNDS 20 void chacha_block(uint32_t out[16], uint32_t const in[16]) { int i; uint32_t x[16]; for (i = 0; i ChaCha is the basis of the BLAKE hash function, a finalist in the NIST hash function competition, and its faster successors BLAKE2 and BLAKE3.[src] It also defines a variant using sixteen 64-bit words (1024 bits of state), with correspondingly adjusted rotation constants.[src] ===Reduced-round ChaCha=== Aumasson argues in 2020 that 8 rounds of ChaCha (ChaCha8) probably provides enough resistance to future cryptanalysis for the same security level, yielding a 2.5× speedup.[src] A compromise ChaCha12 (based on the eSTREAM recommendation of a 12-round Salsa) also sees some use.[src] The eSTREAM benchmarking suite includes ChaCha8 and ChaCha12.[src]
34 sentences · 34 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Salsa20." encyclopegia.org, 2026, https://encyclopegia.org/wiki/salsa20. Accessed 28 November 2026.
Chicago
"Salsa20." encyclopegia.org. Accessed November 28, 2026. https://encyclopegia.org/wiki/salsa20.
APA
encyclopegia.org. (2026). Salsa20. Retrieved November 28, 2026, from https://encyclopegia.org/wiki/salsa20
Accessed November 28, 2026 · CC BY-SA 4.0 · citation page · JSON
Claims
| Predicate | Value | Source |
|---|---|---|
| publication date | 2008 | Wikipedia |