summaryrefslogtreecommitdiff
path: root/frontend/beta
authorGiulio Cesare Solaroli <giulio.cesare@clipperz.com>2014-06-21 08:50:00 (UTC)
committer Giulio Cesare Solaroli <giulio.cesare@clipperz.com>2014-06-21 09:20:16 (UTC)
commit6dd16d9359e3a4dc306802588b09acd43947a606 (patch) (unidiff)
treef3ab7778e037e42cb47c810f9d435d40de5adf15 /frontend/beta
parenta6852c93138f3c4596fb4df8bce5b7d19ef50478 (diff)
downloadclipperz-6dd16d9359e3a4dc306802588b09acd43947a606.zip
clipperz-6dd16d9359e3a4dc306802588b09acd43947a606.tar.gz
clipperz-6dd16d9359e3a4dc306802588b09acd43947a606.tar.bz2
Inproved PRNG configuration
Diffstat (limited to 'frontend/beta') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/Crypto/PRNG.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/beta/js/Clipperz/Crypto/PRNG.js b/frontend/beta/js/Clipperz/Crypto/PRNG.js
index 92966d0..6fdeca4 100644
--- a/frontend/beta/js/Clipperz/Crypto/PRNG.js
+++ b/frontend/beta/js/Clipperz/Crypto/PRNG.js
@@ -127,387 +127,387 @@ Clipperz.Crypto.PRNG.RandomnessSource.prototype = MochiKit.Base.update(null, {
127 127
128 'setSourceId': function(aValue) { 128 'setSourceId': function(aValue) {
129 this._sourceId = aValue; 129 this._sourceId = aValue;
130 }, 130 },
131 131
132 //------------------------------------------------------------------------- 132 //-------------------------------------------------------------------------
133 133
134 'nextPoolIndex': function() { 134 'nextPoolIndex': function() {
135 return this._nextPoolIndex; 135 return this._nextPoolIndex;
136 }, 136 },
137 137
138 'incrementNextPoolIndex': function() { 138 'incrementNextPoolIndex': function() {
139 this._nextPoolIndex = ((this._nextPoolIndex + 1) % this.generator().numberOfEntropyAccumulators()); 139 this._nextPoolIndex = ((this._nextPoolIndex + 1) % this.generator().numberOfEntropyAccumulators());
140 }, 140 },
141 141
142 //------------------------------------------------------------------------- 142 //-------------------------------------------------------------------------
143 143
144 'updateGeneratorWithValue': function(aRandomValue) { 144 'updateGeneratorWithValue': function(aRandomValue) {
145 if (this.generator() != null) { 145 if (this.generator() != null) {
146 this.generator().addRandomByte(this.sourceId(), this.nextPoolIndex(), aRandomValue); 146 this.generator().addRandomByte(this.sourceId(), this.nextPoolIndex(), aRandomValue);
147 this.incrementNextPoolIndex(); 147 this.incrementNextPoolIndex();
148 } 148 }
149 }, 149 },
150 150
151 //------------------------------------------------------------------------- 151 //-------------------------------------------------------------------------
152 __syntaxFix__: "syntax fix" 152 __syntaxFix__: "syntax fix"
153}); 153});
154 154
155//############################################################################# 155//#############################################################################
156 156
157Clipperz.Crypto.PRNG.TimeRandomnessSource = function(args) { 157Clipperz.Crypto.PRNG.TimeRandomnessSource = function(args) {
158 args = args || {}; 158 args = args || {};
159 //MochiKit.Base.bindMethods(this); 159 //MochiKit.Base.bindMethods(this);
160 160
161 this._intervalTime = args.intervalTime || 1000; 161 this._intervalTime = args.intervalTime || 1000;
162 162
163 Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); 163 Clipperz.Crypto.PRNG.RandomnessSource.call(this, args);
164 164
165 this.collectEntropy(); 165 this.collectEntropy();
166 return this; 166 return this;
167} 167}
168 168
169Clipperz.Crypto.PRNG.TimeRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { 169Clipperz.Crypto.PRNG.TimeRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, {
170 170
171 'intervalTime': function() { 171 'intervalTime': function() {
172 return this._intervalTime; 172 return this._intervalTime;
173 }, 173 },
174 174
175 //------------------------------------------------------------------------- 175 //-------------------------------------------------------------------------
176 176
177 'collectEntropy': function() { 177 'collectEntropy': function() {
178 varnow; 178 varnow;
179 varentropyByte; 179 varentropyByte;
180 var intervalTime; 180 var intervalTime;
181 now = new Date(); 181 now = new Date();
182 entropyByte = (now.getTime() & 0xff); 182 entropyByte = (now.getTime() & 0xff);
183 183
184 intervalTime = this.intervalTime(); 184 intervalTime = this.intervalTime();
185 if (this.boostMode() == true) { 185 if (this.boostMode() == true) {
186 intervalTime = intervalTime / 9; 186 intervalTime = intervalTime / 9;
187 } 187 }
188 188
189 this.updateGeneratorWithValue(entropyByte); 189 this.updateGeneratorWithValue(entropyByte);
190 setTimeout(this.collectEntropy, intervalTime); 190 setTimeout(this.collectEntropy, intervalTime);
191 }, 191 },
192 192
193 //------------------------------------------------------------------------- 193 //-------------------------------------------------------------------------
194 194
195 'numberOfRandomBits': function() { 195 'numberOfRandomBits': function() {
196 return 5; 196 return 5;
197 }, 197 },
198 198
199 //------------------------------------------------------------------------- 199 //-------------------------------------------------------------------------
200 __syntaxFix__: "syntax fix" 200 __syntaxFix__: "syntax fix"
201}); 201});
202 202
203//***************************************************************************** 203//*****************************************************************************
204 204
205Clipperz.Crypto.PRNG.MouseRandomnessSource = function(args) { 205Clipperz.Crypto.PRNG.MouseRandomnessSource = function(args) {
206 args = args || {}; 206 args = args || {};
207 207
208 Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); 208 Clipperz.Crypto.PRNG.RandomnessSource.call(this, args);
209 209
210 this._numberOfBitsToCollectAtEachEvent = 4; 210 this._numberOfBitsToCollectAtEachEvent = 4;
211 this._randomBitsCollector = 0; 211 this._randomBitsCollector = 0;
212 this._numberOfRandomBitsCollected = 0; 212 this._numberOfRandomBitsCollected = 0;
213 213
214 MochiKit.Signal.connect(document, 'onmousemove', this, 'collectEntropy'); 214 MochiKit.Signal.connect(document, 'onmousemove', this, 'collectEntropy');
215 215
216 return this; 216 return this;
217} 217}
218 218
219Clipperz.Crypto.PRNG.MouseRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { 219Clipperz.Crypto.PRNG.MouseRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, {
220 220
221 //------------------------------------------------------------------------- 221 //-------------------------------------------------------------------------
222 222
223 'numberOfBitsToCollectAtEachEvent': function() { 223 'numberOfBitsToCollectAtEachEvent': function() {
224 return this._numberOfBitsToCollectAtEachEvent; 224 return this._numberOfBitsToCollectAtEachEvent;
225 }, 225 },
226 226
227 //------------------------------------------------------------------------- 227 //-------------------------------------------------------------------------
228 228
229 'randomBitsCollector': function() { 229 'randomBitsCollector': function() {
230 return this._randomBitsCollector; 230 return this._randomBitsCollector;
231 }, 231 },
232 232
233 'setRandomBitsCollector': function(aValue) { 233 'setRandomBitsCollector': function(aValue) {
234 this._randomBitsCollector = aValue; 234 this._randomBitsCollector = aValue;
235 }, 235 },
236 236
237 'appendRandomBitsToRandomBitsCollector': function(aValue) { 237 'appendRandomBitsToRandomBitsCollector': function(aValue) {
238 var collectedBits; 238 var collectedBits;
239 var numberOfRandomBitsCollected; 239 var numberOfRandomBitsCollected;
240 240
241 numberOfRandomBitsCollected = this.numberOfRandomBitsCollected(); 241 numberOfRandomBitsCollected = this.numberOfRandomBitsCollected();
242 collectedBits = this.randomBitsCollector() | (aValue << numberOfRandomBitsCollected); 242 collectedBits = this.randomBitsCollector() | (aValue << numberOfRandomBitsCollected);
243 this.setRandomBitsCollector(collectedBits); 243 this.setRandomBitsCollector(collectedBits);
244 numberOfRandomBitsCollected += this.numberOfBitsToCollectAtEachEvent(); 244 numberOfRandomBitsCollected += this.numberOfBitsToCollectAtEachEvent();
245 245
246 if (numberOfRandomBitsCollected == 8) { 246 if (numberOfRandomBitsCollected == 8) {
247 this.updateGeneratorWithValue(collectedBits); 247 this.updateGeneratorWithValue(collectedBits);
248 numberOfRandomBitsCollected = 0; 248 numberOfRandomBitsCollected = 0;
249 this.setRandomBitsCollector(0); 249 this.setRandomBitsCollector(0);
250 } 250 }
251 251
252 this.setNumberOfRandomBitsCollected(numberOfRandomBitsCollected) 252 this.setNumberOfRandomBitsCollected(numberOfRandomBitsCollected)
253 }, 253 },
254 254
255 //------------------------------------------------------------------------- 255 //-------------------------------------------------------------------------
256 256
257 'numberOfRandomBitsCollected': function() { 257 'numberOfRandomBitsCollected': function() {
258 return this._numberOfRandomBitsCollected; 258 return this._numberOfRandomBitsCollected;
259 }, 259 },
260 260
261 'setNumberOfRandomBitsCollected': function(aValue) { 261 'setNumberOfRandomBitsCollected': function(aValue) {
262 this._numberOfRandomBitsCollected = aValue; 262 this._numberOfRandomBitsCollected = aValue;
263 }, 263 },
264 264
265 //------------------------------------------------------------------------- 265 //-------------------------------------------------------------------------
266 266
267 'collectEntropy': function(anEvent) { 267 'collectEntropy': function(anEvent) {
268 var mouseLocation; 268 var mouseLocation;
269 var randomBit; 269 var randomBit;
270 var mask; 270 var mask;
271 271
272 mask = 0xffffffff >>> (32 - this.numberOfBitsToCollectAtEachEvent()); 272 mask = 0xffffffff >>> (32 - this.numberOfBitsToCollectAtEachEvent());
273 273
274 mouseLocation = anEvent.mouse().client; 274 mouseLocation = anEvent.mouse().client;
275 randomBit = ((mouseLocation.x ^ mouseLocation.y) & mask); 275 randomBit = ((mouseLocation.x ^ mouseLocation.y) & mask);
276 this.appendRandomBitsToRandomBitsCollector(randomBit) 276 this.appendRandomBitsToRandomBitsCollector(randomBit)
277 }, 277 },
278 278
279 //------------------------------------------------------------------------- 279 //-------------------------------------------------------------------------
280 280
281 'numberOfRandomBits': function() { 281 'numberOfRandomBits': function() {
282 return 1; 282 return 1;
283 }, 283 },
284 284
285 //------------------------------------------------------------------------- 285 //-------------------------------------------------------------------------
286 __syntaxFix__: "syntax fix" 286 __syntaxFix__: "syntax fix"
287}); 287});
288 288
289//***************************************************************************** 289//*****************************************************************************
290 290
291Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource = function(args) { 291Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource = function(args) {
292 args = args || {}; 292 args = args || {};
293 293
294 this._intervalTime = args.intervalTime || 1000; 294 this._intervalTime = args.intervalTime || 1000;
295 this._browserCrypto = args.browserCrypto; 295 this._browserCrypto = args.browserCrypto;
296 296
297 Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); 297 Clipperz.Crypto.PRNG.RandomnessSource.call(this, args);
298 298
299 this.collectEntropy(); 299 this.collectEntropy();
300 return this; 300 return this;
301} 301}
302 302
303Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { 303Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, {
304 304
305 'intervalTime': function() { 305 'intervalTime': function() {
306 return this._intervalTime; 306 return this._intervalTime;
307 }, 307 },
308 308
309 'browserCrypto': function () { 309 'browserCrypto': function () {
310 return this._browserCrypto; 310 return this._browserCrypto;
311 }, 311 },
312 312
313 //------------------------------------------------------------------------- 313 //-------------------------------------------------------------------------
314 314
315 'collectEntropy': function() { 315 'collectEntropy': function() {
316 varbytesToCollect; 316 varbytesToCollect;
317 317
318 if (this.boostMode() == true) { 318 if (this.boostMode() == true) {
319 bytesToCollect = 8; 319 bytesToCollect = 64;
320 } else { 320 } else {
321 bytesToCollect = 32; 321 bytesToCollect = 8;
322 } 322 }
323 323
324 var randomValuesArray = new Uint8Array(bytesToCollect); 324 var randomValuesArray = new Uint8Array(bytesToCollect);
325 this.browserCrypto().getRandomValues(randomValuesArray); 325 this.browserCrypto().getRandomValues(randomValuesArray);
326 for (var i = 0; i < randomValuesArray.length; i++) { 326 for (var i = 0; i < randomValuesArray.length; i++) {
327 this.updateGeneratorWithValue(randomValuesArray[i]); 327 this.updateGeneratorWithValue(randomValuesArray[i]);
328 } 328 }
329 329
330 setTimeout(this.collectEntropy, this.intervalTime()); 330 setTimeout(this.collectEntropy, this.intervalTime());
331 }, 331 },
332 332
333 //------------------------------------------------------------------------- 333 //-------------------------------------------------------------------------
334 __syntaxFix__: "syntax fix" 334 __syntaxFix__: "syntax fix"
335}); 335});
336 336
337//############################################################################# 337//#############################################################################
338 338
339Clipperz.Crypto.PRNG.Fortuna = function(args) { 339Clipperz.Crypto.PRNG.Fortuna = function(args) {
340 vari,c; 340 vari,c;
341 341
342 args = args || {}; 342 args = args || {};
343 343
344 this._key = args.seed || null; 344 this._key = args.seed || null;
345 if (this._key == null) { 345 if (this._key == null) {
346 this._counter = 0; 346 this._counter = 0;
347 this._key = new Clipperz.ByteArray(); 347 this._key = new Clipperz.ByteArray();
348 } else { 348 } else {
349 this._counter = 1; 349 this._counter = 1;
350 } 350 }
351 351
352 this._aesKey = null; 352 this._aesKey = null;
353 353
354 this._firstPoolReseedLevel = args.firstPoolReseedLevel || 32 || 64; 354 this._firstPoolReseedLevel = args.firstPoolReseedLevel || 32 || 64;
355 this._numberOfEntropyAccumulators = args.numberOfEntropyAccumulators || 32; 355 this._numberOfEntropyAccumulators = args.numberOfEntropyAccumulators || 32;
356 356
357 this._accumulators = []; 357 this._accumulators = [];
358 c = this.numberOfEntropyAccumulators(); 358 c = this.numberOfEntropyAccumulators();
359 for (i=0; i<c; i++) { 359 for (i=0; i<c; i++) {
360 this._accumulators.push(new Clipperz.Crypto.PRNG.EntropyAccumulator()); 360 this._accumulators.push(new Clipperz.Crypto.PRNG.EntropyAccumulator());
361 } 361 }
362 362
363 this._randomnessSources = []; 363 this._randomnessSources = [];
364 this._reseedCounter = 0; 364 this._reseedCounter = 0;
365 365
366 return this; 366 return this;
367} 367}
368 368
369Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, { 369Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, {
370 370
371 'toString': function() { 371 'toString': function() {
372 return "Clipperz.Crypto.PRNG.Fortuna"; 372 return "Clipperz.Crypto.PRNG.Fortuna";
373 }, 373 },
374 374
375 //------------------------------------------------------------------------- 375 //-------------------------------------------------------------------------
376 376
377 'key': function() { 377 'key': function() {
378 return this._key; 378 return this._key;
379 }, 379 },
380 380
381 'setKey': function(aValue) { 381 'setKey': function(aValue) {
382 this._key = aValue; 382 this._key = aValue;
383 this._aesKey = null; 383 this._aesKey = null;
384 }, 384 },
385 385
386 'aesKey': function() { 386 'aesKey': function() {
387 if (this._aesKey == null) { 387 if (this._aesKey == null) {
388 this._aesKey = new Clipperz.Crypto.AES.Key({key:this.key()}); 388 this._aesKey = new Clipperz.Crypto.AES.Key({key:this.key()});
389 } 389 }
390 390
391 return this._aesKey; 391 return this._aesKey;
392 }, 392 },
393 393
394 'accumulators': function() { 394 'accumulators': function() {
395 return this._accumulators; 395 return this._accumulators;
396 }, 396 },
397 397
398 'firstPoolReseedLevel': function() { 398 'firstPoolReseedLevel': function() {
399 return this._firstPoolReseedLevel; 399 return this._firstPoolReseedLevel;
400 }, 400 },
401 401
402 //------------------------------------------------------------------------- 402 //-------------------------------------------------------------------------
403 403
404 'reseedCounter': function() { 404 'reseedCounter': function() {
405 return this._reseedCounter; 405 return this._reseedCounter;
406 }, 406 },
407 407
408 'incrementReseedCounter': function() { 408 'incrementReseedCounter': function() {
409 this._reseedCounter = this._reseedCounter +1; 409 this._reseedCounter = this._reseedCounter +1;
410 }, 410 },
411 411
412 //------------------------------------------------------------------------- 412 //-------------------------------------------------------------------------
413 413
414 'reseed': function() { 414 'reseed': function() {
415 varnewKeySeed; 415 varnewKeySeed;
416 var reseedCounter; 416 var reseedCounter;
417 varreseedCounterMask; 417 varreseedCounterMask;
418 var i, c; 418 var i, c;
419 419
420 newKeySeed = this.key(); 420 newKeySeed = this.key();
421 this.incrementReseedCounter(); 421 this.incrementReseedCounter();
422 reseedCounter = this.reseedCounter(); 422 reseedCounter = this.reseedCounter();
423 423
424 c = this.numberOfEntropyAccumulators(); 424 c = this.numberOfEntropyAccumulators();
425 reseedCounterMask = 0xffffffff >>> (32 - c); 425 reseedCounterMask = 0xffffffff >>> (32 - c);
426 for (i=0; i<c; i++) { 426 for (i=0; i<c; i++) {
427 if ((i == 0) || ((reseedCounter & (reseedCounterMask >>> (c - i))) == 0)) { 427 if ((i == 0) || ((reseedCounter & (reseedCounterMask >>> (c - i))) == 0)) {
428 newKeySeed.appendBlock(this.accumulators()[i].stack()); 428 newKeySeed.appendBlock(this.accumulators()[i].stack());
429 this.accumulators()[i].resetStack(); 429 this.accumulators()[i].resetStack();
430 } 430 }
431 } 431 }
432 432
433 if (reseedCounter == 1) { 433 if (reseedCounter == 1) {
434 c = this.randomnessSources().length; 434 c = this.randomnessSources().length;
435 for (i=0; i<c; i++) { 435 for (i=0; i<c; i++) {
436 this.randomnessSources()[i].setBoostMode(false); 436 this.randomnessSources()[i].setBoostMode(false);
437 } 437 }
438 } 438 }
439 439
440 this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed)); 440 this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed));
441 if (reseedCounter == 1) { 441 if (reseedCounter == 1) {
442MochiKit.Logging.logDebug("### PRNG.readyToGenerateRandomBytes"); 442MochiKit.Logging.logDebug("### PRNG.readyToGenerateRandomBytes");
443 MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes'); 443 MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes');
444 } 444 }
445 MochiKit.Signal.signal(this, 'reseeded'); 445 MochiKit.Signal.signal(this, 'reseeded');
446 }, 446 },
447 447
448 //------------------------------------------------------------------------- 448 //-------------------------------------------------------------------------
449 449
450 'isReadyToGenerateRandomValues': function() { 450 'isReadyToGenerateRandomValues': function() {
451 return this.reseedCounter() != 0; 451 return this.reseedCounter() != 0;
452 }, 452 },
453 453
454 //------------------------------------------------------------------------- 454 //-------------------------------------------------------------------------
455 455
456 'entropyLevel': function() { 456 'entropyLevel': function() {
457 return this.accumulators()[0].stack().length() + (this.reseedCounter() * this.firstPoolReseedLevel()); 457 return this.accumulators()[0].stack().length() + (this.reseedCounter() * this.firstPoolReseedLevel());
458 }, 458 },
459 459
460 //------------------------------------------------------------------------- 460 //-------------------------------------------------------------------------
461 461
462 'counter': function() { 462 'counter': function() {
463 return this._counter; 463 return this._counter;
464 }, 464 },
465 465
466 'incrementCounter': function() { 466 'incrementCounter': function() {
467 this._counter += 1; 467 this._counter += 1;
468 }, 468 },
469 469
470 'counterBlock': function() { 470 'counterBlock': function() {
471 var result; 471 var result;
472 472
473 result = new Clipperz.ByteArray().appendWords(this.counter(), 0, 0, 0); 473 result = new Clipperz.ByteArray().appendWords(this.counter(), 0, 0, 0);
474 474
475 return result; 475 return result;
476 }, 476 },
477 477
478 //------------------------------------------------------------------------- 478 //-------------------------------------------------------------------------
479 479
480 'getRandomBlock': function() { 480 'getRandomBlock': function() {
481 var result; 481 var result;
482 482
483 result = new Clipperz.ByteArray(Clipperz.Crypto.AES.encryptBlock(this.aesKey(), this.counterBlock().arrayValues())); 483 result = new Clipperz.ByteArray(Clipperz.Crypto.AES.encryptBlock(this.aesKey(), this.counterBlock().arrayValues()));
484 this.incrementCounter(); 484 this.incrementCounter();
485 485
486 return result; 486 return result;
487 }, 487 },
488 488
489 //------------------------------------------------------------------------- 489 //-------------------------------------------------------------------------
490 490
491 'getRandomBytes': function(aSize) { 491 'getRandomBytes': function(aSize) {
492 var result; 492 var result;
493 493
494 if (this.isReadyToGenerateRandomValues()) { 494 if (this.isReadyToGenerateRandomValues()) {
495 var i,c; 495 var i,c;
496 var newKey; 496 var newKey;
497 497
498 result = new Clipperz.ByteArray(); 498 result = new Clipperz.ByteArray();
499 499
500 c = Math.ceil(aSize / (128 / 8)); 500 c = Math.ceil(aSize / (128 / 8));
501 for (i=0; i<c; i++) { 501 for (i=0; i<c; i++) {
502 result.appendBlock(this.getRandomBlock()); 502 result.appendBlock(this.getRandomBlock());
503 } 503 }
504 504
505 if (result.length() != aSize) { 505 if (result.length() != aSize) {
506 result = result.split(0, aSize); 506 result = result.split(0, aSize);
507 } 507 }
508 508
509 newKey = this.getRandomBlock().appendBlock(this.getRandomBlock()); 509 newKey = this.getRandomBlock().appendBlock(this.getRandomBlock());
510 this.setKey(newKey); 510 this.setKey(newKey);
511 } else { 511 } else {
512MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!"); 512MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
513 throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy; 513 throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy;