feat(ssh): implement AES-256-CTR encryption
SSH加密实现(cipher.rs): 实现内容: 1. cipher crate集成(添加cipher = "0.4"依赖) 2. AES-256-CTR加密/解密实现 - encrypt_packet(): 使用KeyIvInit + StreamCipher trait - decrypt_packet(): CTR模式双向加密 - 添加IV参数支持 3. SSH packet格式优化 - Random padding生成(rand::thread_rng) - MAC计算包含packet_length - EncryptedPacket::new()添加IV参数 技术实现: - 使用cipher::KeyIvInit trait初始化AES-CTR - 使用cipher::StreamCipher trait的apply_keystream() - 符合RFC 4253加密packet格式标准 编译结果: - ✅ 编译成功(147 warnings, 0 errors) - ✅ AES-CTR加密API正确实现 - ⏸️ 加密packet集成待server.rs集成 下一步: - 在server.rs中集成EncryptedPacket - 实现IV初始化(从会话密钥派生) - 测试完整加密通道 依赖变更: - markbase-core/Cargo.toml: cipher = "0.4"
This commit is contained in:
@@ -55,6 +55,7 @@ x25519-dalek = "2.0"
|
||||
ed25519-dalek = { version = "2.0", features = ["rand_core"] }
|
||||
aes = "0.8"
|
||||
ctr = "0.9"
|
||||
cipher = "0.4"
|
||||
|
||||
[features]
|
||||
default = [] # 默认不启用可选格式
|
||||
|
||||
Reference in New Issue
Block a user