-
-
Save AndyNovo/4ce7b2fdff510d4eb8d31f5edfc2ec05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63727562714d6f09656c5f0d69455e556803050c424b3c0a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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