privatebin-decrypt
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

privatebin-decrypt

npm version npm downloads bundle JSDocs License

A simple library to decrypt PrivateBin pastes for nodejs

Install

npm install privatebin-decrypt

Usage

import { decryptPrivateBin } from 'privatebin-decrypt'

// https://paste.to/?2f1ecdd195e92055#3evZwExja1XBjXY6gCPkpmodFy6LKNLre75VHCY9sz5f
const data = await (await fetch('https://paste.to/?2f1ecdd195e92055', {
  headers: {
    Accept: 'application/json, text/javascript, */*; q=0.01',
  },
})).json() as {
  ct: string
  adata: (string | number | (string | number)[])[]
}

const key = '3evZwExja1XBjXY6gCPkpmodFy6LKNLre75VHCY9sz5f'
const decrypted = await decryptPrivateBin({
  key,
  data: data.adata,
  cipherMessage: data.ct,
})

console.log(decrypted)
// Hello PrivateBin

License

MIT License © 2023-PRESENT Elias Blume

Package Sidebar

Install

npm i privatebin-decrypt

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

15.4 kB

Total Files

8

Last publish

Collaborators

  • eliasblume