Skip to content
Snippets Groups Projects
Commit 3175743c authored by Viken's avatar Viken
Browse files

Update from the 25th of June

parent 5f918170
Branches
No related tags found
No related merge requests found
File added
File added
from Cryptodome.Cipher import AES
def AES_decryption(ciphertext, key):
cipher = AES.new(key, AES.MODE_ECB)
decrypted = cipher.decrypt(ciphertext)
return decrypted
from Cryptodome.Cipher import ChaCha20
def ChaCha20_decryption(ciphertext, key):
nonce = b'9876543210fedcba'
cipher = ChaCha20.new(key=key, nonce=nonce)
decrypted = cipher.decrypt(ciphertext)
return decrypted
from Cryptodome.Cipher import Simon, Speck
def SIMON_decryption(ciphertext, key):
cipher = Simon.new(key, Simon.MODE_ECB)
decrypted = cipher.decrypt(ciphertext)
return decrypted
from Cryptodome.Cipher import Simon, Speck
def SPECK_decryption(ciphertext, key):
cipher = Speck.new(key, Speck.MODE_ECB)
decrypted = cipher.decrypt(ciphertext)
return decrypted
from Cryptodome.Cipher import AES
def AES_encryption(plaintext, key):
cipher = AES.new(key, AES.MODE_ECB)
ciphertext = cipher.encrypt(plaintext)
return ciphertext
from Cryptodome.Cipher import ChaCha20
def ChaCha20_encryption(plaintext, key):
nonce = b'9876543210fedcba'
cipher = ChaCha20.new(key=key, nonce=nonce)
ciphertext = cipher.encrypt(plaintext)
return ciphertext
from Cryptodome.Cipher import Simon, Speck
def SIMON_encryption(plaintext, key):
cipher = Simon.new(key, Simon.MODE_ECB)
ciphertext = cipher.encrypt(plaintext)
return ciphertext
from Cryptodome.Cipher import Simon, Speck
def SPECK_encryption(plaintext, key):
cipher = Speck.new(key, Speck.MODE_ECB)
ciphertext = cipher.encrypt(plaintext)
return ciphertext
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment