97
Secure Hash Algorithm 3 Courtney Cook Division of Science and Mathematics University of Minnesota, Morris Morris, Minnesota, USA 17 November 2018 Senior Seminar Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 1 / 35

Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Secure Hash Algorithm 3

Courtney Cook

Division of Science and MathematicsUniversity of Minnesota, Morris

Morris, Minnesota, USA

17 November 2018Senior Seminar

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 1 / 35

Page 2: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Why should you care?

Almost everything you do online uses a hash function

PasswordsSite certificatesMessage authentication

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 2 / 35

Page 3: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Why should you care?

Almost everything you do online uses a hash function

PasswordsSite certificatesMessage authentication

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 2 / 35

Page 4: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Why should you care?

Almost everything you do online uses a hash functionPasswords

Site certificatesMessage authentication

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 2 / 35

Page 5: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Why should you care?

Almost everything you do online uses a hash functionPasswordsSite certificates

Message authentication

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 2 / 35

Page 6: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Why should you care?

Almost everything you do online uses a hash functionPasswordsSite certificatesMessage authentication

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 2 / 35

Page 7: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Hash Algorithms

"Any function that can be used to map data of arbitrary size to data ofa fixed size"

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 3 / 35

Page 8: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Hash Algorithms

"Any function that can be used to map data of arbitrary size to data ofa fixed size"

SHA-256[ My ] ->8ed6791bdf3d61a1e6edcbb253979b0a6bef7f3d99dda0fb49cffe96923514b6SHA-256[ My name is Courtney ] ->543ab313f11d6316f84438e074964058613ffa595f1494f81eeafad23364b7cb

SHA-256, www.movable-type.co.uk

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 3 / 35

Page 9: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Hash Algorithms

"Any function that can be used to map data of arbitrary size to data ofa fixed size"

SHA-256[ My ] ->8ed6791bdf3d61a1e6edcbb253979b0a6bef7f3d99dda0fb49cffe96923514b6SHA-256[ My name is Courtney ] ->543ab313f11d6316f84438e074964058613ffa595f1494f81eeafad23364b7cbSHA-256[ My name is Courtnet ] ->602e1fad697d322020a89b03339458cdcfabfef70a6173ae1daf4feafebe4a76

SHA-256, www.movable-type.co.uk

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 3 / 35

Page 10: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Hash Algorithms

"Any function that can be used to map data of arbitrary size to data ofa fixed size"

SHA-256[ My ] ->8ed6791bdf3d61a1e6edcbb253979b0a6bef7f3d99dda0fb49cffe96923514b6SHA-256[ My name is Courtney ] ->543ab313f11d6316f84438e074964058613ffa595f1494f81eeafad23364b7cbSHA-256[ My name is Courtnet ] ->602e1fad697d322020a89b03339458cdcfabfef70a6173ae1daf4feafebe4a76

HASH[ Pay me $30 ] = HASH[ You owe me $50 ]← collision!

SHA-256, www.movable-type.co.uk

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 3 / 35

Page 11: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Overview Outline

Outline

1 BackgroundHistoryOperatorsNotationLiner Feedback Shift RegistersPadding

2 Base Construction

3 Inner Workings

4 Conclusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 4 / 35

Page 12: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background

Outline

1 BackgroundHistoryOperatorsNotationLiner Feedback Shift RegistersPadding

2 Base Construction

3 Inner Workings

4 Conclusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 5 / 35

Page 13: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background History

Secure Hash Algorithm Family

SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions andlength-extension attacks

SHA2 - 2001, NSA. 224, 256, 384 or 512 bits.

SHA3 - 2015, chosen via competition.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 6 / 35

Page 14: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background History

Secure Hash Algorithm Family

SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions andlength-extension attacks

SHA2 - 2001, NSA. 224, 256, 384 or 512 bits.

SHA3 - 2015, chosen via competition.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 6 / 35

Page 15: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background History

Secure Hash Algorithm Family

SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions andlength-extension attacks

SHA2 - 2001, NSA. 224, 256, 384 or 512 bits.

SHA3 - 2015, chosen via competition.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 6 / 35

Page 16: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background History

Secure Hash Algorithm Family

SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions andlength-extension attacks

SHA2 - 2001, NSA. 224, 256, 384 or 512 bits.

SHA3 - 2015, chosen via competition.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 6 / 35

Page 17: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Operators

Bitwise Operators

XOR (⊕) : Adding bitsmodulo 2

0011⊕0101=0110

AND (∧) : Multiplyingbits modulo 2

0011∧0101=0001

NOT (¬) : Bit flipping

¬(0011)=1100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 7 / 35

Page 18: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Operators

Bitwise Operators

XOR (⊕) : Adding bitsmodulo 2

0011⊕0101=0110

AND (∧) : Multiplyingbits modulo 2

0011∧0101=0001

NOT (¬) : Bit flipping

¬(0011)=1100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 7 / 35

Page 19: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Operators

Bitwise Operators

XOR (⊕) : Adding bitsmodulo 2

0011⊕0101=0110

AND (∧) : Multiplyingbits modulo 2

0011∧0101=0001

NOT (¬) : Bit flipping

¬(0011)=1100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 7 / 35

Page 20: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Operators

Bitwise Operators

XOR (⊕) : Adding bitsmodulo 2

0011⊕0101=0110

AND (∧) : Multiplyingbits modulo 2

0011∧0101=0001

NOT (¬) : Bit flipping

¬(0011)=1100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 7 / 35

Page 21: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Notation

Notation

Working in set of all strings of 0s and 1s(ε,0,1,0010101,100001,etc)

Concatenation of strings A and B is A||B.(0100||101 = 0100101)

Truncating M to its first ` bits is bMc`.(b10110100c4 = 1011)

A series of n 0s or 1s will be written 0n or 1n

So 111100 can be written 1402

If the number of bits is unknown, we’ll use 0∗ or 1∗

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 8 / 35

Page 22: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Notation

Notation

Working in set of all strings of 0s and 1s(ε,0,1,0010101,100001,etc)

Concatenation of strings A and B is A||B.(0100||101 = 0100101)

Truncating M to its first ` bits is bMc`.(b10110100c4 = 1011)

A series of n 0s or 1s will be written 0n or 1n

So 111100 can be written 1402

If the number of bits is unknown, we’ll use 0∗ or 1∗

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 8 / 35

Page 23: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Notation

Notation

Working in set of all strings of 0s and 1s(ε,0,1,0010101,100001,etc)

Concatenation of strings A and B is A||B.(0100||101 = 0100101)

Truncating M to its first ` bits is bMc`.(b10110100c4 = 1011)

A series of n 0s or 1s will be written 0n or 1n

So 111100 can be written 1402

If the number of bits is unknown, we’ll use 0∗ or 1∗

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 8 / 35

Page 24: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Notation

Notation

Working in set of all strings of 0s and 1s(ε,0,1,0010101,100001,etc)

Concatenation of strings A and B is A||B.(0100||101 = 0100101)

Truncating M to its first ` bits is bMc`.(b10110100c4 = 1011)

A series of n 0s or 1s will be written 0n or 1n

So 111100 can be written 1402

If the number of bits is unknown, we’ll use 0∗ or 1∗

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 8 / 35

Page 25: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Notation

Notation

Working in set of all strings of 0s and 1s(ε,0,1,0010101,100001,etc)

Concatenation of strings A and B is A||B.(0100||101 = 0100101)

Truncating M to its first ` bits is bMc`.(b10110100c4 = 1011)

A series of n 0s or 1s will be written 0n or 1n

So 111100 can be written 1402

If the number of bits is unknown, we’ll use 0∗ or 1∗

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 8 / 35

Page 26: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 27: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 28: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 29: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:

- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 30: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long

- get next bits by XORing bits at spaces 0 and 2

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 31: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

LFSR Output

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 32: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

LFSR100

Output-

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 33: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

LFSR100110

Output-0

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 34: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

LFSR100110111

Output-00

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 35: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Liner Feedback Shift Registers

LFSRs

Liner Feedback Shift Registers are given as polynomial

Input is a linear function of previous state

x3 + x2 + 1 means:- internal state is 3 bits long- get next bits by XORing bits at spaces 0 and 2

LFSR100110111011

Output-001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 9 / 35

Page 36: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Padding

Padding

Hash functions work with a specific block size

Protect against extension attacks

Multi-rate padding : input = M||10∗1

The number of 0s depends on how many are needed to complete ablock.

0110011 with a block size of 4 becomes

0110|0110110|0111|0001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 10 / 35

Page 37: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Padding

Padding

Hash functions work with a specific block size

Protect against extension attacks

Multi-rate padding : input = M||10∗1

The number of 0s depends on how many are needed to complete ablock.

0110011 with a block size of 4 becomes

0110|0110110|0111|0001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 10 / 35

Page 38: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Padding

Padding

Hash functions work with a specific block size

Protect against extension attacks

Multi-rate padding : input = M||10∗1

The number of 0s depends on how many are needed to complete ablock.

0110011 with a block size of 4 becomes

0110|0110110|0111|0001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 10 / 35

Page 39: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Padding

Padding

Hash functions work with a specific block size

Protect against extension attacks

Multi-rate padding : input = M||10∗1

The number of 0s depends on how many are needed to complete ablock.

0110011 with a block size of 4 becomes

0110|0110110|0111|0001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 10 / 35

Page 40: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Background Padding

Padding

Hash functions work with a specific block size

Protect against extension attacks

Multi-rate padding : input = M||10∗1

The number of 0s depends on how many are needed to complete ablock.

0110011 with a block size of 4 becomes

0110|0110110|0111|0001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 10 / 35

Page 41: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction

Outline

1 Background

2 Base Construction

3 Inner Workings

4 Conclusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 11 / 35

Page 42: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Sponge Construction

Transformation f , padding, and thebitrate r (and capacity c)r+c=length of state s

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 12 / 35

Page 43: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Sponge Construction

Transformation f , padding, and thebitrate r (and capacity c)r+c=length of state s

Variable input and output length, butfixed-length transformation

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 12 / 35

Page 44: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Sponge Construction

Transformation f , padding, and thebitrate r (and capacity c)r+c=length of state s

Variable input and output length, butfixed-length transformation

Absorbing: XOR r-length blocks into s,interleaved with the transformation

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 12 / 35

Page 45: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Sponge Construction

Transformation f , padding, and thebitrate r (and capacity c)r+c=length of state s

Variable input and output length, butfixed-length transformation

Absorbing: XOR r-length blocks into s,interleaved with the transformation

Squeezing: output r-length blocks,interleaving with transformation f

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 12 / 35

Page 46: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

Small Example

Input: 10010100f (x): Circular Left Shift by 1 (Shift left by 1 bit)Block length: 4Capacity: 2Output length: 12

Padding:1001|0100|1001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 13 / 35

Page 47: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

Small Example

Input: 10010100f (x): Circular Left Shift by 1 (Shift left by 1 bit)Block length: 4Capacity: 2Output length: 12

Padding:1001|0100|1001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 13 / 35

Page 48: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

Small Example

Input: 10010100f (x): Circular Left Shift by 1 (Shift left by 1 bit)Block length: 4Capacity: 2Output length: 12

Padding:1001|0100|1001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 13 / 35

Page 49: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa0 =000000

sa1 =sa

0 ⊕ 1001||00

000000⊕100100=100100

sa2 =f (sa

1)

=f (100100)=001001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 14 / 35

Page 50: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa2 =001001

sa3 =sa

2 ⊕ 0100||00

001001⊕010000=011001

sa4 =f (sa

3)

=f (011001)=110010

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 15 / 35

Page 51: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 16 / 35

Page 52: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Squeeze:

Z = ε

ss0 = 101100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 17 / 35

Page 53: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Squeeze:

Z = ε

ss0 = 101100

Z = bss0c4

= 1011

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 18 / 35

Page 54: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Squeeze:

Z = ε

ss0 = 101100

Z = bss0c4

= 1011ss

1 = f (ss0)

= f (101100)= 011001

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 18 / 35

Page 55: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Squeeze:

Z = 1011ss

1 = 011001

Z = Z ||bss1c4

= 1011|0110

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 19 / 35

Page 56: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Squeeze:

Z = 1011ss

1 = 011001

Z = Z ||bss1c4

= 1011|0110ss

2 = f (ss1)

= f (011001)= 110010

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 19 / 35

Page 57: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Squeeze:

Z = 1011|0110ss

2 = 110010

Z = Z ||bss2c4

= 1011|0110|1100

Output: 101101101100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 20 / 35

Page 58: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Construction Sponge Construction

Example

1001|0100|1001

Absorb:

sa4 =110010

sa5 =sa

4 ⊕ 1001||00

110010⊕100100=010110

sa6 =f (sa

5)

=f (010110)=101100

Squeeze:

Z = 1011|0110ss

2 = 110010

Z = Z ||bss2c4

= 1011|0110|1100

Output: 101101101100

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 20 / 35

Page 59: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Outline

1 Background

2 Base Construction

3 Inner Workings

4 Conclusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 21 / 35

Page 60: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 61: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 62: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 63: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 64: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 65: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]

Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 66: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 67: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

Keccak

There are 7 different versions ofKeccak, labelled 0-6 (`)

Consists of nr rounds of R, whereR = ι ◦ χ ◦ ρ ◦ π ◦ θ.

nr = 12+2`

Works on state α = [5][5][w ]w = 2`

s[w(5y + x) + z] = α[x ][y ][z]Keccak-0:α[1][1][1]→s[20(5 ∗ 1 + 1) + 1] = s[7]

The state of Keccak [Keccak Reference]

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 22 / 35

Page 68: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Theta

FOR x = 0 to 4C[x][z] := α[x][0][z]FOR y = 1 to 4

C[x][z] := C[x][z] ⊕ α[x][y][z]END FOR

END FORFOR x = 0 to 4

D[x][z] := C[x-1][z] ⊕ C[x+1][z-1]FOR y = 0 to 4α[x][y][z] := α[x][y][z] ⊕ D[x][z]

END FOREND FOR

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 23 / 35

Page 69: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Theta

FOR x = 0 to 4C[x][z] := α[x][0][z]FOR y = 1 to 4

C[x][z] := C[x][z] ⊕ α[x][y][z]END FOR

END FORFOR x = 0 to 4

D[x][z] := C[x-1][z] ⊕ C[x+1][z-1]FOR y = 0 to 4α[x][y][z] := α[x][y][z] ⊕ D[x][z]

END FOREND FOR

The state is collapsed downinto 2 dimensional plane inarray C

D’s entries are XOR ofprevious and diagonal nextentries of C

α XORed withcorresponding D entry

For diffusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 24 / 35

Page 70: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Theta

FOR x = 0 to 4C[x][z] := α[x][0][z]FOR y = 1 to 4

C[x][z] := C[x][z] ⊕ α[x][y][z]END FOR

END FORFOR x = 0 to 4

D[x][z] := C[x-1][z] ⊕ C[x+1][z-1]FOR y = 0 to 4α[x][y][z] := α[x][y][z] ⊕ D[x][z]

END FOREND FOR

The state is collapsed downinto 2 dimensional plane inarray C

D’s entries are XOR ofprevious and diagonal nextentries of C

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 25 / 35

Page 71: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Theta

FOR x = 0 to 4C[x][z] := α[x][0][z]FOR y = 1 to 4

C[x][z] := C[x][z] ⊕ α[x][y][z]END FOR

END FORFOR x = 0 to 4

D[x][z] := C[x-1][z] ⊕ C[x+1][z-1]FOR y = 0 to 4α[x][y][z] := α[x][y][z] ⊕ D[x][z]

END FOREND FOR

The state is collapsed downinto 2 dimensional plane inarray C

D’s entries are XOR ofprevious and diagonal nextentries of C

α XORed withcorresponding D entry

For massive diffusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 26 / 35

Page 72: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Theta

FOR x = 0 to 4C[x][z] := α[x][0][z]FOR y = 1 to 4

C[x][z] := C[x][z] ⊕ α[x][y][z]END FOR

END FORFOR x = 0 to 4

D[x][z] := C[x-1][z] ⊕ C[x+1][z-1]FOR y = 0 to 4α[x][y][z] := α[x][y][z] ⊕ D[x][z]

END FOREND FOR

The state is collapsed downinto 2 dimensional plane inarray C

D’s entries are XOR ofprevious and diagonal nextentries of C

α XORed withcorresponding D entry

For massive diffusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 26 / 35

Page 73: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Pi

FOR x = 0 to 4FOR y = 0 to 4[

ab

]=[0 12 3

] [xy

]α[a][b][z] := α[x][y][z]

END FOREND FORtextsoitlinesupright

Lanes shifted

Pi [Keccak Reference]

For long-term diffusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 27 / 35

Page 74: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Pi

FOR x = 0 to 4FOR y = 0 to 4[

ab

]=[0 12 3

] [xy

]α[a][b][z] := α[x][y][z]

END FOREND FORtextsoitlinesupright

Lanes shifted

Pi [Keccak Reference]

For long-term diffusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 27 / 35

Page 75: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Pi

FOR x = 0 to 4FOR y = 0 to 4[

ab

]=[0 12 3

] [xy

]α[a][b][z] := α[x][y][z]

END FOREND FORtextsoitlinesupright

Lanes shifted

Pi [Keccak Reference]

For long-term diffusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 27 / 35

Page 76: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Rho[xy

]:=

[10

]FOR t = 0 to 23α[x][y]: = ROT(α[x][y],(t+1)(t+2)/2)[xy

]:=

[0 12 3

] [xy

]END FOR usingupspaceblahblah

Every lane is rotated by afunction of t:

(t + 1)(t + 2)2

Order the lanes are rotated= lane shift in π

So when t = 2, rotate lane atα[2][3] by 6

For inter-slice dispersion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 28 / 35

Page 77: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Rho[xy

]:=

[10

]FOR t = 0 to 23α[x][y]: = ROT(α[x][y],(t+1)(t+2)/2)[xy

]:=

[0 12 3

] [xy

]END FOR usingupspaceblahblah

Every lane is rotated by afunction of t:

(t + 1)(t + 2)2

Order the lanes are rotated= lane shift in π

So when t = 2, rotate lane atα[2][3] by 6

For inter-slice dispersion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 28 / 35

Page 78: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Rho[xy

]:=

[10

]FOR t = 0 to 23α[x][y]: = ROT(α[x][y],(t+1)(t+2)/2)[xy

]:=

[0 12 3

] [xy

]END FOR usingupspaceblahblah

Every lane is rotated by afunction of t:

(t + 1)(t + 2)2

Order the lanes are rotated= lane shift in π

So when t = 2, rotate lane atα[2][3] by 6

For inter-slice dispersion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 28 / 35

Page 79: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Rho[xy

]:=

[10

]FOR t = 0 to 23α[x][y]: = ROT(α[x][y],(t+1)(t+2)/2)[xy

]:=

[0 12 3

] [xy

]END FOR usingupspaceblahblah

Every lane is rotated by afunction of t:

(t + 1)(t + 2)2

Order the lanes are rotated= lane shift in π

So when t = 2, rotate lane atα[2][3] by 6

For inter-slice dispersion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 28 / 35

Page 80: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ ρ ◦ π ◦ θ.

Rho[xy

]:=

[10

]FOR t = 0 to 23α[x][y]: = ROT(α[x][y],(t+1)(t+2)/2)[xy

]:=

[0 12 3

] [xy

]END FOR usingupspaceblahblah

Every lane is rotated by afunction of t:

(t + 1)(t + 2)2

Order the lanes are rotated= lane shift in π

So when t = 2, rotate lane atα[2][3] by 6

For inter-slice dispersion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 28 / 35

Page 81: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Chi

FOR x = 0 to 4FOR y = 0 to 4α[x][y] := α[x][y]

⊕ (¬α[x+1][y] ∧ α[x+2][y])END FOR

END FOR

NOT of lane in next x spotAND lane two x spots overXOR with original lane

Non-linear thing

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 29 / 35

Page 82: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Chi

FOR x = 0 to 4FOR y = 0 to 4α[x][y] := α[x][y]

⊕ (¬α[x+1][y] ∧ α[x+2][y])END FOR

END FOR

NOT of lane in next x spotAND lane two x spots over

XOR with original lane

Non-linear thing

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 29 / 35

Page 83: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Chi

FOR x = 0 to 4FOR y = 0 to 4α[x][y] := α[x][y]

⊕ (¬α[x+1][y] ∧ α[x+2][y])END FOR

END FOR

NOT of lane in next x spotAND lane two x spots overXOR with original lane

Non-linear thing

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 29 / 35

Page 84: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Chi

FOR x = 0 to 4FOR y = 0 to 4α[x][y] := α[x][y]

⊕ (¬α[x+1][y] ∧ α[x+2][y])END FOR

END FOR

NOT of lane in next x spotAND lane two x spots overXOR with original lane

Non-linear thing

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 29 / 35

Page 85: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Iota

α[0][0] := α[0][0] ⊕ RCir

RCir determined by a Linear Feedback Shift Register

Changes from round to roundNumber of non-zero bits is `+1(Meaning if `=4, there are 16 bits, of which 5 are 1s)

LFSR output is XORed with lane at α[0][0]

To disrupt symmetry

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 30 / 35

Page 86: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Iota

α[0][0] := α[0][0] ⊕ RCir

RCir determined by a Linear Feedback Shift Register

Changes from round to roundNumber of non-zero bits is `+1(Meaning if `=4, there are 16 bits, of which 5 are 1s)

LFSR output is XORed with lane at α[0][0]

To disrupt symmetry

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 30 / 35

Page 87: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Iota

α[0][0] := α[0][0] ⊕ RCir

RCir determined by a Linear Feedback Shift Register

Changes from round to roundNumber of non-zero bits is `+1

(Meaning if `=4, there are 16 bits, of which 5 are 1s)

LFSR output is XORed with lane at α[0][0]

To disrupt symmetry

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 30 / 35

Page 88: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Iota

α[0][0] := α[0][0] ⊕ RCir

RCir determined by a Linear Feedback Shift Register

Changes from round to roundNumber of non-zero bits is `+1(Meaning if `=4, there are 16 bits, of which 5 are 1s)

LFSR output is XORed with lane at α[0][0]

To disrupt symmetry

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 30 / 35

Page 89: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Iota

α[0][0] := α[0][0] ⊕ RCir

RCir determined by a Linear Feedback Shift Register

Changes from round to roundNumber of non-zero bits is `+1(Meaning if `=4, there are 16 bits, of which 5 are 1s)

LFSR output is XORed with lane at α[0][0]

To disrupt symmetry

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 30 / 35

Page 90: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Inner Workings

R = ι ◦ χ ◦ π ◦ ρ ◦ θ.

Iota

α[0][0] := α[0][0] ⊕ RCir

RCir determined by a Linear Feedback Shift Register

Changes from round to roundNumber of non-zero bits is `+1(Meaning if `=4, there are 16 bits, of which 5 are 1s)

LFSR output is XORed with lane at α[0][0]

To disrupt symmetry

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 30 / 35

Page 91: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Conclusion

Outline

1 Background

2 Base Construction

3 Inner Workings

4 Conclusion

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 31 / 35

Page 92: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Conclusion

Conclusion

A user of the Secure Hash Algorithm 3 can decide what trade-offs theywant to make (speed vs security)

Because in SHA3 the capacity only interacts with the transformation, itis not as vulnerable to length-extension attacks as previous SHAs are.

Collisions found for SHA1, can be applied to SHA2.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 32 / 35

Page 93: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Conclusion

Conclusion

A user of the Secure Hash Algorithm 3 can decide what trade-offs theywant to make (speed vs security)

Because in SHA3 the capacity only interacts with the transformation, itis not as vulnerable to length-extension attacks as previous SHAs are.

Collisions found for SHA1, can be applied to SHA2.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 32 / 35

Page 94: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

Conclusion

Conclusion

A user of the Secure Hash Algorithm 3 can decide what trade-offs theywant to make (speed vs security)

Because in SHA3 the capacity only interacts with the transformation, itis not as vulnerable to length-extension attacks as previous SHAs are.

Collisions found for SHA1, can be applied to SHA2.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 32 / 35

Page 95: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

References

Thank You

Elena Machkasova, advisor

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 33 / 35

Page 96: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

References

References

G. Bertoni, J. Daemen, M. Peeters, G. Van Assche.Cryptographic sponge functions.SHA-3 competition (round 3), 2011.

G. Bertoni, J. Daemen, M. Peeters, G. Van Assche.The Making of Keccak.Cryptologia, 2014.

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 34 / 35

Page 97: Secure Hash Algorithm 3 - GitHub Pages...Secure Hash Algorithm Family SHA1 - 1995, NSA. 160 bits. Somewhat vulnerable to collisions and length-extension attacks SHA2 - 2001, NSA. 224,

References

Questions?

Cook (U of Minn, Morris) SHA3 November ’18 Senior Sem 35 / 35