• Stars
    star
    251
  • Rank 161,862 (Top 4 %)
  • Language
    JavaScript
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Encrypted pastebin using IPFS

hardbin.

The world's most secure encrypted pastebin, guaranteed *

Hardbin is an encrypted pastebin, with the decryption key passed in the URL fragment, and the code and data served securely with IPFS. (IPFS is a distributed content-addressable storage system that is web-compatible; it's basically bittorrent for the web).

If you're viewing this on hardbin.com, then you're using it via the hardbin.com public IPFS gateway. The IPFS gateway you use has the same capabilities as an ordinary web server (i.e. it can modify content at will), so you should make sure to use a gateway you trust. Running a local gateway is the best option. Start with the IPFS Getting Started guide.

Compared to a traditional encrypted pastebin (e.g. ZeroBin), when used over a trusted gateway, neither the code nor the data can be modified as the content hashes are cryptographically verified by IPFS. This means there is no possibility for a server operator to insert malicious code to exfiltrate the plaintext or decryption key. It's the perfect encrypted pastebin.

(* this is not a guarantee)

Usage

Note that the security benefits of hardbin only apply when accessing it over a local (or otherwise trusted) gateway. If you access it over a gateway that you do not control, then the security model degrades to be equivalent to that of traditional encrypted pastebins.

If you trust the hardbin.com server and hosting company and the HTTPS CA infrastructure, then you can always find the latest version of hardbin by going straight to hardbin.com.

The github repo should also link directly to the latest IPFS hash.

It doesn't matter which IPFS gateway is used to access hardbin.com, but you won't be able to publish anything unless you use a writable gateway (i.e. ipfs daemon --writable). I am operating a public writable gateway on hardbin.com to smooth the user experience. But remember that using a public gateway means you are trusting the public gateway not to ship malicious code to (for example) exfiltrate the plaintext.

In general it should either work out-of-the-box or give good instructions on how to make it work.

The content will need to be pinned to make sure it stays around for long term (the same as any content stored in IPFS). Pinata is a service offering to pin content for a very, very small fee. Failing that, content will stay around as long as it is cached on any node (e.g. a public gateway).

If you want to share a link to hardbin which will automatically load this README, append #about as the fragment. For example, https://hardbin.com/#about will always load the latest version of the code and show the README text.

Local gateway

A local gateway that you run yourself is the safest way to use hardbin.

Follow the IPFS Getting Started guide, but make sure to run the gateway with ipfs daemon --writable, else you won't be able to publish anything.

You can then install a browser extension such as IPFS Companion for Chrome to automatically redirect IPFS paths to your local gateway.

Public gateway

Any public gateway will work fine for viewing content, but you won't be able to publish anything on a non-writable gateway. Using a public gateway also trusts the public gateway not to insert malicious code to exfiltrate content (or do anything else it shouldn't).

Writable public gateway

A writable public gateway will work fine for viewing and publishing, but you're still trusting the public gateway not to insert malicious code.

Using the writable public gateway at hardbin.com presents largely the same trust model as other encrypted pastebin services.

How it works

The hardbin code is served out of IPFS. The user then inputs the content. When the content is published, a key is generated using the crypto.getRandomValues() API and the content is encrypted in javascript in the browser using AES-256 via Crypto-JS. The new content is then pushed to the IPFS gateway.

The decryption key is passed in the URL fragment, and the URL can be shared with anybody.

As long as the IPFS gateway is not compromised, and the user visits a known-good hash in the first place, there is no possibility for anybody to modify either the code or the data, because to do so would change the IPFS hash.

Since nobody can modify the code, and nobody can view the key unless you show it to them, nobody without the key can either read the plaintext or ship a malicious viewer which would exfiltrate the plaintext (or key).

Self-hosting

You can "self-host" hardbin as follows:

git clone https://github.com/jes/hardbin
ipfs add -r hardbin/

Custom modifications

If you want to use any custom modifications, you can simply make them, publish your new code on IPFS with ipfs add, and then it's available and ready to use. It's just as much a first-class citizen as the version in this git repo, and you're equally welcome to access it via the hardbin.com public writable gateway.

Of course, pull requests are always welcome for improvements that might be useful to others.

Security considerations

You still need to share the paste URL securely, otherwise a third-party can read it as easily as anybody else can.

You need to make very sure to use a known-good version of the code when creating pastes, as it would be trivial to create a malicious version that looks identical. The best thing to do is write down the hash the first time you use it, and always use the same hash. If you want to upgrade to a new version of the software, you'll need to update your hash.

If you don't use a local (or otherwise trusted) IPFS gateway, then the gateway server operator can perform all the same attacks that a traditional encrypted pastebin operator could perform.

I don't recommend using hardbin for highly critical stuff as the code has not been thoroughly audited by anyone but me. If you want to audit it please contact me.

Contact me

Hardbin was created by James Stanley. You can email me on [email protected], or read my blog at incoherency.co.uk.

More Repositories

1

scamp-cpu

A homebrew 16-bit CPU with a homebrew Unix-like-ish operating system.
Slash
287
star
2

nightdrive

Night-time driving simulation
JavaScript
177
star
3

chess-steg

Steganography in chess games
JavaScript
85
star
4

cntdn

Solvers for the countdown letter and number games.
C
68
star
5

seasonal-css

Seasonal colours for any web page
HTML
63
star
6

meshmill

The world's greatest open source 3D CAM software. (Maybe one day.)
JavaScript
38
star
7

stegoseed

Steganographically hide Bitcoin wallet seeds
HTML
30
star
8

autopatzer

Automatic chess board
JavaScript
27
star
9

cpmhttpd

A basic web server for CP/M
C
13
star
10

eldood

Date coordination for social events
JavaScript
12
star
11

pngcam

Pngcam takes in a heightmap and gives out Gcode to run a CNC machine.
G-code
9
star
12

ring-signatures

Javascript ring signatures tool
JavaScript
8
star
13

jescpu

Silly toy CPU project
Verilog
7
star
14

fifoirc

Creates a fifo that can be written to, producing text in an IRC channel.
C
7
star
15

jetstream

Live-streaming without the bullshit: no signup, no accounts, no pricing. Based on WebRTC and Janus.
JavaScript
6
star
16

psion-arduino

Psion Organiser II interface over USB using an Arduino
C++
6
star
17

muxirc

IRC multiplexer, allowing several client programs to share a nick on IRC.
C
5
star
18

base58

Javascript base58 encode/decode tool
JavaScript
5
star
19

countdown-game

Countdown game
JavaScript
5
star
20

ttgen

Truth-table generator for boolean logic expressions.
C
5
star
21

chess-puzzle

Single-player chess variant
JavaScript
4
star
22

collapseos-doc

Collapse OS documentation browser
Perl
4
star
23

isopath

Web-based implementation of Isopath, a zero-sum boardgame invented by pocket83
JavaScript
4
star
24

fuelsafe

Inline fuel sensor
C++
3
star
25

serve

A simple HTTP server supporting CGI scripts and gzip compression.
C
3
star
26

android-countdown-solver

Countdown Solver for Android
Java
3
star
27

aoc2021

Advent of Code 2021 on my homemade 16-bit CPU SCAMP
Slash
3
star
28

zoe

Zoe Opponent Engine - an xboard-compatible chess engine
C
3
star
29

revsafe

Arduino rev-limiter for my racing lawnmower.
C++
3
star
30

drl2gcode

Convert Excellion drill files (such as those produced by KiCad) into G-Code for a CNC machine.
Python
3
star
31

chess-clock

HTML
3
star
32

aoc2022

Advent of Code 2022 on SCAMP
Slash
3
star
33

timetable-parser

Convert a University of Bath course timetable page into an iCalendar file.
Perl
3
star
34

pikontroll

Controlling my PiKon telescope
Python
2
star
35

keyswitch-tester

Automatic Arduino-based keyboard switch tester
Perl
2
star
36

ricochet-group

Group chat for Ricochet IM
Go
2
star
37

blotto

A program to run round-robin Colonel Blotto tournaments, and one to generate random teams.
C
2
star
38

hideimage

Image steganography tool
HTML
2
star
39

emph

Emphasise matching lines with colour.
Perl
2
star
40

dnstweak

Quick local DNS spoofing tool
Go
2
star
41

jfind

Indexed filesystem search with inotify to detect changes.
C
2
star
42

packominoes

Program to search for skewed pentomino packing puzzles
Perl
1
star
43

nsp

Network Statistics Protocol client and server.
C
1
star
44

bnbf

Brainfuck interpreter with bignum cells and various runtime options.
C
1
star
45

stlwrap

Wrap an STL file around a cylinder
Rust
1
star
46

ngindock

Zero-downtime Docker container deployments with nginx.
Perl
1
star
47

stlcat

Concatenate STL files
Rust
1
star
48

submerge

Subscribe to YouTube channels without telling Google
Perl
1
star
49

3d-metal-printing

Notes and information about 3d metal printing
JavaScript
1
star
50

am

Alphametic puzzle solver.
C
1
star
51

guess-whom

Social online "Guess Who" game
Perl
1
star
52

aoc2020

Advent of Code 2020
Perl
1
star
53

triangle-strip-encoding

Encoding data in triangle strips
JavaScript
1
star
54

ricochet-web

Web interface for Ricochet
JavaScript
1
star
55

bip39tool

Command-line tool to interact with BIP39 mnemonics
Python
1
star
56

aoc2023

Advent of Code 2023 on SCAMP
Slash
1
star
57

bauch

Bauch-style Lego Artwork Generator
JavaScript
1
star
58

counter

Create arbitrary counters
Perl
1
star
59

anagram

Anagram deputy
JavaScript
1
star
60

pugsender

G-code sender that gets out of the way
Go
1
star
61

oscillating-engine

Oscillating engine simulator
JavaScript
1
star
62

deadbeat-escapement

Deadbeat escapement simulator
JavaScript
1
star
63

formpacker

JavaScript
1
star
64

audio2image

Convert audio files to image files
Perl
1
star