Use the PRNG class for chaff

In particular, srand( time( NULL ) ) is very predictable.

[keithw@mit.edu -- modified to use byte PRNG from /dev/urandom]
This commit is contained in:
Keegan McAllister
2012-03-19 01:22:54 -04:00
parent 40d69da5e6
commit 4eb3cace0b
2 changed files with 9 additions and 8 deletions
+4 -1
View File
@@ -27,6 +27,7 @@
#include "transportinstruction.pb.h"
#include "transportstate.h"
#include "transportfragment.h"
#include "prng.h"
using std::list;
using std::pair;
@@ -86,7 +87,9 @@ namespace Network {
uint64_t last_heard; /* last time received new state */
static const string make_chaff( void );
/* chaff to disguise instruction length */
PRNG prng;
const string make_chaff( void );
public:
/* constructor */