1 / 30

第六章 对称密码

第六章 对称密码. 6.1 三重 DES. 双重 DES 加密 解密 问题:下式成立吗?. 两个密钥的三重 DES. 没有针对三重 DES 的攻击方法,它是一种较受欢迎的 DES 替代方案。 has been adopted by some Internet applications, eg PGP, S/MIME. IDEA 简介. 瑞士的来学嘉( Xuejia Lai ) 和 James Massey 于1990年公布了 IDEA 密码算法第一版,称为 PES (Proposed Encryption Standard) 。

ilario
Download Presentation

第六章 对称密码

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. 第六章 对称密码

  2. 6.1 三重DES • 双重DES 加密 解密 问题:下式成立吗?

  3. 两个密钥的三重DES • 没有针对三重DES的攻击方法,它是一种较受欢迎的DES替代方案。 • has been adopted by some Internet applications, eg PGP, S/MIME

  4. IDEA简介 • 瑞士的来学嘉(Xuejia Lai)和James Massey于1990年公布了IDEA密码算法第一版,称为PES (Proposed Encryption Standard)。 • 为抗击差分密码攻击,他们增强了算法的强度, 称IPES(Improved PES),并于1992年改 名为IDEA(International Data Encryption Algorithm,国际数据加密算法。)

  5. IDEA(Cont.) • IDEA是一个分组长度为64位的分组密码算法,密钥长度为128位(抗强力攻击能力比DES强),同一算法既可加密也可解密。 • IDEA的“混淆”和“扩散”设计原则来自三种运算,它们易于软、硬件实现(加密速度快):

  6. IDEA简介(Cont.) • 异或运算( ) • 整数模216加( + ) • 整数模216+1乘( )(IDEA的S盒) • 扩散由称为MA结构的算法基本构件提供。 F1 F2 Z5 Z6 G1 G2

  7. IDEA简介(Cont.) • 实现上的考虑 • 使用子分组:16bit的子分组; • 使用简单操作(易于加法、移位等操作实现) • 加密解密过程类似; • 规则的结构(便于VLSI实现)。

  8. IDEA加密的总体方案图 64位明文 128位密钥 Z1 循环1 Z6 子密钥生成器 Z7 循环2 Z12 16 Z43 循环8 Z1 Z52 Z48 Z49 输出变换 Z52 64位密文

  9. IDEA加密的单个循环图 X4 X1 X2 X3 Z1 Z3 Z4 Z2 Z5 Z6 W11 W12 W13 W14

  10. IDEA的密钥生产 • 56个16bit的子密钥从128bit的密钥中生成前8个子密钥直接从密钥中取出; • 对密钥进行25bit的循环左移,接下来的密钥就从中取出; • 重复进行直到52个子密钥都产生出来。

  11. IDEA的解密 • 加密解密实质相同,但使用不同的密钥; • 解密密钥以如下方法从加密子密钥中导出: • 解密循环I的头4个子密钥从加密循环10-I的头4个子密钥中导出;解密密钥第1、4个子密钥对应于1、4加密子密钥的乘法逆元;2、3对应2、3的加法逆元; • 对前8个循环来说,循环I的最后两个子密钥等于加密循环9-I的最后两个子密钥;

  12. IDEA简介(Cont.) • IDEA是PGP的一部分; • IDEA能抗差分分析和相关分析; • IDEA似乎没有DES意义下的弱密钥; • Bruce Schneier 认为IDEA是DES的最好替代,但问题是IDEA太新,许多问题没解决。

  13. Blowfish • 是Bruce Schneier研制的,有以下特性: 快速、紧凑、简单、可变的安全性。 • 使用32~448bit密钥,密钥用来生成18个32bit的子密钥(P数组)和4个8×32bit的S盒(S数组): • 使用两种操作:加法、异或;

  14. Blowfish加密操作 64bit明文 32 32 P18 P17 P1 F 64bit密文 P16 F

  15. Ri Li Blowfish单个循环细节 32 32 Pi F函数 32 32 8 8 8 8 S1 S2 S3 S4 32 32 32 32

  16. Blowfish 的密钥调度 • 密钥长度为 32到 448 bit 长 • 用于生成 • 18 个32-bit 子密钥,存放在数组Kj • 4个 8x32的 S-boxes,存放在数组Si,j • 密钥调度的过程: • 使用pi初始化数组P和4个 S-boxes • 用密钥比特XOR P数组 (在需要时重复使用) • 用当前P、S加密,并替换P、S,直到全部P、S都被更新 • 需要 521次加密,因此不大适合密钥经常变动的情况

  17. Blowfish • Blowfish速度很快; • 还没有Blowfish可用弱点的报告; • Blowfish有很好的雪崩效应; • Blowfish每一循环都对数据的两半进行操作; • Blowfish是免费的;

  18. RC5 • a proprietary cipher owned by RSADSI • designed by Ronald Rivest (of RSA fame) • used in various RSADSI products • can vary key size / data size / no rounds • very clean and simple design • easy implementation on various CPUs • yet still regarded as secure

  19. RC5 Ciphers • RC5 is a family of ciphers RC5-w/r/b • w = 字长度 (16/32/64) ,且 data=2w • r = 轮次数 (0..255) • b = 密钥的字节数 (0..255) • Rivest的建议版本是 RC5-32/12/16 • ie 32-bit words so encrypts 64-bit data blocks • using 12 rounds • with 16 bytes (128-bit) secret key

  20. RC5 密钥扩展 • RC5 使用 2r+2个子密钥字 (w-bits) • 子密钥存储在数组 S[i], i=0..t-1 • 密钥调度过程 • 初始化S 为一个固定的伪随机值,可使用 e 和phi • 将b字节的密钥拷贝到c个字的数组L中 • 最后执行一个复杂运算,将L 和S结合成最终的 S 数组

  21. RC5 加密 • 明文分为两半 A & B L0 = A + S[0]; R0 = B + S[1]; for i = 1 to r do Li= ((Li-1 XOR Ri-1) <<< Ri-1) + S[2 x i]; Ri= ((Ri-1 XOR Li) <<< Li) + S[2 x i + 1]; • 每一轮相当 DES 的两轮 • 注意:移位是算法中唯一的非线性部分

  22. RC5运行模式 • RFC2040 定义了 RC5的4种运行模式 • RC5 Block Cipher, is ECB mode • RC5-CBC, is CBC mode • RC5-CBC-PAD, is CBC with padding by bytes with value being the number of padding bytes • RC5-CTS, a variant of CBC which is the same size as the original message, uses ciphertext stealing to keep size same as original

  23. 先进分组密码的特点 • 可变密钥长度 • 混合操作 • 依赖数据的循环移位 • 依赖于密钥的循环移位 • 依赖密钥的S盒子 • 冗长的密钥调度算法 • 可变的F函数和可变的明文/密文长度 • 可变的循环次数 • 在每次循环中都对两半数据进行操作

  24. 流密码 • 按比特进行数据处理 • (伪)随机密钥流 • randomness of stream key completely destroys any statistically properties in the message • Ci = Mi XOR Stream Keyi • 不可重复使用密钥流

  25. 流密码属性 • 设计流密码主要的考虑因素: • 加密序列的周期要长 • 密钥流应尽可能地接近一个真正的随机数流的特征 • 密钥应该足够长

  26. RC4 • a proprietary cipher owned by RSA DSI • another Ron Rivest design, simple but effective • variable key size, byte-oriented stream cipher • widely used (web SSL/TLS, wireless WEP) • key forms random permutation of all 8-bit values • uses that permutation to scramble input info processed a byte at a time

  27. RC4 Key Schedule • starts with an array S of numbers: 0..255 • use key to well and truly shuffle • S forms internal state of the cipher • given a key k of length l bytes for i = 0 to 255 do S[i] = i j = 0 for i = 0 to 255 do j = (j + S[i] + k[i mod l]) (mod 256) swap (S[i], S[j])

  28. RC4 Encryption • 加密过程继续混乱数组 • 两个数组元素的和确定加密使用的密钥 i = j = 0 for each message byte Mi i = (i + 1) (mod 256) j = (j + S[i]) (mod 256) swap(S[i], S[j]) t = (S[i] + S[j]) (mod 256) Ci = Mi XOR S[t]

  29. RC4 安全强度 • 对抗已知攻击 • 没有有效的攻击方法 • 结果显式强的非线性性 • since RC4 is a stream cipher, must never reuse a key • have a concern with WEP, but due to key handling rather than RC4 itself

  30. 本章小结 • some other modern symmetric block ciphers • Triple-DES • IDEA • Blowfish • RC5 • briefly introduced stream ciphers • RC4

More Related