-1
Daily
5,981
stars
825
forks
165
watchers
942
prs
882
issues
136
releases
README
OpenPGP.js
==========
OpenPGP.js is a JavaScript implementation of the OpenPGP protocol. It implements RFC 9580 (superseding RFC 4880 and RFC 4880bis).
Table of Contents
- OpenPGP.js
- Platform Support
- Performance
- Getting started
- Node.js
- Deno (experimental)
- Browser (webpack)
- Browser (plain files)
- Updating from older versions of the library
- Code examples
- Encrypt and decrypt Uint8Array data with a password
- Encrypt and decrypt String data with PGP keys
- Encrypt symmetrically with compression
- Streaming encrypt Uint8Array data with a password
- Streaming encrypt and decrypt String data with PGP keys
- Generate new key pair
- Revoke a key
- Sign and verify cleartext messages
- Create and verify detached signatures
- Streaming sign and verify Uint8Array data
- Documentation
- Security Audit
- Security recommendations
- Development
- How do I get involved?
- License
Platform Support
The dist/openpgp.min.js (or .mjs) bundle works with recent versions of Chrome, Firefox, Edge and Safari 15+.
The dist/node/openpgp.min.mjs (or .cjs) bundle works in Node.js v22+: it is used by default when you import ... from 'openpgp' (or require('openpgp'), respectively).
Support for the Web Cryptography API's SubtleCrypto is required.
In browsers, SubtleCrypto is only available in secure contexts.
In supported versions of Node.js, SubtleCrypto is always available.
Support for the Web Streams API is required.
In browsers: the latest versions of Chrome, Firefox, Edge and Safari support Streams, including TransformStreams.
These are needed if you use the library with stream inputs.
In previous versions of OpenPGP.js, Web Streams were automatically polyfilled by the library,
but from v6 this task is left up to the library user, due to the more extensive browser support, and the
polyfilling side-effects. If you're working with older browsers versions which do not implement e.g. TransformStreams, you can manually
load the Web Streams polyfill.
Please note that when you load the polyfills, the global ReadableStream property (if it exists) gets overwritten with the polyfill version.
In some edge cases, you might need to use the native
ReadableStream (for example when using it to create a Response
object), in which case you should store a reference to it before loading
the polyfills. There is also the web-streams-adapter
library to convert back and forth between them.
In Node.js: OpenPGP.js v6 no longer supports native Node Readable streams in inputs, and instead expects (and outputs) Node's Web Streams. Node v17+ includes utilities to convert from and to Web Streams.
Performance
Version 3.0.0 of the library introduced support for public-key cryptography using elliptic curves. We use native implementations on browsers and Node.js whTop issues
#1800"Signature creation time is in the future" error for apparently valid signature29 comments · 2024-10-28#1449Out of memory when decrypting large files without MDC10 comments · 2021-12-06#1113Keys which can be revoked by another key are not supported7 comments · 2020-06-25#1878No way to change default list of preferred hash algos4 comments · 2025-07-28#1710Missing clearPrivateParams from TS definitions4 comments · 2023-12-13#1974`verifyCertificate` fails if signer has a certify-only main key3 comments · 2026-02-27#880refactor async / Promise loop(s)3 comments · 2019-04-01#1813RSA encryption doesn't work on Deno2 comments · 2024-12-07
Discussions
#2072createMessage with text and binary file attachment?1 comments · 2026-11-05#2067v6.3.20 comments · 2026-09-24#2019v6.3.10 comments · 2026-06-04#2005ML-KEM (Kyber) support (GNUPG compatible)1 comments · 2026-05-10#1997Example of v6 ed25519/X25519 key with AES-GCM1 comments · 2026-04-26#1961Interoperability error with bouncy castle?1 comments · 2026-01-13#1951Check for gpg.fail vulnerabilities1 comments · 2025-12-28#1895v6.2.20 comments · 2025-09-02
Latest release
v6.3.2 v6.3.2 2026-09-24What's Changed Fix encrypting more than 4GB of data using AEAD (2059) config.maxDecompressedMessageSize: improve unbzip2 memory limit enforcement (https://github.com/openpgpjs/openpgpjs/pull/2064) Fix parsing of four-octet packet lengths of 231 and above (2061) UnparseablePacket: fix discarding of packets following an unparseable secret (sub)key (2060) Fix reading an empty trailing subpacket in v6 signatures (2055) Fix calling Message.signDetached directly (2062) Full Changelog: https://github.com/openpgpjs/openpgpjs/compare/v6.3.1...v6.3.2