16 lines
457 B
Python
16 lines
457 B
Python
import base64
|
|
from chacha20poly1305 import ChaCha20Poly1305
|
|
|
|
cleartext=base64.decodebytes(b"RQAAVOVGQABAAUFMCgoAAgoKAAEIAPlcbAAAAG+tIvUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
|
|
key = base64.decodebytes(b"IA7buFUDsARj+YequW4OfQR3JsaE9M88dpXKrDjKzIs=")
|
|
nonce = bytes([0]*12)
|
|
|
|
cip = ChaCha20Poly1305(key)
|
|
|
|
ciphertag = cip.encrypt(nonce, cleartext)
|
|
|
|
ciphertext = ciphertag[:-16]
|
|
tag = ciphertag[-16:]
|
|
|
|
print(ciphertext)
|
|
print(tag) |