html5-img
1 / 17

第三讲 古典替换密码 Classical substitution ciphers

第三讲 古典替换密码 Classical substitution ciphers. 上海交通大学计算机科学与工程系 信息安全工程学院 郑东 zhengdong@s.sjtu.edu.cn. 1. 古典加密技术. 两个基本组成部分:替换与变换 (substitution and transposition). 2. Caesar Cipher. Caesar 密码的数学表示 设:

drea
Download Presentation

第三讲 古典替换密码 Classical substitution ciphers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第三讲 古典替换密码Classical substitution ciphers 上海交通大学计算机科学与工程系 信息安全工程学院 郑东 zhengdong@s.sjtu.edu.cn

  2. 1.古典加密技术 • 两个基本组成部分:替换与变换 (substitution and transposition)

  3. 2. Caesar Cipher • Caesar 密码的数学表示 设: • A the value 0, B 1, C 2, ... Y 24, Z 25; • 加密算法: • Ek: i -> i + k (mod 26) • 解密算法: • Dk: i -> i - k (mod 26)

  4. 3.密码分析(Cryptanalysis of Caesar ciphers) • 只有 26 种可能(only have 26 possible ciphers ) • A maps to A,B,..Z • 可以简单的实验每个密钥(穷密钥搜索) • 给定一些密文,实验每个密钥。 LIZHZLVKWRUHSODFHOHWWHUV Original ciphertext KHYGYKUJVQTGRNCEGNGVVGTU try shift of 1 JGXFXJTIUPSFQMBDFMFUUFST try shift of 2 IFWEWISHTOREPLACELETTERS try shift of 3 *** plaintext HEVDVHRGSNQDOKZBDKDSSDQR try shift of 4 GDUCUGQFRMPCNJYACJCRRCPQ try shift of 5 ..... MJAIAMWLXSVITPEGIPIXXIVW try shift of 25 • eg. break ciphertext "GCUA VQ DTGCM"

  5. 4.语言冗余度与密码分析 • 人类语言是有冗余度的 • 字母使用的频率是不相同的 • 在英语中,e 的使用率是最高的 • 其次,T,R,N,I,O,A,S • 其它字母使用的较低

  6. 5. 英语字母使用频率

  7. 6。字母频率在密码分析中的应用 • 计算密文中字母出现的频率 • 与已知字母分布比较 • 单码替换不改变相对字母出现的频率 • 阿拉伯科学家提出此方法

  8. 7.英语字母中常见的组合

  9. 8。打乱的密码代换 • 不仅仅是简单的移位变换 • 每个字母可以避免随意变换到其它不重复的字母 • 每个字母变换到不同的字母 • 密钥长度是26个字母 • eg. Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN Plaintext: IFWEWISHTOREPLACELETTERS Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA

  10. 9。打乱的密码代换的安全性 • 密钥总数:26! • 如此多的密钥,可以认为安全吗? • !!!NO!!! • 仍然有语言统计规律 • 需要其它方法隐藏这种规律性

  11. 10。一般单码替换密码 • 简单的方法给出密钥 • 写出密钥(删除重复字母)write key (with repeated letters deleted) • 在其下面依次写出剩余字母(以横、纵行) • 按列读取字母得到密文。then read off by columns to get ciphertext equivalents

  12. 11。一般单码替换密码 举例 • 给定密钥字 "STARWARS" • 去掉重复字母得到 "STARW" • 填写剩余字母: STARW BCDEF GHIJK LMNOP QUVXY Z • 按列读取字母得到密文 • Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ Cipher: SBGLQZTCHMUADINVREJOXWFKPY • 可以用这个密钥加密、解密 • 例如 Plaintext: I KNOW ONLY THAT I KNOW NOTHING • Ciphertext: H UINF NIAP OCSO H UINF INOCHIT

  13. 12。一般单码替换密码 的密码分析 • 根据频率统计进行分析 • 确定每个字母被映射到什么字母 • 单个字母出现的可能是A或I(since know single words are 'A' or 'I' ) • 一般来说个字母出现的可能是THE或AND • 还可以用其他通常出现的双字母或三字母组合(otherwise just use common double and triple letters ) • 还可以应用其它很少应用的字母also use knowledge of rarely used letters

  14. 13.信息论与熵 C.E. Shannon (香农), 1948, A mathematical theory of communication. 确立了现代信息论。 1949, Communication theory of secrecy systems. 定义了密码系统的精确数学模型。

  15. 13.2熵 entropy • 熵(Entropy,定义为事件集X中事件出现 的信息的统计平均值 它表示X中出现一个事件平均给出的信息量, 或事件的平均不确定性

  16. Exercises • encrypt and then decrypt by hand, the text below using a general monoalphabetic cipher with a key of "NIFTY": • 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

  17. OK!

More Related