1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question About Wi-Fi Password Function

Discussion in 'Tomato Firmware' started by GreenThumb, Mar 20, 2009.

  1. GreenThumb

    GreenThumb Addicted to LI Member

    I was wondering what mechanism Tomato uses to generate the "random" wi-fi passwords? Is it /dev/urandom? Or what exactly?
  2. nvtweak

    nvtweak LI Guru Member

    It looks to be done with javascript.

    function random_x(max)
     var c = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
     var s = '';
     while (max-- > 0) s += c.substr(Math.floor(c.length * Math.random()), 1);
     return s;
  3. fyellin

    fyellin LI Guru Member

    . . . which is to say, it depends on your browser's JS implementation how random a value you actually get. Java's Math.random() is not cryptographically secure. I don't know as much about Javascript implementations.

    I've always preferred a reasonably long, but easy to remember, passphrase.

Share This Page