1.0.3 • Published 6 months ago

privatebin-decrypt v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago