[Ndn-lib] NDN-JS support for crypto.subtle

Thompson, Jeff jefft0 at remap.UCLA.EDU
Mon Feb 2 15:27:16 PST 2015

We need to design the API across all the Common Client Libraries. The NDN Retreat this week will focus on security and I expect it to clarify the needs for encryption from various applications. The plan is the finalize the API for encryption shortly after the retreat and to update the libraries, including NDN-JS.

- Jeff T

From: Wentao Shang <wentaoshang at gmail.com<mailto:wentaoshang at gmail.com>>
Date: Monday, February 2, 2015 at 15:23
To: Jeff Thompson <jefft0 at remap.ucla.edu<mailto:jefft0 at remap.ucla.edu>>, NDN Lib <ndn-lib at lists.cs.ucla.edu<mailto:ndn-lib at lists.cs.ucla.edu>>
Subject: Re: [Ndn-lib] NDN-JS support for crypto.subtle

Great work! This is very exciting. Any plan for adding encryption support?


On Mon Feb 02 2015 at 2:37:43 PM Thompson, Jeff <jefft0 at remap.ucla.edu<mailto:jefft0 at remap.ucla.edu>> wrote:
Hello all,

NDN-JS now has preliminary support for crypto.subtle (the WebCrypto API). Crypto.subtle is an API so that JavaScript code in browsers can use fast native crypto. If NDN-JS detects that the browser has crypto.subtle, then it will use it. Otherwise it falls back to the (slow) pure JavaScript code. We have tested it in Chrome and Firefox. The speed up is substantial, increasing from 22 signatures per second to 1000 per second with crypto.subtle.

Currently there is support for signing and verifying. Crypto.subtle is asynchronous and returns its results in a callback. This was OK for verify because the NDN-JS call already uses callbacks for onVerified and onVerifyFailed. But for signing, we needed to add an optional callback to KeyChain.sign.  See the doc comment for the onComplete callback:

Many thanks to Ryan Bennett for submitting the code to support crypto.subtle.

- Jeff T
Ndn-lib mailing list
Ndn-lib at lists.cs.ucla.edu<mailto:Ndn-lib at lists.cs.ucla.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-lib/attachments/20150202/59cb4c16/attachment.html>

More information about the Ndn-lib mailing list