摘要: MD5哈希长度延展攻击原理 已知原始消息 ( m ) 和其对应的哈希值 ( h )。 选择额外数据 ( m’ )。 计算填充,使得填充后的消息长度满足长度模512等于448,并包含新消息的长度信息。 构造新消息 ( m + \text{填充} + m’ )。 计算新消息的哈希值 ( h’ )。 代码 阅读全文
posted @ 2024-04-18 15:13 20211301郑润芃 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 第二题 #include <stdio.h> #include <openssl/evp.h> int main() { EVP_MD_CTX *mdctx; const EVP_MD *md; unsigned char md_value[EVP_MAX_MD_SIZE]; unsigned in 阅读全文
posted @ 2024-04-18 14:47 20211301郑润芃 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 第二题代码 #include <stdio.h> #include <stdlib.h> #include <stdint.h> void write_der_encoded_integer(const char *filename, uint32_t integer) { // 打开文件以便写入 阅读全文
posted @ 2024-04-18 14:30 20211301郑润芃 阅读(1) 评论(0) 推荐(0) 编辑