Presentation is loading. Please wait.

Presentation is loading. Please wait.

第五讲古典变换密码与乘积密码 上海交通大学计算机科学与工程系 Tel:

Similar presentations


Presentation on theme: "第五讲古典变换密码与乘积密码 上海交通大学计算机科学与工程系 Tel:"— Presentation transcript:

1 第五讲古典变换密码与乘积密码 上海交通大学计算机科学与工程系 Zheng-dong@cs.sjtu.edu.cn Tel: 62932135
郑东

2 1 .块(Block )变换密码 另一类变换密码 消息按行写,按列读出。 按列读出的顺序由密钥给出。

3 2.块变换密码举例 为方便起见,把消息写成满矩阵形式 Key(R): s o r c e r y s o r c e r y
l a s e r b e l a s e r b e a m s c a n b a m s c a n b e m o d u l a e m o d u l a t e d t o c a t e d t o c a r r y m o r e r r y m o r e i n t e l l I i n t e l l i g e n c e t h g e n c e t h a n r a d i o a n r a d i o w a v e s w a v e s q r matrix incomplete complete

4 由密钥给出的顺序读出密文(4, 5, 2, 3, 6, 1, 7) ecdtm ecaer auool edsam merne nasso dytnr vbnlc rltiq laetr igawe baaei hor

5 3. 块变换密码解密 计算密文行数 (by dividing message length by key length)
按列写出密文消息(密钥给出顺序) 按行读出明文消息

6 4. 块变换密码分析 首先要知道是否块变换密码 通过消息长度猜测距阵大小 简单 测试每个密钥 按列写出消息
最一般的,利用自动工具实验所有置换 可以对一些可能单词组合形式的变换进行实验

7 5. 密码分析例子 给定密文: HADVF NITHB CTSBE HTEGE SRYRN AMINR IAIST TETOO ETSAN GLIET GTDRS CYGAI TANAH FLNAU ETIEM EOHUE AELYR IIS 假设对行变换失败 现猜测是块变换 寻找THE,实验各种大小的密钥 try 2, use command b 2 /THE - none match try 3, use command b 3 /THE - none match try 4, use command b 4 /THE - 2 matches, both rubbish try 5, use command b 5 /THE - 1st match gives answer -> b 5 /THE THEGR EATES TDISC OVERY OFMYG ENERA TIONI STHAT AHUMA NBEIN GCANA LTERH ISLIF EBYAL TERIN GHISA TTITU DES Accept (y/n/q)?y

8 6。Nihilist ciphers 更复杂的变换密码(行变换和列变换同时应用)

9 7.增加密码的安全性 仅仅基于替换或置换的密码是不安全的 前面的得例子可以看到这一点 这是由于他们不能克服语言结构的特点 因此考虑连续使用几种密码克服, 注: 两个替换密码只能提高很少的复杂度 两个置换也只能提高很少的复杂度 但替换与置换连用,可以提高较高的复杂密码

10 8。乘机密码 是一种替换与变换合用的密码 一般情况下,手工破译是非常困难的一种有名的乘积密码“ADFGVX cipher” 在第一次世界大战中使用

11 9。ADFGVX 乘积密码 这样命名是因为变换仅依赖与 ADFGVX 在WW1有德国人使用,并被英国人破译 方法:
使用一个固定的替换表,把每个明文字母映射成一个字母对 (row-col index) 在用一个带密钥的块变换把每个对分解then 利用带密钥的块变换写下所有字母对 写出密文(按块密码形式)

12 10。ADFGVX Substitution Table
\\    A     D     F     G     V     X     A    K     Z     W     R     1     F     D    9     B     6      C      L     5     F    Q     7     J     P     G     X     G     E    V    Y    3     A     N     V     8    O     D    H     0     2     X    U     4     I     S     T     M    

13 11。 ADFGVX 加密举例 Plaintext: PRODUCTCIPHERS Intermediate Text:
FG AG VD VF XA DG XV DG XF FG VG GA AG XG 带密钥的块变换矩阵: D E U T S C H Key Sorted Order F G A G V D V F X A D G X V D G X F F G V G G A A G X G Ciphertext: DXGX FFDG GXGG VVVG VGFG CDFA AAXA

14 12 小结 变换密码的概念 行变换密码 块变换密码 Nihilist 密码 乘积密码

15 练习 encrypt and then decrypt by hand, the text below using a block (column) transposition with a key of SNEAKY: the cat only grinned when it saw alice it looked good natured she thought still it had very long claws and a great many teeth so she felt that it ought to be treated with respect

16 练习 2. encrypt and then decrypt by hand, the text below using the ADFGVX cipher with a key of SNEAKY: to see victory only when it is within the ken of the common herd is not the acme of excellence

17 THE END!


Download ppt "第五讲古典变换密码与乘积密码 上海交通大学计算机科学与工程系 Tel:"

Similar presentations


Ads by Google