3 ms·
Essentially, that's a call to Math.random() 16 times that picks from a pool of 62 characters each time, allowing for 62^16 possible combinations, or 4.7 * 10^28
by STRML 14y ago
Essentially, that's a call to Math.random() 16 times that picks from a pool of 62 characters each time, allowing for 62^16 possible combinations, or 4.7 * 10^28 possibilities.
You've made me aware that this could possibly make brute forcing easier, as it is nearly equivalent to a 96-bit key length.
While even a brute-forcing 96-bit key would theoretically take about 230 million years on today's top-of-the-line hardware and therefore is not (currently) insecure, it does not make sense to introduce that weak point. Therefore, I've updated the current random passwords to be 24 characters in length from now on, which pushes it far above 2^128.
https://github.com/STRML/securesha.re-client/commit/d5228650226e38f234a352fde7ff54a2cfa1f400 https://github.com/STRML/securesha.re-client/commit/d5228650...
- nwh 14y agoNone of the random() functions in most JavaScript engines are cryptographically secure. There's proposed RNG that are, but only in Webkit.
- STRML 14y agoThat's a good point. I will switch the random number generation to SJCL, which uses mouse movement to seed the generator & hashes the aggregate.