feat: 完善AES加密实现和多个问题的解决方案
- 在common库中添加了完整的AES-128加密解密实现 - 实现了AES-ECB和AES-CBC模式的加密解密函数 - 添加了密钥扩展和所有必要的AES操作函数 - 完成了问题10的AES-CBC模式实现 - 修复了问题11的加密oracle实现,使用正确的ECB检测 - 改进了代码风格,使用现代Rust格式化语法 - 为多个问题添加了common库的依赖 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ fn is_ecb(cipher: &[u8]) -> bool {
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let file_name = "problems/p8/8.txt".to_string();
|
||||
for line in io::BufReader::new(File::open(file_name).expect("Unable to open file")).lines() {
|
||||
@@ -21,9 +22,8 @@ fn main() {
|
||||
let cipher = hex::decode(&line).expect("Invalid hex string");
|
||||
|
||||
if is_ecb(&cipher) {
|
||||
println!("ECB detected: {}", line);
|
||||
println!("ECB detected: {line}");
|
||||
}
|
||||
}
|
||||
println!("Finished checking for ECB mode.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user