Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

My implementation of AES 256-bit encryption!

License

NotificationsYou must be signed in to change notification settings

Joshua-Riek/AES

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My implementation of AES 256-bit encryption written in pure Python! This features the ability to use ECB mode and CBC mode along with various types of input data.

ECB Mode

The simplest of the encryption modes is the Electronic Codebook (ECB) mode.

The message is divided into blocks, and each block is encrypted separately.

# A simple example of encrypting a string with ECB mode!key=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1faes=AES(key)cyphertext=aes.encrypt('Hello World!')plaintext=aes.decrypt(cyphertext)

CBC Mode

In Cipher Block Chaining (CBC) mode, each block of plaintext is XORed with the previous ciphertext block before being encrypted. This can be denoted as:

Encryption:Ci = Ek(Pi xor C(i-1)) and C0 = IV

Decryption:Pi = Dk(Ci) xor C(i-1) and C0 = IV

# A simple example of encrypting bytes with CBC mode!key=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1fiv=0x000102030405060708090a0b0c0d0e0faes=AES(key,iv)cyphertext=aes.encrypt(b'Hello World!')plaintext=aes.decrypt(cyphertext)

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp