Code Monkey home page Code Monkey logo

aes-cbc-padding-attack's Introduction

AES CBC Padding Attack

Golang programs for Padding Oracle attack for AES CBC mode.

  1. encrypt-auth contains main.go program to perform AES encryption in CBC mode with HMAC. Here the AES and SHA256 functions are used from the standard package, but the CBC mode encryption and HMAC calculations are performed in program.

    To build the binary, the following command can be performed:

     go build
    

    The encryption/decryption can be performed with the following command:

     ./encrypt <mode> -k <32-byte key in hexadecimal> -i <input file> -o <output file>
    

    mode = encrypt or decrypt and first 16 bytes of the key is used for encryption and last 16 bytes of MAC calculation.

  2. decrypt-test contains main.go program that works like the oracle. The program ./decrypt-test that has the key K hardcoded into it. It performs decryption of the provided cipher text and it will not return the decrypted ciphertext, but instead only a single one of the following three response messages:

    1. “SUCCESS”
    2. “INVALID PADDING”
    3. “INVALID MAC”

    The command-line profile for decrypt-test will be as follows:

     ./decrypt-test -i <ciphertext file>
    
  3. decrypt-attack contains main.go program that performs the padding oracle attack. The program takes a cipher text as the input programmatically decrypts and returns the plain text of any ciphertext produced by your encryption utility from encrypt-auth with the help of ./decrypt-test. It will not have access to a decrypt-key. The command-line profile for decrypt-test will be as follows:

     ./decrypt-attack -i <ciphertext file>
    

aes-cbc-padding-attack's People

Contributors

arvindpj007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

scholastics

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.