Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iron-webcrypto

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iron-webcrypto

a cryptographic utility for sealing-unsealing a JSON object using symmetric key encryption with message integrity verification

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1M
decreased by-15.54%
Maintainers
1
Weekly downloads
 
Created
Source

iron-webcrypto (beta) jsDocs.io

This module is a replacement for @hapi/iron, written using the Web Crypto API that makes it compatible with browser and edge environments.

Check out vvo/iron-session to see this module in use!


Installation

To use this module, run:

npm add iron-webcrypto
npm remove @hapi/iron

and update imports.

Then modify function calls to pass a Web Crypto implementation as the first param. For example:

Iron.seal(obj, password, Iron.defaults);

becomes:

Iron.seal(_crypto, obj, password, Iron.defaults);

where _crypto is your Web Crypto implementation. Generally this will available in your context (for example, globalThis.crypto in browsers/edge runtimes, globalThis.crypto.webcrypto in newer Node.js versions). However, you may also need to polyfill this (for older Node.js versions). We recommend using @peculiar/webcrypto for that.

Keywords

FAQs

Package last updated on 28 Aug 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc