Faris-Abuali / Cryptography-AES-Project

Full Implementation of AES Modules (Advanced Encryption Standard) from scratch, plus encoding and decoding of the message and the resulting cipher blocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cryptography & Networks Security - Team Project

AES (Advanced Encryption Standard) Implementation

Advanced Encryption Standard

Team Members:

  • Faris H. Abuali
  • Lena Samaha
  • Waleed Zriqi
  • Weaam Ghannam

Task definition:

It is an application to test AES modules (S-BOX, Shift rows, mix columns), which is the 16-byte output of "add round key" is the input to the first S-Box as 4*4 matrix called state, to perform a byte-to-byte substitution which is the input to the next level (shift rows) which rotate each row by specific value (except for the first row). The output of this level enters the next level (Mix column) which multiplies the state matrix with fixed matrix.

Definition of Algorithm:

First we have to talk about Advanced Encryption Standard algorithm (AES), It also Known as Rijndael algorithm, It is a symmetric block cipher algorithm that takes a block size of 128 bits and converts them into cipher text using keys of 128, 192 and 256 bits. AES contains several rounds; the number of rounds is dependent on key length. The plain text size is 16 byte which is divided to 4 words, each word is the column of 4*4 matrix, as shown in this figure: image
This matrix is called state matrix, which is modified at each round.

Each round has 4 stages (Except for the last round):

  1. Substitute bytes – Uses clever lockup table (S-Box) to map one byte to another

Substitute bytes

  1. Shift rows – A simple permutation.

Shift rows

  1. Mix columns – A substitution that makes use of arithmetic over GF(28).

Mix columns

  1. Add round key – A simple bitwise XOR of the current block with the portion of the expanded key.

Mix columns

The overall structure of AES:

The overall structure of AES


Notice that the last round doesn't contain mix column stage.

One Round of AES:

One Round of AES

Testing Everything (Encoding, Encryption, Decryption, then Decoding):

image

image

image

image

image

image

image

image

Getting Started

Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.

Folder Structure

The workspace contains two folders by default, where:

  • src: the folder to maintain sources
  • lib: the folder to maintain dependencies

Meanwhile, the compiled output files will be generated in the bin folder by default.

If you want to customize the folder structure, open .vscode/settings.json and update the related settings there.

Dependency Management

The JAVA PROJECTS view allows you to manage your dependencies. More details can be found here.

About

Full Implementation of AES Modules (Advanced Encryption Standard) from scratch, plus encoding and decoding of the message and the resulting cipher blocks


Languages

Language:Java 100.0%