|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Cryptographically secure random file generator
Does anyone know of a cryptographically secure random file generator?
Not a random number generator, mind you, a random file generator -- which is, granted, basically just a random number generator that loops a lot and sends the output to a file rather than the screen. But it's critical that the "random" values generated be cryptographically strong, meaning that it should be impossible to asertain the input that was used to generate the random data AND it should be as physically impossible as possible to reconstruct the exact conditions of input that were used to generate the random data. (It's easy to simply use rand() % 256, but, given the source code, it's potentially too easy [for a professional] to reconstruct the exact input condiions that were used to seed rand().) Does anyone know of such a program that will do that? Specifically, it'd be nice if it were F/OSS, so I can also study it (when I get the spare time).
__________________
- "Cryptographically secure linear feedback shift register based stream ciphers" -- a phrase that'll get any party started. - Why know the ordinary when you can understand the extraordinary? - Sponsor my caffeine addiction! (36.70 USD recieved so far -- Latest donor: Mark Foxvog) |
|
#2
|
||||
|
||||
|
The code isn't exactly "easy reading," but you may want to take a look at drivers/char/random.c in the Linux kernel source code (or the similar source file(s) in a *BSD system). That's what provides the entropy-driven random byte sequence character device. According to the comments in the source code, this method is cryptographically strong.
Hope that helps.
__________________
~~ Peter ~~ ( My Blog: It's exactly like normal nerdiness, but completely different. ) :: ( Supporter of the EFF & FSF ) :: ( I'm a GNU/Linux addict and Free Software Advocate. ) :: ( How to Ask Questions the Smart Way ) :: ( The Fedora Project, sponsored by Red Hat ) :: ( GNOME: The Free Software Desktop Project ) :: ( GnuPG Public Key ) |
|
#3
|
|||
|
|||
|
well in linux you could possible us python2.4 which includes a cryptographicly secure random number generator with this simple code you could put as meny bytes as you would like into a file
Code:
#!/usr/bin/python
import os
f = open("/url/to/file", "w")
#replace 55 below with number of random bytes
randData = os.urandom(55)
f.write(randData)
f.close()
this uses linuxes urandom function which is cryptographicly secure. Also just to note you must have python 2.4 and up for this to work. I can write a java one that will work if python 2.4 isn't an option. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Security and Cryptography > Cryptographically secure random file generator |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|