MyNixOS website logo
Description

Post to 0bin services.

Post encrypted content to 0bin sites like http://0bin.net or https://paste.ec

About

This is a library and a command-line utility to share secrets via "zerobin" sites like https://paste.ec using client-side encryption with SJCL.

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

Requirements

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 https://paste.ec and prints URI to be shared or error message:

$ zerobin 'heinrich hertz'
https://paste.ec/paste/1j3GBy-7#dg0PXHFglISOhXzRnU4KLWbSAh5jX5KjX4wZEiYM8QA6

Type zerobin --help to see usage summary:

Usage:
  zerobin [options] TEXT

Options:
  -b, --bin=BIN   0bin service [default: https://paste.ec]
  -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

Examples:
  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 http://0bin.net hello   paste to 0bin.net

Hacking

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

Features/Bugs/TODOs

  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. http://0bin.net does not support -e week.
Metadata

Version

1.5.2

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows