Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
webcrypto-shim
Advanced tools
Readme
Web Cryptography API shim for legacy browsers.
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.
The library is targeted to fix these browsers having prefixed and buggy webcrypto api implementations:
These browsers have unprefixed and conforming webcrypto api implementations, so no need in shim:
SHA-256, SHA-384: digest
HMAC: sign
, verify
, generateKey
, importKey
, exportKey
AES-CBC: encrypt
, decrypt
, generateKey
, importKey
, exportKey
, wrapKey
, unwrapKey
AES-KW: generateKey
, importKey
, exportKey
, wrapKey
, unwrapKey
RSASSA-PKCS1-v1_5: sign
, verify
, generateKey
, importKey
, exportKey
RSA-OAEP: encrypt
, decrypt
, generateKey
, importKey
, exportKey
, wrapKey
, unwrapKey
"jwk"
format for wrapped/unwrapped keysderiveKey
, 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.
See https://vibornoff.github.io/webcrypto-examples/index.html
BrowserStack — automated & manual crossbrowser testing solution.
FAQs
Web Cryptography API shim for legacy browsers
The npm package webcrypto-shim receives a total of 476,516 weekly downloads. As such, webcrypto-shim popularity was classified as popular.
We found that webcrypto-shim demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.