K077 / Cryptographic protocols and formats
OpenPGP
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.
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.Output
Previous state
- 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
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
- 2. A high-level view — OpenPGP for application developers ↗
- How PGP works: hybrid encryption, signatures and packets | pgp.net ↗
- 10. Encryption — OpenPGP for application developers ↗
- RFC 9580: OpenPGP ↗
- What Is PGP? A Complete Guide to Pretty Good Privacy Encryption - KeychainPGP ↗
- PGP security questions: algorithms, key sizes, quantum, EFAIL | pgp.net ↗
- VU#303094 - OpenPGP vulnerable to chosen-ciphertext attacks in cipher feedback (CFB) mode ↗
- Standard ↗
- JSDoc: Home ↗
- JSDoc: Global ↗