文档详情

2012 第12章 Hash和MAC算法.ppt

发布:2018-05-16约3.57千字共18页下载文档
文本预览下载声明
第12章 Hash和MAC算法 要点 SHA-512 HMAC CMAC Hash和MAC算法 Hash函数 压缩任意长度的消息到固定长度 分组处理消息 使用压缩函数 特别设计或基于分组密码 Message Authentication Code (MAC) 对消息的固定长度的认证符 对消息提供认证 用分组密码或hash Hash Algorithm Structure SHA-512 Overview SHA-512压缩函数 算法核心 处理1024-bit消息块 有80轮 更新一个512-bit缓存 使用64-bit值Wt, Wt由当前消息块导出 轮常数基于前8个素数的立方根 SHA-512 Round Function SHA-512 Round Function Secure Hash Algorithm SHA由NIST NSA 于1993年设计 1995修订为SHA-1 美国标准与DSA签名一起使用 FIPS 180-1 1995, also Internet RFC3174 算法称为SHA, 标准称为SHS 基于MD4, 有关键不同 产生160-bit hash值 SHA-1发现安全问题2005 Revised Secure Hash Standard 2002年发布FIPS 180-2 增加SHA的3个版本 SHA-256, SHA-384, SHA-512 设计上为兼容由AES提供的增强的安全性 结构和细节类似于SHA-1 分析类似 安全水平更高 带密钥Hash函数作MAC 基于hash的MAC Hash函数速度快 Hash函数代码易得 Hash结合密钥与消息 原始建议: KeyedHash = Hash(Key|Message) 发现弱点 HMAC HMAC Internet标准RFC2104 用hash函数于密钥: HMACK = Hash[(K+ XOR opad) || Hash[(K+ XOR ipad)||M)]] K+ 是密钥填充 opad, ipad为规定填充常数 负担仅多几个hash运算 可使用任何hash函数 eg. MD5, SHA-1, RIPEMD-160, Whirlpool HMAC Overview HMAC安全性 HMAC安全性与所使用hash相同 攻击HMAC需要: 搜索密钥 生日攻击(由于使用密钥需要大量的消息) 选择hash须速度与安全水平折中 CMAC DAA (CBC-MAC) 广泛用于政府和工业界 有消息长度限制 可避免使用2 keys padding的加密 Cipher-based Message Authentication Code (CMAC) NIST SP800-38B采用 CMAC Overview 小结 SHA-512 HMAC CMAC * * * * Now examine the structure of SHA-512, noting that the other versions are quite similar. SHA-512 follows the structure depicted in Stallings Figure 12.1. The processing consists of the following steps: ? Step 1: Append padding bits ? Step 2: Append length ? Step 3: Initialize hash buffer ? Step 4: Process the message in 1024-bit (128-word) blocks, which forms the heart of the algorithm ? Step 5: Output the final state value as the resulting hash See text for details. The SHA-512 Compression Function is the heart of the algorithm. In this Step 4, it processes the message in 1024-bit (128-word) blocks, using a module that consists of 80 rounds, labeled F in Stallings Figure 12, as shown in Figure 12.2. Each round takes as input the 512-bit buffer value, and updates the contents
显示全部
相似文档