Giter Club home page Giter Club logo

aes-256's Introduction

AES-256

A java implementation of the AES cipher.

AES.java contains all the main functions used for encryption.

utils.java has the supporting functions for SBOX tables and Galois Field multiplication

The implementation works for 128, 192 and 256 bit keys without any modification to the code.

The key schedule is stored in an int array

The states are stored in a 2-D byte array

For mixColumns and InvMixColumns() circular matrices specified in the AES proposal are used. The multiplication in Galois Field is done using seperate functions defined in the utils.java file. All these functions use only shift operators and XOR's making them very fast to implement in hardware while at the same time not requiring large amount of memory. The most trivial function is gmul2() which does the Galois field multiplication for 2. The other functions rely on this to obtain their outputs. The multiplication for 2 is equivalent to shifting the number left by one and then XORing the value 0x1B if the high bit had been 1. The multiplicaton by 3 is done by multiplying by 2 (using gmul2 explained earlier) and then XORing the output with the original value (as 3 = 2 xor 1) mixColumns only requires Galois field multiplication for 1,2 and 3 so with these we are able to perform mixColumns()

For invMixColumns() we require Galois field multiplication for 9,11,13 and 14. These are also obtained in a similar way using the multiplication by 2 as the base. For example gmul9 is computed by using gmul8 and the original value.

aes-256's People

Contributors

vinayakshukl avatar jatinsindhu avatar

Watchers

James Cloos avatar AE avatar

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.