chapter xxx – cryptography and miscellaneous 6th ed topics...

8
Cryptography and Cryptography and Network Security Network Security Chapter XXX Chapter XXX Sixth Sixth Edition Edition by William Stallings by William Stallings Lecture slides by RHB Lecture slides by RHB Chapter XXX Chapter XXX Miscellaneous 6th ED Miscellaneous 6th ED topics topics That That s enough quotations. s enough quotations. RHB RHB Outline Outline will discuss: will discuss: Key wrapping Key wrapping RSA RSA - - PSS digital signature scheme PSS digital signature scheme Elliptic curve digital signature scheme Elliptic curve digital signature scheme SHA SHA - - 3 and 3 and Keccak Keccak Key Wrapping Key Wrapping for standard for standard mass data modes: mass data modes: first cipher block affected by only first data block first cipher block affected by only first data block last data block affects only last cipher block last data block affects only last cipher block in a hierarchy of keys, want something in a hierarchy of keys, want something better for transmitting session keys better for transmitting session keys (using master keys) (using master keys) for session keys, want something robust, for session keys, want something robust, providing strong encryption and also providing strong encryption and also authentication (for arbitrary, unstructured authentication (for arbitrary, unstructured bitpatterns bitpatterns ) )

Upload: others

Post on 27-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

Cryptography and Cryptography and

Network SecurityNetwork Security

Chapter XXXChapter XXX

SixthSixth EditionEdition

by William Stallingsby William Stallings

Lecture slides by RHBLecture slides by RHB

Chapter XXX Chapter XXX ––

Miscellaneous 6th ED Miscellaneous 6th ED topicstopics

ThatThat’’s enough quotations.s enough quotations.

—— RHBRHB

OutlineOutline

•• will discuss:will discuss:

–– Key wrappingKey wrapping

–– RSARSA--PSS digital signature schemePSS digital signature scheme

–– Elliptic curve digital signature schemeElliptic curve digital signature scheme

–– SHASHA--3 and 3 and KeccakKeccak

Key WrappingKey Wrapping

•• for standardfor standard mass data modes:mass data modes:

–– first cipher block affected by only first data blockfirst cipher block affected by only first data block

–– last data block affects only last cipher blocklast data block affects only last cipher block

•• in a hierarchy of keys, want something in a hierarchy of keys, want something better for transmitting session keys better for transmitting session keys (using master keys) (using master keys)

•• for session keys, want something robust, for session keys, want something robust, providing strong encryption and also providing strong encryption and also authentication (for arbitrary, unstructured authentication (for arbitrary, unstructured bitpatternsbitpatterns))

王博文�
- 钥匙包装 - RSA-PSS数字签名方案 - 椭圆曲线数字签名方案 - SHA-3和Keccak�
王博文�
•对于标准质量数据模式: - 仅受第一个数据块影响的第一个密码块 - 最后一个数据块仅影响最后一个密码块•在密钥层次结构中,希望更好地发送会话密钥(使用主密钥)•对于会话密钥,需要强大的功能,提供强大的加密和身份验证(对于任意的,非结构化的位模式)�
Page 2: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

• Keywrapping gives more confusion and diffusion in encryption of a session key …plus authentication block

• 64 bit authentication block, A, initialised to A6A6A6A6A6A6A6A6

• 64 bit data blocks, P(1) … P(n)

• s = 6 x n rounds

• easy to encrypt / decrypt

A(0) := A6A6A6A6A6A6A6A6

P(1) ... P(n) := plaintext blocks

for t = 0 ... s-1 do

W := AES[MKey, A(t) || P(nxt+1)]

A(t+1) := (t+1) XOR MSB64(W)

P(nx(t+1)+n) := LSB64(W)

P(nx(t+1)+1) ... (nx(t+1)+(n-1)) :=

P(nxt+2) ... (nxt+n)

Output: A(s) , P(nxs+1) ... P(nx(s+1))

RSARSA--PSS Digital SignaturesPSS Digital Signatures

•• raw RSA is raw RSA is ‘‘malleablemalleable’’ …… vulnerable to chosen vulnerable to chosen

ciphertextciphertext attack attack …… because of because of

C(MC(M11) x C(M) x C(M22) = C(M) = C(M11 x Mx M22))

•• RSARSA--PSS invented to give greater security to PSS invented to give greater security to

RSA based signaturesRSA based signatures

•• used to create signaturesused to create signatures

•• includes padding / salt (c.f. OAEP)includes padding / salt (c.f. OAEP)

•• easy to create / verifyeasy to create / verify

王博文�
密钥包装在加密会话密钥......加上认证块时会产生更多的混淆和扩散�
王博文�
•64位认证块A,初始化为A6A6A6A6A6A6A6A6•64位数据块,P(1)... P(n)•s = 6 x n轮�
王博文�
原始RSA是“可塑的”......容易受到选择的密文攻击......因为•RSA-PSS的发明旨在为基于RSA的签名提供更高的安全性用于创建签名包括填充物/盐(c.f.OAEP)•易于创建/验证�
Page 3: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

RSA-PSS

verify here

RSA-sign

Elliptic Curve Digital SignaturesElliptic Curve Digital Signatures

•• a digital signature scheme, simpler than a digital signature scheme, simpler than DSA, but with similar security propertiesDSA, but with similar security properties

•• uses elliptic curves with large prime orderuses elliptic curves with large prime order

•• global parameters:global parameters:–– a large prime a large prime qq

–– elliptic curve elliptic curve EEqq(a,b(a,b)) specified by specified by a,ba,b

–– base point base point GG =(=(xxgg,y,ygg)) on curve on curve EEqq(a,b(a,b))

–– order of base point, order of base point, nn , i.e. , i.e. nn is smallest is smallest multiple of multiple of GG such that such that nGnG == OO

•• key generationkey generation …… signer side (Bob)signer side (Bob)–– select select dd: : 11 <=<= dd <=<= nn--11 …… private key private key

–– compute compute QQ == dGdG in in EEqq(a,b(a,b)) …… public keypublic key

•• signing signing –– �� select select kk: : 11 <=<= kk <=<= nn--11 , , kk coprimecoprime to to nn

–– compute compute PP == kGkG == ((x,yx,y)) in in EEqq(a,b(a,b))

–– compute compute rr == xx modmod nn …… if if rr == 00 go to go to ��

–– compute compute kk--11 modmod nn

–– compute compute ss == kk--11(H(M)+dr)(H(M)+dr) modmod nn …… if if ss == 00

go to go to ��

–– signature is signature is ((r,sr,s))

•• verifying verifying

–– check (both) check (both) 11 <=<= r,sr,s <=<= nn--11

–– compute compute ww == ss--11 modmod nn

–– compute compute uu11 == H(M)wH(M)w and and uu22 == rwrw

–– compute compute XX =(x=(x11,y,y11)=)= uu11GG ++ uu22QQ in in EEqq(a,b(a,b))

–– if if XX == OO reject reject ……

–– else compute else compute vv == xx11 modmod nn

–– accept signature if accept signature if vv == rr

王博文�
数字签名方案,比DSA简单,但具有类似的安全属性•使用具有大素数阶的椭圆曲线슙
王博文�
全局参数�
王博文�
基点n的顺序,即n是G的最小倍数�
Page 4: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

Elliptic Curve Digital Signature

Page 5: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

SHASHA--33

•• the new replacement for SHAthe new replacement for SHA--1 and 1 and SHASHA--2, plug2, plug--compatible with SHAcompatible with SHA--2 2

•• ready and available in case itready and available in case it’’s ever s ever needed due to any weakness in SHAneeded due to any weakness in SHA--2 2 being discovered (none suspected so far)being discovered (none suspected so far)

•• announced in 2012announced in 2012

•• from the same stable that produced AESfrom the same stable that produced AES

SHASHA--3 Hash Operation3 Hash Operation

•• SHASHA--3 uses the idea of a sponge function3 uses the idea of a sponge function

A sponge function uses an internal state with size b bits. This is bigger than the input (and) output block size of r bits, and allows for more complicated transformations of the input to output.

The capacity c = b - r, is a measure of the additional ‘scrambling power’ that can be applied to the input.

The squeezing phase iteratively rehashes the output-so-far until the required length is produced.

Sponge

function

structure

SHASHA--3 and 3 and KeccakKeccak•• the sponge function used in SHAthe sponge function used in SHA--3 is 3 is

called called KeccakKeccak (f in the sponge iteration)(f in the sponge iteration)

•• internal internal blocksizeblocksize = 1600 bits= 1600 bits

SHA-3 Parameters

2512238422562224Second

preimage

resistance

2256219221282112Collision

resistance

1024768512448Capacity c

24242424Number of

Rounds

64646464Word Size

57683210881152Block Size

(bitrate r)

no maximumno maximumno maximumno maximumMessage

Size

512384256224Message

Digest Size

Total is 1600

王博文�
•SHA-1和SHA-2的新替代品,与SHA-2插件兼容•由于发现SHA-2的任何弱点(迄今为止没有人怀疑),因此可以随时使用•2012年宣布•来自产生AES的相同马厩�
王博文�
海绵功能�
王博文�
海绵功能使用大小为b位的内部状态。 这大于r位的输入(和)输出块大小,并允许输入到输出的更复杂的转换。�
王博文�
容量c = b-r,是可以应用于输入的附加“加扰功率”的度量。㚀
王博文�
挤压阶段迭代地重新产生输出,直到产生所需的长度ࡀ
Page 6: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

Each L[x,y] is a ‘lane’ a[x,y,z] … z = 0 … 63

Lanes aggregate to columns C[x] … y = 0 … 4

Keccak internal blockinternal block structureKeccakKeccak

•• KeccakKeccak (f in the sponge iteration)(f in the sponge iteration) works on works on

the internal statethe internal state

•• internal block (1600 bits) is internal block (1600 bits) is organisedorganised in a in a

3D grid (2D grid of lanes)3D grid (2D grid of lanes)

•• KeccakKeccak (f in the sponge iteration)(f in the sponge iteration) is a is a

composition of fivecomposition of five individual individual

transformations transformations …… applied in 24 roundsapplied in 24 rounds

•• theta (theta (θθ) ) ;; rho (rho (ρρ) ) ;; pi (pi (ππ) ) ;; chi (chi (χχ) ) ;; iota (iota (ιι))

sequential composition

Keccak

function

structure

24 rounds

Step Functions in SHA-3

W[0, 0] is updated by XOR with a round constant.Substitutionι

New value of each bit in each word depends on its current value

and on one bit in next word in the same row and one bit in the

second next word in the same row..

Substitutionχχχχ

Words are permuted in the 5×5 matrix. W[0, 0] is not affected.Permutationππππ

The bits of each word are permuted using a circular bit shift.

W[0, 0] is not affected.Permutationρρρρ

New value of each bit in each word depends its current value

and on one bit in each word of preceding column and one bit of

each word in succeeding column.

Substitutionθ

DescriptionTypeFunction

王博文�
车道聚合到列�
王博文�
顺序组成�
王博文�
Keccak(海绵迭代中的f)适用于内部状态内部块(1600位)组织在一个3D网格中(2D网格的车道)Keccak(海绵迭代中的f)由五个单独的变换组成......应用于24轮�
Page 7: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

Theta Rho

rho (a[x,y,z]) = a[x,y,(z – (t+1)(t+2)/2 mod 64)]

where 0 <= t <= 24 and

( ) ( ) = ( ) in GF(5)2x2

z dimension manipulated / a[0,0] unchanged

0 1

2 3

1

0

xy

t

Rotation values by word position in matrix

27286210y = 0

205564436y = 1

392543103y = 2

821154541y = 3

145661218y = 4

x = 4x = 3x = 2x = 1x = 0

Pi

pi (L[x,y]) = L[x’,y’]

where

( )( ) = ( )0 1

2 3

x’ xyy’

Chi

chi (C[x]) = C[x] xor ((not C[x+1]) and C[x+2])

王博文�
尺寸操纵�
Page 8: Chapter XXX – Cryptography and Miscellaneous 6th ED topics ...banach/COMP61411.Info/CourseSlides/ZZZ-Yea… · – Elliptic curve digital signature scheme – SHA -3 and Keccak

Iota

iota (L[0,0]) = L[0,0] xor RC(iround_number)

SHASHA--3 Summary3 Summary

• 3D structure unlike SHA-2 and SHA-1

• each step simple, focusing on one or two dimensions … simpler to analyse for assurance of security

• combination gives a strong hash function

王博文�
•与SHA-2和SHA-1不同的3D结构•每个步骤都很简单,侧重于一个或两个维度......分析更简单,以确保安全性•组合提供强大的哈希函数�