Releases: openpgpjs/openpgpjs
v6.3.0
What's Changed
- Support Node.js v24 (#1896)
- Add config option to limit decompressed message size (#1933)
Since decompression can increase the memory usage non-linearly, add aconfig.maxDecompressedMessageSizeoption to limit the decompressed message size.
By default it's set toInfinity, i.e. no limit.
Set the config option to a number of bytes to limit the size of data that gets decompressed. - Switch from seek-bzip to unbzip2-stream (#1887)
To facilitate the above. - Use native CompressionStream/DecompressionStream when not streaming (#1935)
For improved compression/decompression performance when not streaming. - Use bufferless transforms (#1893)
For lower memory usage, especially when streaming. - JSDoc: make sure only user-facing entities are included in the docs, and add TS support (#1923)
- Various dependency version bumps
- Various improvements to CI
Full Changelog: v6.2.2...v6.3.0
v6.2.2
What's Changed
- Fix zlib compression for data larger than 65KB (#1894):
Affected versions: v6.2.0 and v6.2.1 .
As compression is disabled by default in openpgpjs, the issue only affects users who enabled zlib compression via e.g.config.preferredCompressionAlgorithm = openpgp.enums.compression.zliband encrypted or signed data larger than 65KB.
Full Changelog: v6.2.1...v6.2.2
v6.2.1
v6.2.0
What's Changed
- Implement OpenPGP message grammar validation (add
config.enforceGrammar, enabled by default) (#1853) - Enable using WebCrypto for X25519 when available (#1829)
- Prefer subkeys with higher algorithm IDs (in case of equal creation timestamps), on the assumption that that's the most
modern/secure algorithm (#1854) - Improve packet stream & error handling (#1856):
- Packet parsing errors in not-yet-authenticated streams (i.e. SEIPDv1 with allowUnauthenticatedStream: true) get delayed until the decrypted data stream is authenticated
- Non-critical unknown packets get turned into UnparseablePacket` objects on the packet stream instead of being ignored
- Make Issuer Key ID signature subpacket non-critical (#1828)
- Improve type definition for the
Userclass (#1857)
New Contributors
Full Changelog: v6.1.0...v6.2.0
v6.1.1 - Security Patch
- Address CVE-2025-47934 (Message signature verification could be spoofed)
v5.11.3 - Security Patch
- Address CVE-2025-47934 (Message signature verification could be spoofed)
v6.1.0
What's Changed
- Fix decryption support for non-standard, legacy AEAD-encrypted messages and keys that used
experimentalGCMfrom OpenPGP.js v5 (#1811) - Throw on encryption using the non-standard
experimentalGCMAEAD algorithm
(Theenums.aead.gcmID standardized by RFC9580 should be used instead.) - Improve internal tree-shaking and lazy load md5 (#1812)
- Fix signing using keys without preferred hash algorithms (#1820)
Full Changelog: v6.0.1...v6.1.0
v6.0.1
What's Changed
- Fix ES imports for webpack: declare
exports.browserentrypoint as higher priority thanimport - Fix
openpgp.verify/decryptwithexpectSigned: trueandformat: 'binary'(#1805) - TS: fix
generateKey(options.type) andPrivateKey.getDecryptionKeys()type declarations (#1807) - Update hash algorithm preferences order by (#1804)
Full Changelog: v6.0.0...v6.0.1
v6.0.0
What's Changed
OpenPGP.js v6 adds support for the new version of the OpenPGP specification, RFC 9580. It also increases compliance with the specification, as demonstrated by the OpenPGP interoperability test suite.
OpenPGP.js v6 only makes minor API changes.
This is the first stable release of OpenPGP.js v6: no more breaking changes to the high-level API will be made until the next major release.
For the changes since the previous pre-release (v6.0.0-beta.3.patch.1), see the end of this message.
Here we list a summary of the main changes since v5:
Platform support changes
- The library is now declared as a
module(type: modulein package.json), and declares exports, alongside the legacy package.json entrypoints, which should ensure backwards compatibility. Still, bundlers might be affected by the package.json changes depending on how they load the library. - Node.js:
- Drop support for Node.js versions below 18 (OpenPGP.js v5 supported Node.js v14 and above).
- Streaming: drop support for native Node Readable stream: require passing Node Web Streams (#1716)
- Web:
- Require availability of the Web Crypto API's
SubtleCrypto(insecure contexts are no longer supported, asSubtleCryptois not available there) - Require availability of the Web Streams API, since it's now supported in all browsers (applications can load a polyfill if they need to support older browser versions: see README)
- Require availability of native
BigInts (not supported by e.g. Safari 13 and below, see full compatibility table) - Argon2 has been added as S2K algorithm (on all platforms). For performance reasons, the implementation relies on a WASM module, thus web apps might need to make changes to their CSP policy in order to use the feature. Alternatively, since the Argon2 WASM module is only loaded if needed, apps can manually reject password-encrypted messages and private keys which use Argon2 by checking e.g.
SymEncryptedSessionKeyPacket.s2k?.type === 'argon2'orSecretKeyPacket|SecretSubkeyPacket.keyPacket.s2k?.type === 'argon2'.
- Require availability of the Web Crypto API's
Breaking API changes
- Ensure primary key meets strength and algo requirements when encrypting/verifying/signing using subkeys (#1719)
read[Private]Key: support parsing key blocks (return first parsable key); previously, parsing would fail if a block with more than one key was given in input (#1755)PrivateKey.getDecryptionKeyswill now throw if no decryption key is found (#1789). Previously, an empty array was returned. As a consequence of this change, someopenpgp.decrypterrors will be more specific.- Refuse to use keys without key flags (see
config.allowMissingKeyFlagsbelow) - Randomize v4 and v5 signatures via custom notation (#1737): while this notation solution is interoperable, it will reveal that the signature has been generated using OpenPGP.js, which may not be desirable in some cases. For this reason, the option
config.nonDeterministicSignaturesViaNotation(defaulting to true) has been added to turn off the feature. - AEAD-encrypted v4 keys from OpenPGP.js v5 or older (namely keys generated without
.v5Keysflag and encrypted withconfig.aeadProtect = true) cannot be decrypted by OpenPGP.js v6 (viadecryptKey) out-of-the-box (seeconfig.parseAEADEncryptedV4KeysAsLegacybelow) (#1672) - Parsing of v5 keys and v5 signatures now requires turning on the corresponding config flag (see
config.enableParsingV5Entitiesbelow). The affected entities are non-standard, and in the RFC 9580 they have been superseded by v6 keys, v6 signatures and SEIPDv2 encrypted data, respectively. However, generation of v5 entities was supported behind config flags in OpenPGP.js v5, and some other libraries, hence parsing them might be necessary in some cases. (#1774 , #1779)
Configuration changes
- RFC 9580 has updated parts of the draft RFC 4880bis as implemented by OpenPGP.js v4 and v5. Related changes in v6 are:
- Drop the
config.v5Keysflag and corresponding key generation. The flag is replaced by.v6Keys, and results in a different key format. - The
config.aeadProtectflag has a different effect than in v5:- for private keys, a new encryption mechanism is used;
- for password-encrypted messages, a new message format is used;
- when encrypting messages to public keys, the flag is ignored (see #1678).
- Add
config.parseAEADEncryptedV4KeysAsLegacyto allow decrypting AEAD-encrypted v4 keys from OpenPGP.js v5 or older (namely keys generated without.v5Keysflag and encrypted withconfig.aeadProtect = true) (#1672). - Add
config.enableParsingV5Entitiesto enable parsing support for v5 entities (#1774 , #1779)
- Drop the
- Add
config.allowMissingKeyFlagsto bypass the missing key flag check (see #1677) - Drop
config.minBytesForWebCrypto, and always use WebCrypto if available, since there is no longer a performance overhead for small messages. - Rename EdDSA-related enums following the standardization of new key formats:
- Drop
enums.publicKey.eddsain favour ofenums.publicKey.eddsaLegacy - Rename string value of
enums.curve.ed25519Legacyto'ed25519Legacy'(was:'ed25519') - Rename string value of
enums.curve.curve25519Legacyto'curve25519Legacy'(was:'curve25519')
- Drop
- Rename
config.useIndutnyEllipticto.useEllipticFallback, to reflect the change of underlying library. - Remove
enums.symmetric.plaintext(internally unused) - Rename NIST curves to disambiguate the names with the Brainpool curves (#1721).:
- the identifiers
enums.curve.p256,.p384,.p521are now marked as@deprecated(to be dropped in the main release) - the new identifiers are, respectively:
enums.curve.nistP256,.nistP384,.nistP521. - the corresponding values have been changed from
'p256','p384','p521'to'nistP256','nistP384','nistP521'(these new values are expected bygenerateKey, for theoptions.curveargument).
- the identifiers
- Remove
config.deflateLevel(#1717) - Drop
config.revocationsExpire, always honor revocation expiration (#1736): the option used to default to false, and ignore revocation expirations. We now honor those expirations, namely match the behavior resulting from setting the option to true. - Change the default preferred hash algorithm (
config.preferredHashAlgorithm) to SHA512 (#1801)
New API options
- In
openpgp.sign,recipientKeysandrecipientUserIDsoptions have been added. These can be used to influence the selection of the hash algorithm via the algorithm preferences of the recipient keys, to ensure that the recipients will support the selected hash algorithm.
Similarly, when signing+encrypting usingopenpgp.encrypt, theencryptionKeysare now used to determine the preferred hash algorithms, instead of thesigningKeys. (#1802)
Full Changelog: v5.11.0...v6.0.0.
For additional context about the changes introduced by OpenPGP.js v6, you can also refer to the changelog of the various prereleases, starting from v6.0.0-alpha.0.
Changes since v6.0.0-beta.3.patch.1: the main changes since the previous pre-release are the changes to the handling of preferred hash algorithms mentioned above (#1801 and #1802). For the full changelog, see v6.0.0-beta.3.patch.1...v6.0.0.
v6.0.0-beta.3.patch.1
What's Changed
Revert to not using the WebCrypto for X25519 (reverting part of #1782): due to missing support in WebKit and Chrome (without experimental flags), and issues in Firefox v130+ (resulting in errors on decryption and key generation), for now we go back to using a JS implementation.
NB: this change only affects encryption and decryption using X25519. For signing and verification using Ed25519 we keep relying on
WebCrypto when available (namely in WebKit, Firefox, and Node).
Full Changelog: v6.0.0-beta.3.patch.0...v6.0.0-beta.3.patch.1
For more context about the crypto-refresh changes introduced by OpenPGP.js v6, refer to the changelog of the initial prerelease.