Difference between revisions of "Random fork-safety"

From OpenSSLWiki
Jump to navigationJump to search
(more links)
m (oops, that typo changes the meaning significantly)
Line 1: Line 1:
One of the most important issues in the proper cryptographic use of random numbers is that random numbers must not be used.  Since the UNIX fork() system call duplicates the entire process state, a random number generator which does not take this issue into account will produce the same sequence of random numbers in both the parent and the child (or in multiple children), leading to cryptographic disaster.  (i. e. people being able to read your communications)
+
One of the most important issues in the proper cryptographic use of random numbers is that random numbers must not be reused.  Since the UNIX fork() system call duplicates the entire process state, a random number generator which does not take this issue into account will produce the same sequence of random numbers in both the parent and the child (or in multiple children), leading to cryptographic disaster.  (i. e. people being able to read your communications)
  
 
OpenSSL's default random number generator mixes in the PID, which provides a certain degree of fork safety.  However, once the PIDs wrap, new children will start to produce the same random sequence as previous children which had the same PID.  This is unlikely to happen in most common cases, but it is not impossible, which makes the issue even more insidious.
 
OpenSSL's default random number generator mixes in the PID, which provides a certain degree of fork safety.  However, once the PIDs wrap, new children will start to produce the same random sequence as previous children which had the same PID.  This is unlikely to happen in most common cases, but it is not impossible, which makes the issue even more insidious.

Revision as of 00:52, 3 October 2013

One of the most important issues in the proper cryptographic use of random numbers is that random numbers must not be reused. Since the UNIX fork() system call duplicates the entire process state, a random number generator which does not take this issue into account will produce the same sequence of random numbers in both the parent and the child (or in multiple children), leading to cryptographic disaster. (i. e. people being able to read your communications)

OpenSSL's default random number generator mixes in the PID, which provides a certain degree of fork safety. However, once the PIDs wrap, new children will start to produce the same random sequence as previous children which had the same PID. This is unlikely to happen in most common cases, but it is not impossible, which makes the issue even more insidious.

The most comprehensive explanation of this problem is probably this blog post:

However, since this issue has been "rediscovered" and discussed multiple times, here are some additional links (some are also linked from the above article)