[Webkit-unassigned] [Bug 22049] New: WebKit should have a cryptographic RNG

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 3 11:31:23 PST 2008


https://bugs.webkit.org/show_bug.cgi?id=22049

           Summary: WebKit should have a cryptographic RNG
           Product: WebKit
           Version: 525.x (Safari 3.1)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Enhancement
          Priority: P4
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: webkit at shiftleft.org


Several Javascript cryptographic toolkits have emerged on the web, most notably
Clipperz.  Unfortunately, most forms of encryption require high-quality random
numbers to work securely, and collecting entropy from Javascript is difficult
and brittle.  Therefore, Safari should have a cryptographic random number
generator (RNG).  I propose that it be called window.crypto.random, since this
is where Mozilla claims the Firefox RNG will be when they implement it.

WebKit doesn't link any cryptographic libraries that I know of, so the
underlying RNG should probably be arc4random() (perhaps repeated a few times
because RC4 is fast but has known flaws) on BSD-like platforms and rand_s() on
Windows.  Linux is somewhat trickier because it doesn't have a cryptographic
RNG in libc.

WebKit for Windows already has Math.random() implemented by rand_s().  That's
well and good, but it should still implement window.crypto.random(), because we
don't want developers to rely on cryptographic properties of Math.random().

This is related to Mozilla bug 440046:
https://bugzilla.mozilla.org/show_bug.cgi?id=440046

Cheers,
Mike


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list