5

密码学-学习笔记2-Block Ciphers

 2 years ago
source link: https://iamywang.github.io/2020/study-block-cipher/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

密码学-学习笔记2-Block Ciphers

发表于

2020-10-17 分类于 study

阅读次数: 13

0x01 分组加密示意图

6.png
密钥扩展出n个轮密钥,以及使用轮密钥加密n轮:
7.png

0x02 PRP和PRF

8.png
PRP例子(PRP都是PRF):

- AES:K × X -> X(K = X = {0,1}^128)
- 3DES:K × X -> X(K = {0,1}^64 X = {0,1}^168)

一些要考虑的问题:

安全PRF:...
安全PRP:...

PRF ⇒ PRG:

G(k) = F(k,0) || F(k,1) || ... || F(k,t-1)

也可以从PRG构造PRF:

Luby-Rackoff定理、GGM PRF

0x03 DES

Feistel Network:
9.png

S盒:Si: {0,1}^6 -> {0,1}^4

0x04 攻击方式

穷举攻击 - Exhaustive Search Attack:

DES:2^56
...

中间相遇攻击 - Meet In The Middle Attack:

以空间换取时间的一种攻击方法。
2DES,约2^57而不是2^112

其他攻击方式:

侧信道攻击:测量time和power。
错误攻击:最后一轮计算错误暴露key。
线性和差分攻击:给出多对input/output,可以在2^56时间内找到key。
量子攻击:...

0x05 AES

Subs­‐Perm Network:
10.png

AES-128 示意图:
11.png

攻击方式:

Best Key Recover Attack:比穷举好四倍
Related Key Attack on AES-­256:2^99

0x06 操作模式:one-time key

- Adv能看到密文(使用一次性密码)
- Adv希望从密文得到明文的一些东西(考虑语义安全)
- ECB并非语义安全:如果超过一个块的话,密钥是多次使用的。

0x07 安全性:many-time key

- Adv可以看到多个同一个密钥加密的密文。
- Adv或许可以选择密文攻击。
- Adv肯定希望破坏语义安全。
- 解决方案:
1. 同一明文得到不同密文,密文要比明文长。
2. 使用nonce。

0x08 操作模式:many-time key(CBC)

CBC加密:
12.png

CBC解密:
13.png

0x09 操作模式:many-time key(CTR)

CTR模式示意图:
14.png

CBC和CTR对比:
15.png


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK