New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

subtle

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subtle

crypto.subtle for node.js

latest
npmnpm
Version
0.1.8
Version published
Weekly downloads
68
44.68%
Maintainers
1
Weekly downloads
 
Created
Source

Subtle

WebCrypto Polyfill for node/browsers

Why

You want to use crypto in Node and the browser. You want to use the same API in both places. If you're lucky enough to find a pure JS node module that can be browserified, you're off to a good start, but you heard that browsers have a webcrypto API now that's way faster than any javascript you could use. But it's supported in varying capacities by different browsers and it's entirely async, which means your API reuse dreams are now thoroughly crushed, and writing clean code to detect environment, features, and gracefully degrade is making you nauseous. This is why Subtle.

How

Subtle builds a wrapper over several node crypto modules, both pure-js and native, and wraps them in the webcrypto api. When browserified, the pure-js modules are included to fill out gaps between implimentations, but will only be used when webcrypto fails.

What

polyfill functionality is currently available for the following algorithms/operations ... all others will trigger the promise.catch() function (unless you're in a browser with that functionality).

RSASSA-PKCS1-v1_5 - generateKey, sign/verify, spki/pkcs8 import/export

RSA-OAEP - generateKey, encrypt/decrypt spki/pkcs8 import/export

AES-GCM - encrypt/decrypt, raw import/export

HMAC - sign/verify, raw import/export

ECDH - {p-256} - generateKey, deriveBits, import/export spki/raw

Keywords

crypto

FAQs

Package last updated on 09 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts