Sei sulla pagina 1di 32

SEMINAR ON CHACHA,

A variant of SALSA20.

BY: HEMA RANI, VIKRAM, VAISHALI


11510393, 11510394, 11510396
ECE2
NIT, KURUKSHETRA
CONTENTS…
 Encryption
 What is Cipher?
 Substitution Cipher
 Some Relevant terms
 Classification of Cipher
 AES Encryption
 Brute Force Attacks
 Salsa 20/20
 ChaCha
 Why ChaCha?
 Quarter Round
 Observations
 The Matrix
 References
Encryption
 Encryption is the process of
encoding a message or
information in such a way
that only authorized parties
can access it and those
who are not authorized
cannot.
 The strength of an
encryption largely depends
on two components: 1) the
cipher and 2) the length of
the key.
A cipher is simply a method
for encrypting (and
decrypting) messages.

Ciphers are also known as


encryption algorithms
.
Substitution Cipher
The substitution cipher is a very simple example
of an encryption algorithm.

"Call me tonight“ “Fdoophwrqljkw“.


Some relevant terms-
 Plaintext (“Call me tonight”)
 Key (n=3)
 Ciphertext (“Fdoophwrqljkw”)
Wanna create your own encryption
algorithm??

Here’s an example why you shouldn't try it…


Let’s try it….
P*N=C
Plain text Cipher text
A B
C F
K V
X V

Did you
encounter any
problem??
Classification of Ciphers

Stream and Block


Ciphers

Symmetric and Synchronous and


Asymmetric Ciphers Asynchronous
Ciphers
Stream Cipher…
 Encryption algorithm that encrypts 1 bit or byte of
plaintext at a time.
 Start with a secret key “seed”.
 Generate keying stream.
 i-th bit or byte of keying stream is a function of the key
and the first i-1 ciphertext bits.
 Combine the stream with the plain text to produce the
ciphertext (typically by xor).
Stream encryption Stream decryption

Key Key

Stream Stream

Plain text Cipher Text

Cipher Text Plain Text


Block Cipher…
A block cipher is a method of encrypting text (to produce
ciphertext) in which a cryptographic key and algorithm
are applied to a block of data (for example, 64
contiguous bits) at once as a group rather than to one bit
at a time.
Key Key

Plain text Cipher text Decrypt Plain text


Encrypt Block Block Block
block Block
Synchronous and asynchronous
stream ciphers….
If key stream does not depend on
plain text, then the cipher is
Synchronous.

Otherwise it is called
Asynchronous.
Symmetric and asymmetric
stream ciphers….
Symmetric (also known as secret-key) ciphers use
the same key for encrypting and decrypting, so
the sender and the receiver must both know --
and use -- the same secret key.
AES Encryption
The Advanced
Encryption Standard,
or AES, is a
symmetric block
cipher chosen by the
U.S. government to
protect classified
information and is
implemented in
software and
hardware throughout
the world to encrypt
sensitive data.
Brute Force Attacks
Brute force (also known as
brute force cracking) is a
trial and error method used
by application programs to
decode encrypted data
such as passwords or Data
Encryption Standard (DES)
keys, through exhaustive
effort (using brute force)
rather than employing
intellectual strategies.
Daniel Julius Bernstein

Designed
the Salsa20 stream
cipher in 2005.

ChaCha20, was
published by him in 2008.
SALSA 20/20
The Salsa20/20 stream cipher expands a 256-bit
key into 264 randomly accessible streams, each
containing 264 randomly accessible 64-byte
blocks. Salsa20/20 is a more conservative design
than AES, and the community seems to have
rapidly gained confidence in the security of the
cipher.

Salsa20/20 is consistently faster than AES.


ChaCha
Variant of SALSA 20 family.
ChaCha8 is a 256-bit stream cipher based
on the 8-round cipher Salsa20/8.
ChaCha follows the same basic design
principles as Salsa20.
Chacha20 is ARX-based hash function,
keyed, running in counter mode.
Then Why ChaCha ?
Improved Diffusion per round.
Increased resistance to cryptanalysis, while
preserving and often improving time per
round.
Quarter round
32 32 32 32
a1 b1 c1 d1

32 32 32 32
512 bit block a2 b2 c2 d2

32 32 32 32
a3 b3 c3 d3

32 32 32 32
a4 b4 c4 d4

512 bit block divided into 4-32 bit blocks.


Salsa Quarter Round

b ^= (a+d) <<< 7;
c ^= (b+a) <<< 9;
d ^= (c+b) <<< 13;
ARX
a ^= (d+c) <<< 18;
ChaCha Quarter Round

a += b; d ^= a; d <<<= 16;
c += d; b ^= c; b <<<= 12; AXR
a += b; d ^= a; d <<<= 8;
c += d; b ^= c; b <<<= 7;
Observations:
It works on 4 words at a time to
minimize memory access which
makes it very cache friendly, as in
Salsa.
It also scrambles data a bit
better than his earlier Salsa20
quarter-round, because each
word is updated twice here, and
every word has a chance to
influence the three others.
This makes Chacha20 a little
stronger than Salsa20 in practice.
The Matrix
Initial Matrix

Parallel Operation Diagonal Operation


Sequence of Salsa20 Matrix
 The first round of Salsa20 applies a quarter round to each
column in parallel, modifying the second row, then the
third row, then the fourth row, then the first row.
 The second round of Salsa20 applies a quarter-round to
each northeast diagonal in parallel, modifying the fourth
row, then the third row, then the second row, then the first
row.
 Appropriate rotations of the entries in each row turn the
diagonals into columns.
 The third round is like the first; the fourth round is like the
second; and so on.
Sequence of ChaCha Matrix
 We're first going to apply 4 quarter-rounds in parallel,
column by column.
 Then 4 more, diagonal by diagonal.
 Then Repeat the process 9 times more, and we get 20
rounds (10 column rounds and 10 diagonal rounds).
REFERENCES…
 Jean-Philippe Aumasson, Simon Fischer, Shahram Khazaei, Willi Meier, Christian
Rechberger, New features of Latin dances: analysis of Salsa, ChaCha, and Rumba
(2007). URL: http://eprint.iacr.org/2007/472. Citations in this document: §2.2, §3.2. 2.
 Daniel J. Bernstein, The Salsa20 family of stream ciphers (2007). URL: http://
cr.yp.to/papers.html#salsafamily. Citations in this document: §1.1, §1.1.
 https://www.jscape.com/blog/what-is-a-cipher
 https://www.jscape.com/blog/stream-cipher-vs-block-cipher
 http://www.cs.tau.ac.il/~bchor/Lecture2B&W.pdf
 https://searchsecurity.techtarget.com/definition/Advanced-Encryption-Standard
 http://loup-vaillant.fr/tutorials/chacha20-design

Potrebbero piacerti anche