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

crypticstorage

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypticstorage

Browser & Server compatible encrypted storage

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

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

Cryptic Storage

Browser & Server compatible encrypted storage

Cryptic is a thin wrapper around Web Crypto and sets sane defaults to allow quickly implementing encryption in your application.

Getting Started

Install crypticstorage via NPM

npm install crypticstorage

Example

// Simple example

// import '../node_modules/crypticstorage/cryptic.js';
import { Cryptic } from 'crypticstorage';

const salt = Cryptic.bufferToHex(Cryptic.randomBytes(32))
const iv = Cryptic.bufferToHex(Cryptic.randomBytes(16))

const cryptic = Cryptic.create(
  decryptPass,
  salt,
)

let encryptedText = await cryptic.encrypt(
  'text to encrypt',
  iv,
);

console.log('Encrypted Text', encryptedText)

let decryptedText = await cryptic.decrypt(
  encryptedText,
  iv,
);

console.log('Decrypted Text', decryptedText)

Breaking Changes

Deprecation warning: Cryptic.encryptString renamed to Cryptic.create

Breaking Change: Cryptic.encryptString now expects salt in HEX format instead of a string. If stored as plain string, convert with the example below.

const cryptic = Cryptic.create(
  encryptPass,
  Cryptic.bufferToHex(
    Cryptic.stringToBuffer(salt)
  )
)

Keywords

FAQs

Package last updated on 21 Jan 2024

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