We have released version 3.0 of OpenPGPjs, an open source OpenPGP library

At ProtonMail, a big part of our mission is to make strong encryption and privacy accessible to every single person. While the ProtonMail and ProtonVPN services go a long way towards doing that, we also allocate a lot of resources into the research and development of better cryptographic tools and processes. The goal of the OpenPGPjs project is to make public-key cryptography not only available to users, but also to the global developer community. Simply put, the widespread availability of open-source and secure cryptography libraries is a prerequisite of the privacy revolution. As maintainers of the OpenPGPjs project, this is our priority. You can learn more about OpenPGPjs here and here.

Version 3 of OpenPGPjs also brings a number of enhancements that make it possible for ProtonMail to be fully interoperable with PGP, a new feature that is coming this Spring. Thus, improving OpenPGPjs also directly allows us to improve ProtonMail. Below is the full list of improvements that have been made for version 3.0 of the OpenPGPjs library. ProtonMail is committed to open source, and all the code for OpenPGPjs can be found on Github.

The support of the developer community is essential for the continued development of OpenPGPjs, and we welcome pull requests and comments.

OpenPGPjs 3.0 Release Notes

Public-Key Cryptography

  • Public-key cryptography using elliptic curves P-256, P-384, P-521, SECP-256k1, Curve25519, and Ed25519 is now supported. The implementation uses Fedor Indutny’s Elliptic library and utilizes native Node.js and browser APIs when possible. We recommend using ed25519 for security and efficiency.
  • To generate ECC keys, pass a `curve` parameter to the generateKey function; e.g., `curve=”ed25519”`.
  • In other public-key cryptography news: jsbn.js is dead, long live bn.js! All public-key algorithms and MPI handling functions have been refactored to use bn.js. In particular, new probabilistic random prime generation algorithms have been added to assist with RSA key generation. If you need RSA keys, for instance for compatibility purposes, we recommend at least a 2048-bit key size.
  • Generating and receiving wild card key IDs in public-key encrypted session key packets is now supported. A wild card key ID indicates that the receiving implementation should try all available private keys, checking whether each can be used to decrypt any session key, with an associated performance cost. To generate key packets with wild card key IDs, the `wildcard` option can be set to true in the encrypt and encryptSessionKey functions.
  • A new optional date input to the encrypt, decrypt, sign, and verify functions allows for performing operations in the context of that date. This can be helpful for hiding the true encryption/signature time of scheduled messages or for verifying signatures of old messages with currently expired public keys that may not have been expired at the time of receipt.

Breaking API Changes

  • The high-level decrypt function now accepts arrays of private keys, passwords, or session keys as input and attempts to decrypt session keys with all values. All possible decrypted session keys are then used to attempt to decrypt the message data. This is necessary because there is no way to a priori validate decrypted session keys from wild card key IDs or passwords if the algorithm enum happens to be valid, and this happens an appreciable fraction of the time (~1/20). The input variables privateKey, password, and sessionKey have been renamed to privateKeys, passwords, and sessionKeys
  • The decryptSessionKey function has been renamed to decryptSessionKeys and similarly accepts arrays of private keys and passwords as input.


  • Bzip2 compression and decompression using the compressjs library is now supported.
  • Zlib compression now uses pako’s zlib module or the native zlib module on Node.js when possible. This represents a significant performance increase in compression.
  • Compression can now be enabled by either altering the compression value in the config file or passing in a compression option to the high-level encrypt function.


  • Fixed an issue where the random number buffer would get depleted when running many concurrent processes with web workers
  • It is now possible to specify the number of worker threads when initializing the web worker


  • JavaScript style checking now uses ESLint. Run `grunt eslint` before submitting pull-requests.
  • Also before submitting pull requests, run `grunt browsertest` and open localhost:3000/test/unittests.html to test web worker compatibility.
  • The library has been refactored to use ES6 variable declaration syntax (const, let) and ES7 asynchronous code syntax (async, await). Babel ensures compatibility with older browsers.

Future Roadmap

  • Improve the performance of public-key operations via improving the bn.js library. See the benchmarks.
  • Add support for streaming cryptography.
  • Add support for Brainpool elliptic curves.
  • Add support for the RFC4880 draft version 5, which include changes in the S2K function and specifications for supporting AEAD in V5 keys. This includes AES-EAX, an authenticated mode of operation for AES, as well as two new authenticated public key options: AEDH and AEDSA. See issue #627.

Best Regards,
The ProtonMail Team

Sign up and get a  free encrypted email accounts from ProtonMail.

We also provide a free VPN service to protect your privacy.

ProtonMail and ProtonVPN are funded by the community. If you would like to support our efforts, you can upgrade to a paid plan or donate. Your support allows us to continue to develop ProtonMail as free and open source software.

About the Author

Proton Team

Proton was founded by scientists who met at CERN and had the idea that an internet where privacy is the default is essential to preserving freedom. Our team of developers, engineers, and designers from all over the world is working to provide you with secure ways to be in control of your online data.


Comments are closed.

18 comments on “We have released version 3.0 of OpenPGPjs, an open source OpenPGP library

  • First paragraph “You can learn more about OpenPGPjs here and here.”

    There are no links behind those words.

  • Very happy to hear that full PGP compatibility is coming this spring. This is great news.
    Congratulations on making end-to-end encrypted email user-friendly yet secure.

  • ProtonMail seems to be at the front of the line when it comes to making privacy available for everyone. This OpenPGP news is most welcome.

    People in the U.S. don’t understand something about the FISA Court, which authorizes surveillance against U.S. citizens. A claim of “national security interest” can be used to spy on any U.S. citizen. This hurdle of “national security interest” has been lowered until it is non-existant. If your neighbor in Washington D.C. is in the intelligence community, and you aggravate him on, say, a property dispute (causing him to spend time and money on the issue), you can be electronically surveilled. You can be said to have impeded national security by impeding a national security employee. It’s that simple. The FISA court judges approve anything. Only one surveillance request has been denied. The FISA Judge who allowed the spying on Trump won’t discipline those who omitted information to that Judge when requesting Trump surveillance. The system is designed so that accountability cannot enter into the equation.

    Use encryption whenever possible, and encourage the open source community. Support ProtonMail financially. If you live in Washington D.C., encourage your neighbors to leak surveillance abuses.

  • Thank you very much for the amazing work you are doing!

    Just a curiosity: are you thinking of interfacing with the new autocrypt protocol (https://autocrypt.org), to allow for more interoperability with contacts outside protonmail?

    • We have assessed autocrypt and at this time, we don’t feel like it is quite ready for prime time.

      • well it is still in alpha. i think it would be good for protonmail if you could get someone from your team to participate in the project. it would give proton good PR and bring you away from the “walled garden” problem by showing that you do make the effort to bring safe, encrypted communication to everyone – not just between protonusers. in the interest of getting e2e-encrypted emails to the broadest possible group of users possible there are easy solutions like this needed.

        you don’t have to implement it yet – i mean its not finished or anything but the participation alone would be good for your standing in the privacy-community. there are some other well-known participants in there already – enigmail(/thunderbird-plugin), k9mail, posteo.

        don’t miss out.

    • There has been a small downtime. We are investigating the reasons behind it. Please let us know if you still encounter issues.

  • Thank You i signed up for your email service. Im wanting to change my online presense. Its a mess ive got idk how many facebooks and my other emails are everywhere. My gmail was hacked with my facebook and messenger last year its been a nightmare since. I hope to get rid of all that bad keep my good facebook if i can get back in it. Im old school i remember before internet and the beginning of it. I can say was ok until apps. These last couple updates has ruined me. I was great on computers i did graphics for 8 years sent files through various ways. Im almost wanting to give up on technology. Ill see. Id like to make money online and travel but cant even begin to start on this mess where to begin getting rid of it. With u there is hope. Along with few others. Thanks

  • Nothing important just want to tell you guys you are doing a Kick Ass job . Really like the mail and VPN easy to navigate and use . I’ll tell everyone about your services.
    Thank you
    Mike Juarez

  • Ok. May l come back and try again at a later time. That is covenant time for you and myself to get this right the next time l log in. I do thank you for giving me the opportunity .
    John Kress

  • this is a really cool can you make it so you make it so I can upload profile pictures on Protonmail I love to donate crypto currencies to Protonvpn and to Protonmail I uses to use Yandex but I believe Protonmail is more secure and privacy oriented thanks for getting braved verified I plan on donate a few dollars $ to both Protonmail and Protonvpn sense I like the idea of free for everyone I some times I donated most of my bitcoin to help out

    • Hi Peter. You could share the login details for a regular ProtonMail account with all group members.