Post to 0bin services

Latest on Hackage:1.5.2

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

MIT licensed by Igor Pashev
Maintained by Igor Pashev


This is a library and a command-line utility to share secrets via “zerobin” sites like using client-side encryption with SJCL.

This library reimplements encryption part of SJCL allowing you to post secrets from Haskell programs and shell scripts.


ZeroBin is written in Haskell with GHC. All required Haskell libraries are listed in zerobin.cabal. Use cabal-install to fetch and build all pre-requisites automatically.

Command-line utility

The command-line utility zerobin encrypts text or file, post the encrypted data to and prints URI to be shared or error message:

$ zerobin 'heinrich hertz'

Type zerobin --help to see usage summary:

  zerobin [options] TEXT

  -b, --bin=BIN   0bin service [default:]
  -f, --file      Paste the content of file TEXT ("-" for stdin)
  -e, --expire=E  Set expiration of paste: once, day, week, month [default: day]

  -h, --help      Show this message

  zerobin hello                      paste "hello" for a day
  zerobin -f /etc/fstab              paste file /etc/fstab for a day
  cat /etc/fstab | zerobin -f -      likewise
  zerobin -e once hello              paste "hello", it will burn after reading
  zerobin -b hello   paste to


There is a simple test program in the ./nodejs directory. It uses this library to encrypt a message and original SJCL running by Node.js to decrypt:

$ cabal install -f nodejs --dependencies-only
$ cabal install -f nodejs --ghc-option="-Werror"
$ # get nodejs and npm, e. g. on Debian: sudo apt-get install nodejs npm
$ npm install sjcl
$ ./dist/build/zerobin-nodejs/zerobin-nodejs
heinrich hertz


  1. 0bin supports images, zerobin can encrypt anything, but only plain text will be decrypted.
  2. “Burn after reading” (-e once) might mean “burn after two readings”, because we do not redirect like browser does. You can verify your paste before sharing the link ;-)
  3. does not support -e week



  • Fixed CryptoError_KeySizeInvalid in Web.ZeroBin.SJCL.encode by using Crypto.Cipher.AES.AES128 instead of Crypto.Cipher.AES.AES256


  • Added ChangeLog
  • zerobin command supports reading stdin: zerobin -f /etc/fstab can be done as cat /etc/fstab | zerobin -f - or zerobin -f < /etc/fstab
comments powered byDisqus