Questions tagged [openpgp.js]

This project aims to provide an Open Source OpenPGP library in JavaScript so it can be used on virtually every device. Instead of other implementations that are aimed at using native code,

This project aims to provide an Open Source OpenPGP library in JavaScript so it can be used on virtually every device. Instead of other implementations that are aimed at using native code, OpenPGP.js is meant to bypass this requirement (i.e. people will not have to install gpg on their machines in order to use the library). This library implements all the needed OpenPGP functionality in a JavaScript library that can be reused in other projects that provide browser extensions or server applications. It allows developer to sign, encrypt, decrypt, and verify any kind of text - in particular e-mails - as well as managing keys.

70 questions
9
votes
1 answer

Decrypt Non-Armored PGP Files With OpenPGP.js

I am working on a Node application into which I have built a decrypter function, and have used the Openpgp.js npm module to make this work. I take in various submitted PGP client files made with our public key, decrypt them using our private key as…
6
votes
2 answers

JavaScript: Decrypt content of GnuPG encrypted files using openpgp.js

I'm trying to write a sample decryptor for GnuPG encrypted files in JavaScript using openpgp.js. So I tried it naively without even asking if it is even possible. I made the following page. popup.html
Kudayar Pirimbaev
  • 1,292
  • 2
  • 21
  • 42
5
votes
1 answer

How to use and convert an image file into Uint8Array in react native?

I am working on React-Native-OpenPGP for Encryption and Decryption. I want to take an image from my folder (local image fetch)/ Image url and convert that image into Uint8Array for encryption/Decryption . I am new to react native , Not able to find…
Diksha235
  • 442
  • 7
  • 17
5
votes
1 answer

Error encrypting message: Private key is not decrypted

I was trying to encrypt and sign a message using OpenPgpjs. But I keep getting this error "Error encrypting message: Private key is not decrypted" This is what I tried: var openpgp = require('openpgp'); var publicKey = [].join("\n"); //This has the…
Uma Kanth
  • 5,659
  • 2
  • 20
  • 41
4
votes
1 answer

Unable to decrypt an unarmored pgp file with OpenPGP.js: Session key decryption failed

I have a CSV file that has been encrypted and is now an unarmored PGP file. I'm trying to decrypt it using OpenPGP.js 5.0.0 and Node.js 14.17.5 but keep hitting a wall. At first, I tried the following code, as per the project examples: const…
noamt
  • 7,397
  • 2
  • 37
  • 59
4
votes
0 answers

OpenPGP encryption not working between systems

I am relatively new to OpenPGP but I am currently trying to encrypt a message on a users device using OpenPGP.js and decrypt that message using OpenPGP PHP on my server. Both sides can encrypt and decrypt their own messages now - the problem: As…
4
votes
1 answer

OpenPGPJS: Invalid session key for decryption

OpenPGP JS throws the following error when I attempt to decrypt some armored data with my private key: Uncaught (in promise) Error: Error decrypting message: Invalid session key for decryption. at onError (openpgp.min.js:16057) onError @…
goldfinch
  • 41
  • 2
3
votes
1 answer

Encrypt a stream after a transform using openpgp

I'm using the below pipeline to stream data from Aurora, transform it to csv, and send it to S3. Readable knex stream: const getQueryStream = (organizationId) => db.select('*') .from('users') .where('organization_id', organizationId) …
navig8tr
  • 1,724
  • 8
  • 31
  • 69
3
votes
1 answer

Node openpgp error when encrypting: Could not find valid key packet for encryption in key

I have a error when trying to encrypt a string with a pgp public key: 'Could not find valid key packet for encryption in key 9ae788ff8eec0b31' This error doesn't appear with every key but with most of them. Here one of the keys that…
Pjotr Raskolnikov
  • 1,558
  • 2
  • 15
  • 27
2
votes
1 answer

I keep getting errors while trying to encrypt a message using Openpgp.js

I have generated keys using Openpgp.js and I got the following key as public key: publicKey: "-----BEGIN PGP PUBLIC KEY…
2
votes
0 answers

Nodejs S3 upload list[0]" argument must be an instance of Buffer or Uint8Array

I'm using openpgp.js to encrypt a s3 getObject stream. After the encryption I try to upload the encrypted stream using s3.upload() which results in the error: S3 upload list[0]" argument must be an instance of Buffer or Uint8Array The error only…
Matthias Herrmann
  • 2,650
  • 5
  • 32
  • 66
2
votes
0 answers

openpgp.decrypt returning empty string when running on jest

I have the following function, I am using TypeScript and the library OpenPGP JS import * as openpgp from "openpgp"; export async function decryptMessage( privateKeyArmored: string, passphrase: string, encrypted: string ) { const { keys:…
Rodrigo
  • 135
  • 4
  • 45
  • 107
2
votes
1 answer

Error: concatUint8Array: Data must be in the form of a Uint8Array

I am using Jest to test a small function of mine that makes use of OpenPGP.js https://openpgpjs.org/ (the latest version, 4.10.9). I saw some workarounds using the library text-encoding-utf-8 and I did this on my tests, but unfortunately, the error…
Rodrigo
  • 135
  • 4
  • 45
  • 107
2
votes
1 answer

OpenPGP.js - Getting an error: "Error decrypting message: Session key decryption failed."

Here is some of the code using openpgp.js: const privKeyObj = (await openpgp.key.readArmored(privkey)).keys[0]; await privKeyObj.decrypt(passphrase); options = { message: await openpgp.message.readArmored(encryptedData), privateKeys:…
jocca
  • 21
  • 1
  • 3
2
votes
3 answers

How to generate random password?

I need to generate a random password that will be used in OpenPGP.js to encrypt something symmetrically. The user should never have to touch or see the password (everything happens behind the scenes). Thus, ideally the password would just be a…
HelloWorld
  • 3,381
  • 5
  • 32
  • 58
1
2 3 4 5