Skip to content

Instantly share code, notes, and snippets.

@AndyNovo

AndyNovo/enc.hex Secret

Created October 31, 2022 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndyNovo/4ce7b2fdff510d4eb8d31f5edfc2ec05 to your computer and use it in GitHub Desktop.
Save AndyNovo/4ce7b2fdff510d4eb8d31f5edfc2ec05 to your computer and use it in GitHub Desktop.
63727562714d6f09656c5f0d69455e556803050c424b3c0a
#!/usr/local/bin/python3.9
from pwn import *
import random
import string
import binascii
import os
s=os.urandom(12)
random.seed(s)
with open('flag.txt','r') as f:
flag = f.read().encode()
def create_key():
key = ''
for i in range(10):
key += random.choice(string.ascii_lowercase)
return binascii.hexlify(key.encode())
k = create_key()
enc = xor(flag,k)
print(b'Decrypt this -> ' + enc)
#for this gist I've converted to hex, flag format UDCTF{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment