A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

Crypto: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
No edit summary
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=Overview=
This proposal has been subsumed by the <code>window.crypto</code> API in the [http://www.w3.org/2012/webcrypto/WebCryptoAPI/ Web Cryptography API] being developed by the W3C Web Cryptography Working Group.
 
This document describes a proposal for the window.crypto API.
 
=Definitions=
 
==Cryptographically Random Values==
 
A ''cryptographically random value'' is a value generated from a cryptographically strong pseudo-random number generator when seeded with truly random values.  In practice, implementations generate cryptographically random values using well-established cryptographic pseudo-random number generators, such as RC4, seeded with high-quality entropy, such as from an operating-system entropy source (e.g., ''/dev/urandom'').  This document provides no lower-bound on the information theoretic entropy present in cryptographically random values, but implementations should make a best effort to provide as much entropy as practicable.
 
=Interface=
 
<pre>
[Suplemental, NoInterfaceObject]
interface Window {
  readonly attribute Crypto crypto;
};
 
[NoInterfaceObject]
interface Crypto {
  void getRandomValues(in ArrayBufferView array);
};
</pre>
 
=Methods=
 
==getRandomValues==
 
The ''getRandomValues'' method fills ''array'' with random data.  Specifically, if ''array'' is an [http://www.khronos.org/registry/typedarray/specs/latest/#6 ArrayBufferView] of an integer type (i.e., Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, or Uint32Array), then all the elements of ''array'' are overwritten with ''cryptographically random values''.  If ''array'' is not of an appropriate type, ''getRandomValues'' throws a [http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-type_mismatch_err TYPE_MISMATCH_ERR].  If no ''cryptographically random values'' are available, ''getRandomValues'' throws a [http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-not_supported_err NOT_SUPPORTED_ERR].

Latest revision as of 16:48, 21 August 2012

This proposal has been subsumed by the window.crypto API in the Web Cryptography API being developed by the W3C Web Cryptography Working Group.