feat: Initial padding oracle working. Pending check for special case.

The initial padding oracle attack is working. More tests need to be
added and there needs to be a check for the special case of the 02 01,
02 02 padding case
This commit is contained in:
0xalivecow 2024-11-06 23:38:54 +01:00
parent b81bbab16c
commit 9ae53e12fd
No known key found for this signature in database
6 changed files with 159 additions and 0 deletions

View file

@ -10,6 +10,7 @@ use tasks01::{
block2poly::block2poly,
gcm::{gcm_decrypt, gcm_encrypt},
gfmul::gfmul_task,
pad_oracle::padding_oracle,
poly2block::poly2block,
sea128::sea128,
xex::{self, fde_xex},
@ -75,7 +76,13 @@ pub fn task_deploy(testcase: &Testcase) -> Result<Value> {
Ok(json)
}
"padding_oracle" => {
let plaintext = padding_oracle(args)?;
let out_plain = BASE64_STANDARD.encode(&plaintext);
let json = json!({"plaintext" : out_plain});
Ok(json)
}
_ => Err(anyhow!(
"Fatal. No compatible action found. Json data was {:?}. Arguments were; {:?}",
testcase,