Created
January 7, 2013 00:44
-
-
Save martani/4471394 to your computer and use it in GitHub Desktop.
padding oracle attacker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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