Skip to content

This tool is the implementation of the Square-Attack on an AES-128

Notifications You must be signed in to change notification settings

Vozec/AES-Square-Attack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AES-Square-Attack

This tool is the implementation of the Square-Attack on an AES-128

An AES-128 reduced to 4 rounds is vulnerable to this attack if the MixColumns operation is forgotten on the last round

More Informations here

Usage :

  • main.py
from binascii import hexlify
from SquareAttack import *

cts = [b'...']

key = Square_attack(cts).Crack_key()
print(hexlify(key))

(cts is an array with the 256 ciphertexts)

Dataset :

We can create a dataset :

encrypted_ds = []
for i in range(256):
  data = bytearray([i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
  encrypted_ds.append(Encrypt_AES(data))
  return encrypted_ds

This tools was inspired by many writings/codes of other people from previous CTF Writeup

About

This tool is the implementation of the Square-Attack on an AES-128

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages