Skip to content

Instantly share code, notes, and snippets.

@exarkun

exarkun/output Secret

Created January 19, 2021 20:50
Show Gist options
  • Save exarkun/10d4a416a3e9e5fdbae07ae60957b90a to your computer and use it in GitHub Desktop.
Save exarkun/10d4a416a3e9e5fdbae07ae60957b90a to your computer and use it in GitHub Desktop.
'+\x1c'
'+\x1c'
def pythoncryptography():
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import (
Cipher,
algorithms,
modes,
CipherContext,
)
def get_enc():
key = b"\x42" * 16
iv = b"\x00" * 16
cipher = Cipher(
algorithms.AES(key),
modes.CTR(iv),
backend=default_backend()
)
return cipher.encryptor()
enc = get_enc()
print(repr(enc.update(b"XX")))
enc = get_enc()
print(repr(enc.update(b"X") + enc.update(b"X")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment