Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

/dev/random is not secure

 
Post new topic   Reply to topic    Syllable Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
randombit



Joined: 09 Dec 2008
Posts: 1

PostPosted: Tue Dec 09, 2008 1:11 pm    Post subject: /dev/random is not secure Reply with quote

I noticed that the implementation of /dev/random in Syllable will only use a 32 bit seed at most, because the implementation of seed() will overwrite the entire state every time it is called. This means that the output of /dev/random depends only on whatever seed was last set plus the number of times the RNG has been stepped since it was seeded.

Also the use of a Mersenne twister as the PRNG may not be too great, since while it has good statistical properties it is not a cryptographically secure PRNG (seeing enough output of the PRNG allows one to guess all future outputs).

Based on source inspection of latest CVS. From the timestamps, it looks to have been this way since the /dev/random driver was introduced into the system.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 1466
Location: Friesland

PostPosted: Tue Dec 09, 2008 2:59 pm    Post subject: Reply with quote

Correct. Our build system recipe for the GNU Privacy Guard, for example, notes this.
Back to top
View user's profile Send private message Visit poster's website
Morph
The Knights of Syllable


Joined: 18 Oct 2007
Posts: 296
Location: Australia

PostPosted: Tue Dec 09, 2008 4:36 pm    Post subject: Reply with quote

Feel like writing a better driver?? Smile
Seriously, patches welcome!
Back to top
View user's profile Send private message Visit poster's website
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 830

PostPosted: Wed Dec 10, 2008 3:10 am    Post subject: Reply with quote

Yup. /dev/random is a "Good enough" PRNG implementation. It was never intended to be a cryptographically strong source of randomness.
Back to top
View user's profile Send private message Send e-mail
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 830

PostPosted: Mon May 25, 2009 5:23 pm    Post subject: Reply with quote

May as well bump this as we discussed some /dev/random issues while trying to get Monotone & Botan working.

1) The /dev/random read() method was throwing away 24 of the 32 bits of each call to rand() by doing a MOD 256 on each call.
2) We discussed the possibility of replacing Mersenne Twister with [url=http://www.schneier.com/yarrow.html]Yarrow[/url], which [i]is[/i] considered a cryptographically secure PRNG.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Bugs All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group