npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webcrypto-shim

v0.1.7

Published

Web Cryptography API shim for legacy browsers

Downloads

2,074,286

Readme

webcrypto-shim.js

Web Cryptography API shim for legacy browsers.

Quick start with Bower

Install the package

$ bower install webcrypto-shim

and link scripts into your html code

<script src="bower_components/promiz/promiz.js"></script>
<script src="bower_components/webcrypto-shim/webcrypto-shim.js"></script>

Now you can use webcrypto api through the window.crypto and window.crypto.subtle objects.

Note that IE11 lacks support of Promise-s and requires promiz.js to work properly. You can replace promiz.js with any Promise/A+-compatible implementation.

Supported browsers

The library is targeted to fix these browsers having prefixed and buggy webcrypto api implementations:

  • Internet Explorer 11, Mobile Internet Explorer 11,
  • Safari 8 - 10, iOS Safari 8 - 10.

These browsers have unprefixed and conforming webcrypto api implementations, so no need in shim:

  • Chrome 43+, Chrome for Android 44+,
  • Opera 24+,
  • Firefox 34+,
  • Edge 12+.
  • Safari 11+.

Crossbrowser support of algorithms & operations

  • SHA-256, SHA-384: digest

  • HMAC: sign, verify, generateKey, importKey, exportKey

    • with hash SHA-1, SHA-256, SHA-384
  • AES-CBC: encrypt, decrypt, generateKey, importKey, exportKey, wrapKey, unwrapKey

    • TODO tests
  • AES-KW: generateKey, importKey, exportKey, wrapKey, unwrapKey

    • TODO tests
  • RSASSA-PKCS1-v1_5: sign, verify, generateKey, importKey, exportKey

    • with hash SHA-256, SHA-384
    • and modulusLength at least 2048 bits
  • RSA-OAEP: encrypt, decrypt, generateKey, importKey, exportKey, wrapKey, unwrapKey

    • with hash SHA-1
    • and modulusLength at least 2048 bits
    • FIXME only "jwk" format for wrapped/unwrapped keys

Known limitations

deriveKey, deriveBits are not supported under IE11 and Safari since there is no implementation of any algorithm providing key derivation.

Under IE11 exception is thrown in case of empty input data since IE11 silently discards empty data and leaves returned Promise object never resolved nor rejected.

Other browsers support

See https://vibornoff.github.io/webcrypto-examples/index.html

Sponsored by

BrowserStack — automated & manual crossbrowser testing solution.