Package: pbp
pbpv0.2.1 - experimentalPBP[0] is a simple python wrapper and a command line interface around
libsodium, to provide basic functionality resembling PGP. It uses
scrypt for a KDF and a much simpler packet format, which should be
much harder to fingerprint, pbp also provides an experimental forward
secrecy mode and a multi-party DH mode.InstallationYou possibly need to run (or an equivalent command) sudo apt-get install git
python-virtualenv gcc python-dev libffi-dev scrypt to satisfy all basic dependencies.
And install libsodium (http://doc.libsodium.org/installation/README.html).pip install pbpoptionally for PITCHFORK support alsopip install pyusb==1.0.0b1Design goals:use modern cryptoprovide similar functionality to PGPbe extensibledifficult to identify based on fingerprintingprovide extensive testingstrive for securityCryptoCryptographic primitives are based on the NaCl library fromhttp://nacl.cr.yp.to. The KDF used is scrypt.PGP-likeProvides basic public key encrypt/decrypt, sign/verify and secret key
encrypt/decrypt modes, as well as the ability to sign, verify, list,
generate, export and import keys.Extensibilityusing pbp and the underlying pysodium[1] library it’s easy to extend
pbp.  Some examples are the experimental forward secrecy mode (see
description in doc/chaining-dh.txt), the support for ECDH key
exchanges from the command-line and generation of arbitrarily large
random byte streams.[1]https://github.com/stef/pysodiumalso available onhttps://pypi.python.org/pypi/pysodiumFingerprintingpbp tries to avoid to store any sensitive plaintext info, the
encrypted files all should look like random noise. for a description
of the packet formats see doc/fileformats.txt.TestingAll py files come with their internal tests, unit tests are in
tests.py, and commandline functionality is tested in test.sh.Securitypbp locks the process memory, so it cannot be swapped to disk. Also
pbp uses SecureString[2] to overwrite sensitive key material after
usage in memory, so keys have a short window of opportunity to leak.[2]https://github.com/dnet/pysecstrUsageGenerate a keypbp -g -n alicesending howdy.txt using public key encryption from alice to bobpbp -c -S alice -r bob -i howdy.txtdecrypt an encrypted file using public key cryptopbp -d -S bob -i howdy.txt.pbpsending howdy.txt using secret key encryptionpbp -c -i howdy.txtdecrypt an encrypted file using secret key cryptopbp -d -i howdy.txt.pbpsign howdy.txtpbp -s -S alice -i /howdy.txtverify howdy.txtpbp -v -i howdy.txt.sigsign bobs keypbp -m -S alice -n bobcheck sigs on carols keypbp -C -n carolalice encrypts howdy.txt to bob using experimental forward secret modepbp -e -S alice -r bob -i howdy.txt -o ./secret-messagebob decrypts howdy.txt from alice using experimental forward secret modepbp -E -S bob -r alice -i ./secret-messageinitiate ECDH key exchangepbp -D1respond to ECDH key exchangepbp -D2 -Dp ‘public component from D1’finish ECDH key exchangepbp -D3 -Dp ‘public component from D2’ -De ‘secret exponent from D1’random streaming 23GByte of cryptographic randomnesspbp -R -Rs 23G -o /mnt/huge_fs/random_dataparticipate in a 4-way DH exchange, 1st messagepbp -Ds -Dp 4 -S alice -n ‘friends001’ -i oldkeychain -o newkeychainparticipate in a 4-way DH exchange, 2nd messagepbp -De -S alice -n ‘friends001’ -i oldkeychain -o newkeychainthis is one big pipe that creates a 3-way ECDH secret between alice, bob and carol:pbp -Ds -S alice -Dp 3 -n ‘test-dh’ -i /dev/null |pbp -Ds -S bob -Dp 3 -n ‘test-dh’ |
pbp -Ds -S carol -Dp 3 -n ‘test-dh’ |
pbp -De -S alice -Dp 3 -n ‘test-dh’ |
pbp -De -S bob -Dp 3 -n ‘test-dh’of course instead of a pipe you could use any kind of transport mechanismIntegrationyou can add the following to your .vimrcmap ;e :%!/bin/sh -c ‘pbp -c 2>/dev/tty | base64’<C-M>
map ;d :%!/bin/sh -c ‘base64 -d | pbp -d 2>/dev/tty’<C-M>
map ;s :,$! /bin/sh -c ‘pbp -s -a -S stf 2>/dev/tty’<C-M>
map ;v :,$! /bin/sh -c ‘pbp -v -a 2>/dev/tty’<C-M>2013, stf <s@ctrlc.hu>, dnetvsza@vsza.hu, AGPLv3.0+[0] also it’s very funny to say pbp with a mouth full of dry cookies.
don’t try this in company![![Build Status](https://travis-ci.org/stef/pbp.svg?branch=master)](https://travis-ci.org/stef/pbp)