564
edits
Line 5: | Line 5: | ||
=== Messaging === | === Messaging === | ||
* Natasha and Boris would like to message one another privately via a web application. The server is untrusted and all message data that Natasha sends to the server should be encrypted so only Boris can read it after downloading. A server compromise will net the server's attacker only blobs of useless data. This web application will use the Public Key API: '''window.cipher.pk.*''' | * Deuxdrop ( https://wiki.mozilla.org/Labs/Deuxdrop ), a project from Mozilla Labs would benefit from the DOMCrypt API. | ||
* Boot2Gecko apps will benefit greatly from the DOMCrypt API, as the only thing to consume is the DOM and all of the APIs we provide. | |||
** Example: Natasha and Boris would like to message one another privately via a web application. The server is untrusted and all message data that Natasha sends to the server should be encrypted so only Boris can read it after downloading. A server compromise will net the server's attacker only blobs of useless data. This web application will use the Public Key API: '''window.cipher.pk.*''' | |||
Example Code: | Example Code: | ||
Line 14: | Line 16: | ||
var plainText = "Hey, wanna grab a root beer with me after work?"; | var plainText = "Hey, wanna grab a root beer with me after work?"; | ||
window. | window.crypto.pk.encrypt(plainText, publicKey, function callback(aCipherMessage) { | ||
// Asynchronous crypto API - the plainText is encrypted and the CipherMessage object is returned to this callback function | // Asynchronous crypto API - the plainText is encrypted and the CipherMessage object is returned to this callback function | ||
// aCipherMessage is a JS object literal: | // aCipherMessage is a JS object literal: |
edits