feat: v1.1.17, decrypt hex
This commit is contained in:
@@ -52,7 +52,12 @@ impl Command for CommandImpl {
|
||||
let m = BigNum::from_slice(&encrypted).unwrap();
|
||||
let mut r = BigNum::new().unwrap();
|
||||
r.mod_exp(&m, d, n, &mut BigNumContext::new().unwrap()).unwrap();
|
||||
debugging!("Encrypted raw HEX: {}", hex::encode(&r.to_vec()));
|
||||
let v = r.to_vec();
|
||||
debugging!("Encrypted raw HEX: 00{}", hex::encode(&v));
|
||||
let pos = v.iter().position(|b| *b == 0x00);
|
||||
if let Some(pos) = pos {
|
||||
debugging!("Encrypted text HEX: {}", hex::encode(&v[pos+1..]));
|
||||
}
|
||||
});
|
||||
|
||||
let mut decrypter = opt_result!(Decrypter::new(&keypair), "Decrypter new failed: {}");
|
||||
|
||||
@@ -56,7 +56,7 @@ impl Command for CommandImpl {
|
||||
let m = BigNum::from_slice(&signature).unwrap();
|
||||
let mut r = BigNum::new().unwrap();
|
||||
r.mod_exp(&m, e, n, &mut BigNumContext::new().unwrap()).unwrap();
|
||||
debugging!("Signature raw HEX: {}", hex::encode(&r.to_vec()));
|
||||
debugging!("Signature raw HEX: 00{}", hex::encode(&r.to_vec()));
|
||||
});
|
||||
|
||||
let file_in = opt_value_result!(sub_arg_matches.value_of("in"), "File in --in required");
|
||||
|
||||
Reference in New Issue
Block a user