Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created October 29, 2024 11:18
Show Gist options
  • Save AndyNovo/40adab2061f6b2fd47d6ba7d765fb159 to your computer and use it in GitHub Desktop.
Save AndyNovo/40adab2061f6b2fd47d6ba7d765fb159 to your computer and use it in GitHub Desktop.
from secret import flag, insecure_prng_generator
import os
import random
from pwn import *
padding1 = os.urandom(random.randint(1,100))
padding2 = os.urandom(random.randint(1,100))
message = padding1 + flag + padding2
seed = random.randint(10**9, 10**10)
key = bytes(list(map(lambda x: x % 256, insecure_prng_generator(seed, len(message)))))
print(xor(message, key).hex())
#1432b94ad04ede2743bf4b1112a5a33f8732e7cdd44a9d4dd37732e8c679883fa31d7e54fd5f0ff559310838dfbe07c16d884f4695084104f1a43900da0d49c74ddb01781cd34b23e8b1e7b05772b57f9ec5dee7ad46fedf2e4b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment