Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 485 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 485 Bytes

🎲 unrandom

My blog post: Making Python Less Random


Force getrandom syscalls from a process to return zeroes on x86-64 Linux.


Start a Python REPL. Then build and run getrandom:

gcc -o unrandom unrandom.c
./unrandom <python's pid>

Call os.urandom in the REPL:

>>> import os
>>> os.urandom(8)
b'\x00\x00\x00\x00\x00\x00\x00\x00'
>>> os.urandom(8)
b'\x00\x00\x00\x00\x00\x00\x00\x00'