A simple pastebin for light values (max 64KB) using OpenDHT distributed hash table.
Let a file A.md
you want to share.
$ dpaste < A.md
DPASTE: Pasting data...
dpaste:74236E62
You can share this PIN (one can omit the string dpaste:
). It is used to
retrieve the pasted file within 10 minutes by simply doing:
$ dpaste -g dpaste:74236E62
One can encrypt his document using the option --aes-encrypt
or
--gpg-encrypt -r {recipient}
. In the former case, AES-GCM is used and in
the latter it is simple GPG encryption. One can also sign-then-encrypt his
message by adding the flag -s
(a working gpg configuration needs to be found
on the system). If both --aes-encrypt
and --gpg-encrypt
(or -s
) options
are present, aes encryption method is used.
When using --aes-encrypt
, dpaste
will generate a random 32-bit passphrase
which will then be stretched using argon2 crypto library. This is all
handled by OpenDHT crypto layer. After pasting the blob, the returned PIN will
be 64 bits long instead of the classic 32 bits. Indeed, the generated 32-bit
password is appended to the location code used to index on the DHT. For e.g.:
$ dpaste --aes-encrypt < ${some_file}
DPASTE: Encrypting (aes-gcm) data...
DPASTE: Pasting data...
dpaste:B79F2F91C811D5DC
Therefore, the blob will be pasted on HASH("B79F2F91")
and encrypted with
a key derived from the passphrase C811D5DC
.
Assuming you have the installed the project dependencies prior to this, you can
either use CMake or GNU Autotools to build. A c++17
compliant compiler is
required to compile the program.
$ ./autogen.sh
$ ./configure
$ make
You'll then find the binary under src/
directory.
$ mkdir build && cd build
$ cmake ..
$ make
You'll then find the binary dpaste
under build
directory.
Archlinux AUR: https://aur.archlinux.org/packages/dpaste/
Milis Linux: mps kur dpaste (https://github.com/milisarge/malfs-milis/blob/master/talimatname/genel/dpaste/talimat)
A DHT is efficient and requires no infrastructure. In practice, you can always count on the network to host your data for you since a distributed network is not likely to be "down".