

The Quarterround Function takes 4 words as input and returns another 4-word sequence. The leftmost a bits move to the rightmost positions.Ī rotation of bits to the left w <<< a of a 4-byte word w may be represented as the multiplication:

The a-bit left rotation of a 4-byte word w is denoted in the algorithm as w <<< a. The result is also a valid proper 4-byte long word. To perform XOR addition, two words are compared bit by bit, and XOR addition is performed for each pair. The Exclusive-Or of two 4-byte words is denoted in the algorithm description as a XOR b. The sum of two words a and b is equal to a+b mod 2 32. The result is divided modulo by 2 32 (so, by the maximum value that can be stored in one word). The addition of two 4-byte words is denoted in the algorithm description as a + b. The operations for Salsa20 algorithm are presented in the order from the low-level functions, to the more complex functions, which use the functions described above them.


The hash function input data was rearranged, to allow to implement the algorithm in a more efficient way. They provide better security than the original Salsa20 cipher, by using slightly better hash functions. ChaCha family - published by Bernstein in 2008.Salsa20/8 and Salsa20/12 - they work exactly as the original Salsa20 algorithm but instead of 10 doublerounds inside the hash function, they perform 4 or respectively 6 doublerounds.There are also some other ciphers, which are based on the Salsa20 algorithm but differ in details. The result is a 64-byte block of plaintext. The output from the Salsa20 expansion function should be added XOR to the 64-byte block of ciphertext. The data should be divided into parts of the same size. The same algorithm should be used during decryption. The result is a 64-byte block of ciphertext. The output from the Salsa20 expansion function is added XOR to the 64-byte block of data. Therefore, the input data is 16-word long, a key contains 8 or 4 words, and the nonce has 2 words. Every word contains 4 bytes and can have values from 0 to 2 32-1. The hash function operates on data divided into words. four constant vectors received from the expansion function, which values depend on the size of the secret key.The Salsa20 hash function works on the received sequence of bytes, which consists of: The core of Salsa20 encryption algorithm is a hash function which receives the 64-byte long input data from the Salsa20 expansion function, mixes it, and eventually returns the 64-byte long output. Every call to the expansion function increases the block number by one. The input to the function is the secret key (which can have either 32 or 16 bytes) and an 8-byte long nonce concatenated with an additional block number, which values change from 0 to 2 64-1 (it is also stored on 8 bytes). Encryptionįor each 64-byte data block, the algorithm uses the Salsa20 expansion function. Salsa20 is a stream cipher that works on data blocks of size of 64 bytes. There aren't any known and effective attacks on the family of Salsa20 ciphers. It is considered to be a well-designed and efficient algorithm. Salsa20 is a cipher that was submitted to eSTREAM project, running from 2004 to 2008, which was supposed to promote development of stream ciphers. It was designed in 2005 by Daniel Bernstein, research professor of Computer Science at the University of Illinois at Chicago. Salsa20 is a modern and efficient stream symmetric cipher. Salsa20 Stream cipher with symmetric secret key
