Skip to content

Instantly share code, notes, and snippets.

@omnidan
Created April 20, 2012 12:26
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 omnidan/2428188 to your computer and use it in GitHub Desktop.
Save omnidan/2428188 to your computer and use it in GitHub Desktop.
EntropyGEN: A script that does random disk operations to generate entropy for private key generation.
#!/usr/bin/env python
from os import system
from sys import argv
print("EntropyGEN v0.4")
print("USAGE: %s <BYTES_PER_SECOND>" % argv[0])
try:
try:
if len(argv) > 1: blen = int(argv[1])
else: blen = 100
except:
blen = 100
print(" - Generating entropy with %d bytes per second." % blen)
print(" - Press Ctrl+C to stop the generation of entropy.")
system("pv -tpL%d /dev/urandom > /tmp/.entropyfile" % blen)
raise Exception()
except:
system("rm /tmp/.entropyfile")
exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment