• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created about 11 years ago
  • Updated over 7 years ago

Reviews

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

Repository Details

Pretty Curved Privacy
build status build status

DESCRIPTION

Pretty Curved Privacy (pcp1) is a commandline utility which can be used to encrypt files. pcp1 uses eliptc curve cryptography for encryption (CURVE25519 by Dan J. Bernstein). While CURVE25519 is no worldwide accepted standard it hasn't been compromised by the NSA - which might be better, depending on your point of view.

Caution: since CURVE25519 is no accepted standard, pcp1 has to be considered as experimental software. In fact, I wrote it just to learn about the curve and see how it works.

Beside some differences it works like GNUPG. So, if you already know how to use gpg, you'll feel almost home.

QUICKSTART

Lets say, Alicia and Bobby want to exchange encrypted messages. Here's what the've got to do.

First, both have create a secret key:

Alicia                             Bobby
pcp1 -k                            pcp1 -k

After entering their name, email address and a passphrase to protect the key, it will be stored in their vault file (by default ~/.pcpvault).

Now, both of them have to export the public key, which has to be imported by the other one. With pcp you can export the public part of your primary key, but the better solution is to export a derived public key especially for the recipient:

Alicia                             Bobby
pcp1 -p -r Bobby -O alicia.pub     pcp1 -p -r Alicia -O bobby.pub

They've to exchange the public key somehow (which is not my problem at the moment, use ssh, encrypted mail, whatever). Once exchanged, they have to import it:

Alicia                             Bobby
pcp1 -K -I bobby.pub               pcp1 -K -I alicia.pub

They will see a response as this when done:

key 0x29A323A2C295D391 added to .pcpvault.

Now, Alicia finally writes the secret message, encrypts it and sends it to Bobby, who in turn decrypts it:

Alicia                             Bobby
echo "Love you, honey" > letter
pcp1 -e -r Bobby -I letter -O letter.asc
cat letter.asc | mail [email protected]

                                   pcp1 -d -I letter.asc | less

And that's it.

Please note the big difference to GPG though: both Alicia AND Bobby have to enter the passphrase for their secret key! That's the way CURVE25519 works: you encrypt a message using your secret key and the recipients public key and the recipient does the opposite, he uses his secret key and your public key to actually decrypt the message.

Oh - and if you're wondering why I named them Alicia and Bobby: I was just sick of Alice and Bob. We're running NSA-free, so we're using other sample names as well.

FILES AND PIPES

Pcp behaves like any other unix tool. If not otherwise specified it will read input from standard input (STDIN) and print output to standard output (STDOUT). For instance:

pcp1 -e -O output

will read the text to be encrypted from standard input, because -I has not been specified. It works the same with -O:

pcp1 -e -I myfile

In this case the encrypted result will be written to standard output.

Therefore it is possible to use pcp within pipes. Another more realistic example:

ssh remote cat file | pcp1 -ez | mailx -s 'as requested' bob@somewhere

here we encrypt a file symmetrically without downloading it from a remote ssh server and sending the encrypted result via email to someone.

The behavior is the same with any other functionality where files are involved like importing or exporting keys. However, there's one exception: If the option -X (--password-file) has been used and is set to -, then this will take precedence over any other possible use of standard input. So if you want to encrypt something and don't specify an input file you cannot use -X -, and vice versa. IF you use -X - the passphrase will be read from standard input, which then can't be used further for input files elsewhere. Pcp will exit with an error in such a case.

INSTALLATION

There are currently no packages available, so pcp has to be compiled from source. Follow these steps:

First, you will need libsodium:

git clone git://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure && make check
sudo make install
sudo ldconfig
cd ..

If you want to have JSON support, you'll need to install the Jansson library (optional):

git clone git://github.com/akheron/jansson.git
cd jansson
autoreconf -i
./configure && make
sudo make install
cd ..

In order to use the python binding, you need to install the cffi python package.

Next, build pcp:

git clone git://github.com/tlinden/pcp.git
cd pcp
./configure
sudo make install
cd ..

Optionally, you might run the unit tests:

make test

DOCUMENTATION

To learn how to use pcp, read the manpage:

man pcp1

COPYRIGHT

Copyright (c) 2013-2015 by T.v.Dein <tom AT vondein DOT org>

ADDITIONAL COPYRIGHTS

ZeroMQ Z85 encoding routine
Copyright (c) 2007-2013 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2010-2011 Miru Limited
Copyright (c) 2011 VMware, Inc.
Copyright (c) 2012 Spotify AB
Tarsnap readpass helpers
Copyright 2009 Colin Percival
jen_hash() hash algorithm
Bob Jenkins, Public Domain.
UTHASH hashing macros
Copyright (c) 2003-2013, Troy D. Hanson
Random art image from OpenSSH keygen
Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.

Comitted by Alexander von Gernler in rev 1.7.

Every incorporated source code is opensource and licensed under the GPL as well.

AUTHORS

T.v.Dein <tom AT vondein DOT org>

LICENSE

Licensed under the GNU GENERAL PUBLIC LICENSE version 3.

HOME

The homepage of Pretty Curved Privacy can be found on http://www.daemon.de/PrettyCurvedPrivacy. The source is on Github: https://github.com/TLINDEN/pcp

More Repositories

1

viking-mode

Kill first, ask later - an emacs mode for killing things quickly
Emacs Lisp
30
star
2

udpxd

A general purpose UDP relay/port forwarder/proxy
C
24
star
3

novel-mode

Emacs Screen Reader
Emacs Lisp
8
star
4

curve-keygen

curve-keygen - a utility to generate CURVE25519 keypairs.
Shell
8
star
5

autoscratch

Automatically switch major mode from *scratch*
Emacs Lisp
8
star
6

kleingebaeck

Kleingebäck - kleinanzeigen.de Backup
Go
6
star
7

TerraDuino

Steuercontroller für Terrarium mit Arduino
Arduino
5
star
8

note

a perl script for maintaining notes
Perl
4
star
9

Crypt--PWSafe3

Perl module to Read and write Passwordsafe v3 files
Perl
4
star
10

jaildk

FreeBSD jail development kit
Shell
4
star
11

kageviewer

Viewer for shaders written in Kage, similar to glslviewer
Go
4
star
12

leo

Commandline interface for dict.leo.org
Perl
3
star
13

dbtool

A command line tool to manage a key/value database (gdbm or berkeley-db)
C++
3
star
14

attinycore-makefile-tests

C++
2
star
15

dot-emacs

My Emacs Config
Emacs Lisp
2
star
16

Nohistory-Config-General

Generic perl configuration file parsing module
Perl
2
star
17

tablizer

Manipulate tabular output of other programs
Go
2
star
18

TemplateDuino

Template Function Generator for Arduino
2
star
19

config-general-mode

Emacs major editing mode for Config::General config files
Emacs Lisp
2
star
20

kage-mode

An emacs mode for the kage shader language
Emacs Lisp
2
star
21

Config-General

Generic perl config file parser module
Perl
1
star
22

followcursor-mode

Emacs mode to highlight line in other buffer containing word in current buffer
Emacs Lisp
1
star
23

gowipe

Securely delete files and directories (not for SSD)
Go
1
star
24

rpnc

Programmable command-line calculator using reverse polish notation
Go
1
star
25

PDFjam-GS

Extract pages from one or more PDFs
1
star
26

Quietly-Confident

git-aware static site generator written in perl
Perl
1
star
27

dotfiles

My dotfiles
Vim Script
1
star
28

mark-copy-yank-things-mode

Mark, Copy and Yank Things Emacs Minor Mode
Emacs Lisp
1
star
29

apid

Generic REST API Daemon
Perl
1
star
30

Data-Validate-Struct

Data::Validate::Struct - Validate recursive Hash Structures
Perl
1
star
31

Data-Interactive-Inspect

Inspect and manipulate perl data structures interactively
Perl
1
star