All Projects → calccrypto → OpenPGP

calccrypto / OpenPGP

Licence: MIT License
A C++ Implementation of RFC 4880

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to OpenPGP

Objectivepgp
OpenPGP library for iOS and macOS
Stars: ✭ 557 (+540.23%)
Mutual labels:  pgp, openpgp
openpgp-php
OpenPGP.php is a pure-PHP implementation of the OpenPGP Message Format (RFC 4880).
Stars: ✭ 161 (+85.06%)
Mutual labels:  pgp, openpgp
Encrypt.to
Send encrypted PGP messages with one click
Stars: ✭ 116 (+33.33%)
Mutual labels:  pgp, openpgp
Gpgsync
🔒 GPG Sync is designed to let users always have up-to-date public keys for other members of their organization
Stars: ✭ 301 (+245.98%)
Mutual labels:  pgp, openpgp
flutter-openpgp
OpenPGP for flutter made with golang for fast performance with support for android, ios, macos, linux, windows, web and hover
Stars: ✭ 35 (-59.77%)
Mutual labels:  pgp, openpgp
Rnp
RNP: high performance C++ OpenPGP library, fully compliant to RFC 4880
Stars: ✭ 122 (+40.23%)
Mutual labels:  pgp, openpgp
Bouncy Gpg
Make using Bouncy Castle with OpenPGP fun again!
Stars: ✭ 164 (+88.51%)
Mutual labels:  pgp, openpgp
openpgpkey-control
OpenPGP keys published on your website (WKD)
Stars: ✭ 36 (-58.62%)
Mutual labels:  pgp, openpgp
lokey
A tool that makes it easy to work with and convert between cryptographic key formats
Stars: ✭ 87 (+0%)
Mutual labels:  pgp, openpgp
wp-pgp-encrypted-emails
🔐 📧 Encrypts WordPress emails using OpenPGP or S/MIME with a familiar API.
Stars: ✭ 35 (-59.77%)
Mutual labels:  pgp, openpgp
react-native-fast-openpgp
OpenPGP for react native made with golang for fast performance
Stars: ✭ 29 (-66.67%)
Mutual labels:  pgp, openpgp
keylist-rfc
🔏 turning the system behind GPG Sync into an Internet standard
Stars: ✭ 15 (-82.76%)
Mutual labels:  pgp, rfc
pgpainless
Simple to use OpenPGP API based on Bouncy Castle
Stars: ✭ 73 (-16.09%)
Mutual labels:  pgp, openpgp
sike-java
SIKE for Java is a software library that implements experimental supersingular isogeny cryptographic schemes that aim to provide protection against attackers running a large-scale quantum computer.
Stars: ✭ 28 (-67.82%)
Mutual labels:  cryptography-library
python-fastpbkdf2
Python bindings for fastpbkdf2
Stars: ✭ 24 (-72.41%)
Mutual labels:  cryptography-library
rfcs
An open process for designing substantial changes to Concourse.
Stars: ✭ 39 (-55.17%)
Mutual labels:  rfc
asciidoctor-rfc
AsciiRFC: an AsciiDoc/asciidoctor backend to produce RFC XML v3 (RFC 7991) and v2 (RFC 7749)
Stars: ✭ 14 (-83.91%)
Mutual labels:  rfc
aliceandbob
🔐 A free, light and easy to use client-side tool to generate PGP key pairs, encrypt and decrypt messages.
Stars: ✭ 24 (-72.41%)
Mutual labels:  pgp
rfc-bibtex
A command line tool that creates bibtex entries for IETF RFCs and Internet Drafts.
Stars: ✭ 43 (-50.57%)
Mutual labels:  rfc
hermes-core
Security framework for building multi-user end-to-end encrypted data storage and sharing/processing with zero leakage risks from storage and transport infrastructure.
Stars: ✭ 72 (-17.24%)
Mutual labels:  cryptography-library

OpenPGP in C++

Build Status Coverage Status

Copyright (c) 2013 - 2019 Jason Lee @ calccrypto at gmail.com

Please see LICENSE file for the license.

Also:

  • contrib/cmake/FindGMP.cmake is by Jack Poulson from Elemental and is licened under the BSD License. It was changed slightly to remove a debug message.
  • Some of CMakeLists.txt was taken from the Kitware CMake wiki RPath handling page.
  • The code for incorporating Google Test into CMake was taken from the Google Test README, and modified slightly.

With much help from

  • Alex Stapleton (OpenPGP-SDK)
  • Auston Sterling - Massive amounts of debugging and programming help
  • D-o-c - Key merging and elliptic curve parsing
  • GeorgeKalovyrnas - Got me to rewrite S2K3::run that solves 2 problems at once (#44)
  • Herbert Hanewinkel (hanewin.net)
  • Jon Callas (RFC 4880)
  • kaie - Found lots of bugs that were caused by knowledge gaps (#43)
  • Many people on the StackExchange network
  • mugwort-rc - Tons of testing code, code style updates, and bugfixes
  • pgpdump.net
  • PortablePGP

IMPORTANT

This library was not written for actual use.

Rather, it was meant for learning about the internals of PGP can easily use/add a few std::couts to see the internal workings.

So if you choose to use it in a real setting where secrecy is required, do so at your own risk.


This is a C++ implementation of the majority of RFC 4880, the OpenPGP Message Format.

The purpose of this library is to help clear up the mess that is RFC 4880. It is extremely vague at best, and it took me a long time to figure out most of it. No one should have to go through that.

This library allows for the modification of PGP packets, such as providing incorrect checksums and public key values. That was done on purpose. I used it to test keys I created with known working values. What others do with this capability is none of my concern or responsibility.


Building

Tools

  • A C++ compiler with C++11 support
  • CMake 3.6+

Libraries

Build

mkdir build
cd build
cmake ..
make
<make test>
make install

CMake Configuration Options

The boolean GPG_COMPATIBLE flag can be used to make this library gpg compatible when gpg does not follow the standard. By default this is set to False.

The boolean USE_OPENSSL flag can be used to replace the hashing and random number generation code with OpenSSL implementations. USE_OPENSSL_HASH and USE_OPENSSL_RNG can be used to independently replace the hashing or the random number generator. If OpenSSL is not found, CMake will default back to the original implementation. All three are disabled by default.

Usage

This library should be relatively straightforward to use: Simply #include "OpenPGP.h".

If you do not wish to include everything at once, #include whatever functions are needed:

Feature Header Namespace
key generation keygen.h OpenPGP::KeyGen
key revocation revoke.h OpenPGP::Revoke
encrypt encrypt.h OpenPGP::Encrypt
decrypt decrypt.h OpenPGP::Decrypt
sign sign.h OpenPGP::Sign
verify verify.h OpenPGP::Verify

Multiple classes inherit from the abstract base class PGP in order to make differentiating PGP block types better in code:

PGP block type Description
DetachedSignature detached signatures for files
Key base class for OpenPGP key types
PublicKey holds public keys; inherits Key
SecretKey holds private keys; inherits Key
Message holds OpenPGP Messages
RevocationCertificate holds revocation certificates

All these different types are able to read in any PGP data, but will cause problems when used. The meaningful function in these PGP objects is provided to make sure that the packet sequence contained is meaningful.

CleartextSignature does not inherit from PGP and cannot read non-Cleartext Signature data.

All data structures have some standard functions:

Function Description
read reads data without the header information
show displays the data in human readable form like the way pgpdump.net does it.
raw returns a string of packet data without the header information
write returns a string of the entire data, including the header.
clone returns a pointer to a deep copy of the object (mainly used for moving PGP data around).
Ptr a typedef for std::shared_ptr<T> for the class where the typedef is found.

operator= and the copy constructor have been overloaded for the data structures that need deep copy.

Command Line Interface

The cli/main.cpp file provides a simple command line tool that uses modules from the cli/modules directory to provide functionality. These can be used as examples on how to use the functions. A lot of the output was based on/inspired by pgpdump.net and GPG.

Note: Keyrings were not implemented. Rather, individual keys are read from the directory used as arguments to functions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].