Icontem

File: libs/js/pidCrypt/javascripts/compressed/rng_c.js

Recommend this page to a friend!
  Classes of Jason Gerfen  >  jQuery.pidCrypt  >  libs/js/pidCrypt/javascripts/compressed/rng_c.js  >  Download  
File: libs/js/pidCrypt/javascripts/compressed/rng_c.js
Role: Application script
Content type: text/plain
Description: Application script
Class: jQuery.pidCrypt
Encrypt form values using RSA and AES
Author: By
Last change:
Date: 5 years ago
Size: 1,198 bytes
 

Contents

Class file image Download
function SecureRandom(){this.rng_state;this.rng_pool;this.rng_pptr;this.rng_seed_int=function(c){this.rng_pool[this.rng_pptr++]^=c&255;this.rng_pool[this.rng_pptr++]^=(c>>8)&255;this.rng_pool[this.rng_pptr++]^=(c>>16)&255;this.rng_pool[this.rng_pptr++]^=(c>>24)&255;if(this.rng_pptr>=rng_psize){this.rng_pptr-=rng_psize}};this.rng_seed_time=function(){this.rng_seed_int(new Date().getTime())};if(this.rng_pool==null){this.rng_pool=new Array();this.rng_pptr=0;var a;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var b=window.crypto.random(32);for(a=0;a<b.length;++a){this.rng_pool[this.rng_pptr++]=b.charCodeAt(a)&255}}while(this.rng_pptr<rng_psize){a=Math.floor(65536*Math.random());this.rng_pool[this.rng_pptr++]=a>>>8;this.rng_pool[this.rng_pptr++]=a&255}this.rng_pptr=0;this.rng_seed_time()}this.rng_get_byte=function(){if(this.rng_state==null){this.rng_seed_time();this.rng_state=prng_newstate();this.rng_state.init(this.rng_pool);for(this.rng_pptr=0;this.rng_pptr<this.rng_pool.length;++this.rng_pptr){this.rng_pool[this.rng_pptr]=0}this.rng_pptr=0}return this.rng_state.next()};this.nextBytes=function(d){var c;for(c=0;c<d.length;++c){d[c]=this.rng_get_byte()}}};