3 ms·
You still generally use a RNG/PRNG to generate a symmetric key for each file you encrypt, use that key to encrypt the data using a symmetric algorithm like AES,
by rdl 14y ago
You still generally use a RNG/PRNG to generate a symmetric key for each file you encrypt, use that key to encrypt the data using a symmetric algorithm like AES, and then encrypt that symmetric key under the public key using asymmetric algorithms like RSA.
(There are several reasons; symmetric crypto is faster, and there are attacks on asymmetric algorithms based on the plaintext encrypted. Using random key data as the plaintext for the asymmetric algorithm prevents those attacks.)
So, even for asymmetric cryptography, a good source of randomness in the browser is an essential part of good crypto. Exposing a randomness source is probably the easiest thing for the browsers to solve -- key management/key storage, code integrity, the DOM, etc. are the more fundamental issues.)
- jtdowney 14y agoJohn from Braintree here. In the case of our client-side encryption library we use sjcl (http://crypto.stanford.edu/sjcl/ http://crypto.stanford.edu/sjcl/) to generate the symmetric keys for encryption. This library uses Ferguson and Schneier's Fortuna PRNG to generate random values. The main entropy source is crypto.getRandomValues (https://developer.mozilla.org/en-US/docs/DOM/window.crypto.getRandomValues https://developer.mozilla.org/en-US/docs/DOM/window.crypto.g...) where it is available. In other places it uses mouse movements to provide entropy for the PRNG.
- rdl 14y agoWhat do you do on touchscreen tablets running on non-firefox, non-webkit browsers (which don't have the RNG exported)? The only devices I could think of which meet that description are RIM Playbook and maybe Windows Phone, or maybe IE on horrible devices which have touchscreens.
- abrowne 14y agoThe Playbook browser is a webkit variant.