1
0

feat: 实现多个挑战并改进测试

- 重写p1实现纯Rust的hex到base64转换
- 完成p13 ECB剪切粘贴攻击和破解脚本
- 实现p33 Diffie-Hellman密钥交换算法
- 修复p9的PKCS#7测试用例
- 在common库添加gen_random_key和pkcs7_unpadding函数
- 更新workspace依赖管理
This commit is contained in:
2025-08-01 16:00:16 +08:00
parent 23d016407c
commit e400b87e9f
17 changed files with 664 additions and 68 deletions

View File

@@ -2,15 +2,7 @@ use std::process::exit;
use anyhow::Result;
use base64::{Engine, engine::general_purpose::STANDARD};
use common::{aes_ecb_enc, pkcs7_padding};
use rand::{prelude::*, rand_core::block};
fn gen_random_key() -> [u8; 16] {
let mut rng = rand::rng();
let mut key = [0u8; 16];
rng.fill(&mut key);
key
}
use common::{aes_ecb_enc, gen_random_key, pkcs7_padding};
fn oracle(controlled_input: &[u8], key: &[u8; 16], unknown_string: &[u8]) -> Vec<u8> {
let mut data = Vec::new();