From 97e1d334309cf02824bcdbc9e2c15bb83b23267d Mon Sep 17 00:00:00 2001 From: Nikos Vourdas Date: Wed, 4 Oct 2023 11:55:16 +0300 Subject: [PATCH] Add RUST AES Template Decryption final --- Decryptors/Decryptors.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Decryptors/Decryptors.go b/Decryptors/Decryptors.go index f9e0897..ca79b05 100644 --- a/Decryptors/Decryptors.go +++ b/Decryptors/Decryptors.go @@ -628,7 +628,6 @@ use std::io::Write; fn aes_decrypt(encrypted_data: &[u8], key: &[u8], iv: &[u8]) -> Result, ErrorStack> { let cipher = Cipher::aes_256_cbc(); let mut decrypter = Crypter::new(cipher, Mode::Decrypt, key, Some(iv))?; - decrypter.pad(false); let mut decrypted_data = vec![0; encrypted_data.len() + cipher.block_size()]; let mut count = decrypter.update(encrypted_data, &mut decrypted_data)?; @@ -651,6 +650,7 @@ fn main() -> Result<(), Box> { Ok(decrypted_payload) => { let payload_len = decrypted_payload.len(); + println!("AES Decrypted Payload:\n"); print!("let %s: [u8; {}] = [", payload_len); for (i, byte) in decrypted_payload.iter().enumerate() { print!("{:#04x}", byte); @@ -658,13 +658,12 @@ fn main() -> Result<(), Box> { print!(", "); } } - println!("];"); + println!("];\n"); } Err(e) => { eprintln!("Error: {:?}", e); } } - Ok(()) } `