README.md

clj-pgp

This is a Clojure library which wraps the
Bouncy Castle OpenPGP implementation.

Usage

Library releases are published on Clojars. To use the latest version with
Leiningen, add the following dependency to your project definition:

The main interface to the library is the clj-pgp.core namespace, which
provides many general functions for working with PGP keys and data.

PGP Keys

PGP stores keys in keyrings, which are collections of related asymmetric keys.
Public keyrings store just the public key from each keypair, and may store keys
for other people as well as keys controlled by the user. Secret keyrings store
both the public and private parts of a keypair, encrypted with a secret
passphrase.

Keypairs and keyrings can be created using the clj-pgp.generate namespace.
RSA and EC keys can be generated directly or as part of a keyring, which binds a
master key together with signing and encryption subkeys. The generate-keys
macro provides a handy syntax for creating new keyrings:

Message Handling

Data encryption is supported using PGP message packets. The content is encrypted
using a symmetric key algorithm, then the key is encrypted using the given
public key(s) or passphrase. Any matching private key or passphrase can then
decipher and read the message.

Data may also be compressed before encrypting it, and converted to an ASCII
representation after. The ASCII format is sometimes referred to as an "armored"
encoding because it is intended to be transmissible through email.

Signatures

PGP keys can be used to sign data by hashing it and encrypting the hash with the
private key. Later, the signature can be verified by decrypting it with the
public key and comparing it with the hash of the data.