openpgpjs /openpgpjs

OpenPGP implementation for JavaScript

★ 5,981⑂ 825👁 165⑃ 942● 882▤ 136
JavaScriptLGPL-3.0Created 2011-11-13openpgpjs.org
Download: v6.3.2v6.3.2 ↓6.3.22026-09-24
-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 wh

Top issues

Discussions

Latest release

v6.3.2 v6.3.2 2026-09-24
What'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

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON