Here's my code so far. What I want to do is generate an RSA key based on the user's mouse movements.
from Crypto.PublicKey import RSA
def rand(leng):
data = open("/dev/input/mice","rb").read(leng)
return data
key = RSA.generate(1024,rand)
print(key.exportKey())
The issue I'm having is that the program just freezes. The error seems to be in reading /dev/input/mice from inside a function. If I try reading it in python from anywhere else, it works as expected.