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)
- OpenDHT (minimal version: 1.2.0)
- msgpack-c
- gpgmepp
- json.hpp (required version for CMake: 2.1.1)
- cURLpp (minimal version: 0.8.1)
- glibmm
- libb64
- Getopt
- catch for unit tests
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".
- Add support for values with size greater than 64KiB (splitting values across multiple locations, see #17);
- Support for multi-lingual interface (--help, info/debug messages, see #18);
- Support for longer paste life time (OpenDHT's default is 10 minutes, see #19);
- Switch from the currently used small python REST API server script to OpenDHT's proxy (see #20);
- Improve the logging code (with dedicated library?);
Password based encryption (AES using gnutls);Add user configuration file system;Support RSA encrypt/sign using user's GPG key;Support running the DHT node as service for executing dpaste operations.
- Simon Désaulniers sim.desaulniers@gmail.com
- Adrien Béraud adrien.beraud@savoirfairelinux.com