Is that safe to use ramdom.random() for key to encrypt?

Chris Angelico rosuav at gmail.com
Sat Jun 16 22:31:04 EDT 2012


On Sun, Jun 17, 2012 at 12:15 PM, Yesterday Paid
<howmuchistoday at gmail.com> wrote:
> I'm making cipher program with random.seed(), random.random() as the
> key table of encryption.
> I'm not good at security things and don't know much about the
> algorithm used by random module.

For security, you don't want any algorithm, you want something like
/dev/random (on Unix-like platforms).

I'm pretty sure Python includes crypto facilities. Unless it (most
oddly) lacks these batteries, I would recommend using one of them
instead.

ChrisA



More information about the Python-list mailing list