Search code examples
javascriptgoogle-chrome-extensiongnupg

Checking GPG signatures in Javascript


There is already a solution for extracting public keys and encrypting messages in JavaScript, but I cannot figure out how to decrypt messages or check signatures. Any ideas?

From what I can see, there is already a function for actually decrypting the message, now it's just a matter of extracting a private key so messages can be signed. Correct me if I'm wrong, but it looks like step 1 is to decrypt the secret key string, then get the MPI (multi-precision integer), then separate it into the prime numbers and decryptor, which can be passed to the decryption function.


Solution

  • I wrote a generic GPG/PGP NPAPI library for use in the browser that has public methods for most everything, including decryption and verification.

    The plugin source is located here: https://github.com/kylehuff/webpg-npapi

    The plugin is currently in use in the WebPG extension for chrome, located here: https://chrome.google.com/webstore/detail/hhaopbphlojhnmbomffjcbnllcenbnih

    And the extensions source is locate here: https://github.com/kylehuff/webpg-chrome

    Both are cross-platform for Windows, Linux and OSX.