← Cryptography guide

K077 / Cryptographic protocols and formats

OpenPGP

OpenPGP PGP encryption · Survey date 2026-12-05

OpenPGP is a widely used cryptographic protocol and format defining IETF-standard cryptographic operations.

CRYPTOGRAPHY LAB / K077

Cryptography Lab · OpenPGP

Run real computations and inspect intermediate states step by step.

Educational only. Never enter real passwords or secret keys. Computation stays in your browser; input and trace values are not sent to a server. Do not use this implementation in production.

Scope: Toy educational example

OpenPGP (iterated salted S2K SHA-256; educational low count)

See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.

Reference ↗

Open lab →

Definition and overview
OpenPGP is a widely used cryptographic protocol and format defining IETF-standard cryptographic operations. Source document ↗
Classification and reversibility
Encryption protocol: symmetric encryption/decryption uses one key; public-key encryption is decrypted with private key. Source document ↗
Key or secret requirements
Requires symmetric session key protected for transmission by recipient public encryption key. Source document ↗
Operating principle and structure
Hybrid: one-time symmetric session key encrypts body, recipient public key protects session key. Source document ↗
Key size, block size and parameters
RSA 2048-bit minimum, 4096 for long-term protection; 256-bit Ed25519 described as RSA 3072 equivalent. Source document ↗
Security strength and recommendation
No known practical attacks on modern defaults Ed25519, Curve25519, AES and SHA-2; RFC 9580 removes/retires weak parts. Source document ↗
Known attacks and vulnerabilities
Chosen-ciphertext attacks on CFB symmetric ciphertext can recover partial plaintext. Source document ↗
Standards and certification
IETF OpenPGP WG standardized RFC 9580 and RFC 9980. Source document ↗
Typical uses
Message/email encryption, software integrity, file transfer, secret storage, Git signing. Source document ↗
Implementations, libraries and tools
JavaScript OpenPGP.js implements RFC 9580. Source document ↗
Decryption or decoding
Decrypt with private key, session key or password. Source document ↗
Advantages
Symmetric encryption is fast with few data-size limitations. Source document ↗
Limitations and cautions
Symmetric key must be securely shared; public-key operations are slow and unsuitable for bulk data. Source document ↗
Distinguishing encryption, encoding and hashing
Distinguish encryption (Curve25519), signing (Ed25519) and hashing (SHA-2). Source document ↗

Practical examples

Examples are illustrative; they are not execution-tested implementations or operational recommendations.

Example

Encrypt plaintext with one-time symmetric session key; protect key with recipient public key and bundle as OpenPGP message. Receiver unwraps using private key and decrypts body.

Procedure

Generate session key, symmetric encryption, protect session key with recipient public key, combine packets. Decrypt private-key session key, symmetric decrypt, verify integrity/signature. Base64 is separate keyless encoding.

Scenario

Encrypt/sign email body and attachments for confidentiality/integrity; also software signatures, file transfer, secret storage and Git commits. Verify key exchange/revocation/backup and RFC 9580 compatibility.

Pitfalls and alternatives

Beware lost/leaked private keys, unverified public keys, MD5/SHA-1/IDEA, CFB/AEAD downgrade and Base64 confusion. Use current RFC 9580 implementation, protect private keys, verify fingerprints, modern AEAD.

References