This project provides a Java implementation of AES (Advanced Encryption Standard) encryption algorithm. AES is a symmetric key encryption algorithm widely used for securing sensitive data.
The project consists of several classes:
- AES: Implements the AES encryption algorithm, including methods for encryption and decryption, as well as definitions for S-box, inverse S-box, mix matrix, and inverse mix matrix.
- Block: Represents a block of binary data and provides methods for various operations like XOR, left shift, modular multiplication, and segment extraction.
- Key: Represents a cryptographic key for AES encryption, supporting key expansion and sub-key generation.
- SBox: Represents an S-box (Substitution-box) used in AES encryption, providing a method for applying the S-box transformation to a block.
- State: Represents the state in the AES encryption process, providing methods for creating, manipulating, and converting the state.
To use the AES encryption algorithm:
- Create an instance of the
AES
class with a key represented by aBlock
. - Use the
cipher
method to encrypt plain text and thedecipher
method to decrypt cipher text.
Example:
String plain="0110111101101011";
String key="0010110101010101";
Block plainBlock=new Block(plain);
Block keyBlock=new Block(key);
AES aes=new AES(keyBlock);
Block cipherBlock=aes.cipher(plainBlock);
Block decipherBlock=aes.decipher(cipherBlock);
System.out.println("Plain: "+plainBlock);
System.out.println("Cipher: "+cipherBlock);
System.out.println("Decipher: "+decipherBlock);
- Ricardo BOKA - [email protected],
- Sébastien GIRET-IMHAUS - [email protected],
- Nelson PROIA - [email protected],
- Mathieu ANDRIN - [email protected].
This project is licensed under the MIT License. See the LICENSE file for details.