privatebin-decrypt
v1.0.3
Published
a ts/js lib to decrypt content from privateBin
Downloads
29
Readme
privatebin-decrypt
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