Skip to content

Liquid-radium/AES-implementation-in-Python-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

AES Encryption Simulator (Python)

Overview

This project is a Python simulation of AES-128 encryption using Object-Oriented Programming (OOP) and standard data structures.
It demonstrates the core AES operations:

  • SubBytes: Non-linear byte substitution using the S-Box
  • ShiftRows: Row-wise cyclic shifts for diffusion
  • MixColumns: Column mixing (diffusion using GF(2^8))
  • AddRoundKey: XOR with the round key for confusion

The code works on 16-byte blocks and uses a 16-byte key (AES-128).


Features

  • Converts plaintext into a 4×4 state matrix
  • Performs AES rounds with SubBytes, ShiftRows, MixColumns, and AddRoundKey
  • Converts the encrypted state back into a hexadecimal ciphertext
  • Easily extendable for full AES implementation (key expansion and MixColumns)

Usage

from aes import AES

key = "2b7e151628aed2a6abf7158809cf4f3c"      # 16-byte AES-128 key
plaintext = "3243f6a8885a308d313198a2e0370734" # 16-byte plaintext

aes = AES(key)
ciphertext = aes.encrypt_block(plaintext)
print("Ciphertext:", ciphertext)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages