Skip to content

Instantly share code, notes, and snippets.

@martani
Created January 7, 2013 00:44
Show Gist options
  • Save martani/4471394 to your computer and use it in GitHub Desktop.
Save martani/4471394 to your computer and use it in GitHub Desktop.
padding oracle attacker
//The Oracle
ICBCOracle cbcOracle = new Oracles.OnlineCBCOracle();
//The attacker, passing the Oracle to constructor
PaddingOracleAttacker attacker = new PaddingOracleAttacker(cbcOracle);
//Prepare the ciphertext
string cipherHex = "f20bdba6ff29eed7b046d1df9fb7000058b1ffb4210a580f748";
byte[] cipher = Helpers.ConvertHexStringToByteArray(cipherHex);
//Attack!
string plainText = attacker.Decrypt (cipher);
Console.WriteLine ("\n>>> Decryption result <<<:\n{0}", plainText);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment