New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rgwch/simple-crypt

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rgwch/simple-crypt

a simple Typescript wrapper around encryption of Node Buffers and Streams

  • 1.2.1
  • latest
  • npm
  • Socket score

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

Simple-Crypt.ts

A simple typescript-wrapper around encrypting Node-Buffers and Streams. To make automated brute-force attacks (slightly) more difficult, it adds a simple pre-encrypt transform step.

Installation

npm i --save @rgwch/simple-crypt

Usage

With Streams:

import {Crypter} from '@rgwch/simple-crypt'
const crypter=new Crypter("super safe passphrase","program specific salt")
const instream=someDataFromSomewhere()
const outstream="sendDateThere()

crypter.encrypt(instream,outstream).then(()=>{
  console.log("success")
}.catch(err=>{
  console.log("Something went wrong: "+err)
})

crypter.decrypt(encryptedStream,outstream).then(()=>{
  console.log("success")
}).catch(err=>{
  console.log("something went wrong: "+err)
})

With Buffers:

import {Crypter} from '@rgwch/simple-crypt'
const crypter=new Crypter("super safe passphrase","program specific salt")
const input=Buffer.from("A Buffer with some data")
const encrypted=await crypter.encryptBuffer(input)

const output=await crypter.decryptBuffer(encrypted)
console.log(output.toString())  // A Buffer with some data


Test

npm test

License

BSD

Keywords

FAQs

Package last updated on 22 Dec 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