Python Random Number Generator for OTP

StealthMonger StealthMonger at nym.mixmin.net
Mon Jul 22 21:06:58 PDT 2013


Tom <ticom at sinister.com> writes:

> Does anyone on the list have some Python source code for an OTP-focused 
> random number generator they'd be willing to share? I'm interested in 
> seeing how different people would approach it?

#! /usr/bin/python

# SYNOPSIS

#   random-bytes <n>

# DESCRIPTION

#   Writes n cryptographically strong random bytes to stdout.
#   Test with, e.g., random-bytes 16 | hd

From os import urandom
import sys

sys.stdout.write(urandom(int(sys.argv[1])))


-- 


 -- StealthMonger <StealthMonger at nym.mixmin.net>
    Long, random latency is part of the price of Internet anonymity.

   anonget: Is this anonymous browsing, or what?
   http://groups.google.ws/group/alt.privacy.anon-server/msg/073f34abb668df33?dmode=source&output=gplain

   stealthmail: Hide whether you're doing email, or when, or with whom.
   mailto:stealthsuite at nym.mixmin.net?subject=send%20index.html


Key: mailto:stealthsuite at nym.mixmin.net?subject=send%20stealthmonger-key

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <https://lists.cpunks.org/pipermail/cypherpunks/attachments/20130723/0c328a5e/attachment-0002.sig>


More information about the cypherpunks mailing list