Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vibornoff/webcrypto-shim
Web Cryptography API shim for legacy browsers
https://github.com/vibornoff/webcrypto-shim
Last synced: 2 months ago
JSON representation
Web Cryptography API shim for legacy browsers
- Host: GitHub
- URL: https://github.com/vibornoff/webcrypto-shim
- Owner: vibornoff
- License: mit
- Archived: true
- Created: 2015-08-08T01:14:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-03-23T08:44:58.000Z (almost 4 years ago)
- Last Synced: 2024-11-03T17:04:17.042Z (3 months ago)
- Language: JavaScript
- Homepage: https://vibornoff.github.io/webcrypto-shim/
- Size: 340 KB
- Stars: 121
- Watchers: 15
- Forks: 38
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ponyfills - webcrypto-shim - [`crypto`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) (Browser Features)
README
webcrypto-shim.js
=================[Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI/) shim for legacy browsers.
Quick start with _Bower_
------------------------Install the package
```sh
$ bower install webcrypto-shim
```and link scripts into your html code
```html
```
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 keysKnown 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](https://browserstack.com) — automated & manual crossbrowser testing solution.