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
0
votes
1 answer

How do I troubleshoot decrypting this OpenPGP.js message?

I have a string message called customerPublicKey which I encrypted with OpenPGP.js: const { customerPublicKey} = await openpgp.generateKey({ type: 'rsa', passphrase: contract.passphrase, userIDs: [{ name: 'My Name', email:…
Boris K
  • 3,442
  • 9
  • 48
  • 87
0
votes
0 answers

openpgp.createMessage returns 2 promises in ReadStream; resulting in duplicate PGP armored encrypted files

With Below function, using OpenPGP.js, console.log(testMessage) produces 2 promises As such, the output from fileWriteStream produces PGP armored files which are duplicated/concatenated. Can someone solve this? async function…
0
votes
0 answers

Write openpgp.encrypt stream to S3 not working

I'm trying to push the stream from openpgp.encrypt to an S3 bucket. Typescript reports const encrypted: openpgp.WebStream though it should probably be NodeStream as I'm using nodejs v18 within an AWS Lambda. I'm using openpgpjs…
Dave
  • 7,552
  • 4
  • 22
  • 26
0
votes
0 answers

Add public key to Keystore

I have keystore in windows as below - secretkeys.skr publickeys.pkr I want to add new pgp pubic keys to above keystore. Can someone help me with the command. I tried using some tool and gpg commands but no luck as the keys are not updating in the…
Arpit Gupta
  • 125
  • 1
  • 1
  • 9
0
votes
1 answer

OpenPGP: Why Generate Key Name and Email are mandatory?

On Openpgp.js, in order to generate the encryption keys, the name and the email properties are mandatory: await generateKey({ curve: 'brainpoolP512r1', userIDs: [{ name: 'Test', email: 'test@test.com' }] }); In a project I'd like to use OpenPGP…
John
  • 321
  • 2
  • 12
0
votes
1 answer

Misformed armored text when loading Message from Stream Openpgp.js

I have a Job handling the execution of a decryption job in the background. This is the code for the decryption: export default async function ( job: Job, cb: DoneCallback, ) { console.log( `[${process.pid}] Attempting…
0
votes
1 answer

OpenPGP.js says elgamal keys are considered too weak

We are using PGP encryption to encrypt files before transfer. We are using the npm package OpenPGP.js to encrypt the files using a public key from the recipient. I have exported the public key in armored format to use with openpgp.encrypt…
navig8tr
  • 1,724
  • 8
  • 31
  • 69
0
votes
1 answer

Generating public private keys from openpgp

I have the following code and I'm trying to generate public-private key: const openpgp = require("openpgp") const generateKeyPair = async () => { const { publicKeyArmored } = await openpgp.generateKey({ userIds: [ { name:…
john
  • 11
  • 5
0
votes
0 answers

PGP key decryption Error with openpgp - TypeError: Cannot read property 'type' of null at SecretKey.decrypt

I am trying to decrypt one PGP file with OpenPGP javascript library. I am getting one error on the private key decryption TypeError: Cannot read property 'type' of null at SecretKey.decrypt Here is my code snippet let privateKey = (await…
Jay Dadhaniya
  • 171
  • 4
  • 15
0
votes
1 answer

How to get the public key ID/Fingerprint from a detatched signature in OpenPGP.js

import * as openpgp from "openpgp"; let detatchedSignature = "-----BEGIN PGP SIGNATURE----- insert signature here -----END PGP SIGNATURE-----"; openpgp.readSignature({ armoredSignature: detatchedSignature, }).then((sig: openpgp.Signature) => { …
Dan
  • 179
  • 1
  • 1
  • 13
0
votes
1 answer

Can't encrypt the string in OpenPGP.js

I am trying encrypt text with OpenPGP.js. Here is an example of error: https://jsfiddle.net/7e2s516d/ let publicKeyArmored = `-----BEGIN PGP PUBLIC KEY…
Sow
  • 25
  • 4
0
votes
0 answers

OpenPGP js returns [object Object] on message decryption

I'm trying to decrypt messages with the decrypt function in OpenPGP.js but the 'data' field on the returned object only contains [object Object]. I've tried JSON.stringify but that does nothing. I've read the docs and it says that the 'data' field…
B.R.
  • 36
  • 1
  • 1
0
votes
1 answer

Why does verification of a detached signature result in a "Message digest did not match" error for OpenPGP.js?

I can sign and verify a test file through gpg without issue, but verifying the signature through OpenGPG.js fails with the error, "Message digest did not match." Why is this? $ gpg --armor --quiet --batch --yes --detach-sig index.html $ gpg --verify…
cqcallaw
  • 1,463
  • 3
  • 18
  • 29
0
votes
0 answers

How do return statements with double parentheses work?

Inside the OpenPGP.js module is this line of code: return (0, _message.createVerificationObjects) (signatureList, [literalDataPacket], keys, date, true) 1. createVerificationObjects is a function so I assume the following parenthetic are the…
CuriousCat
  • 205
  • 1
  • 2
  • 5
0
votes
1 answer

Openpgp.js can't decrypt pgp message

I'm using openpgp.js version 2.2.1. So I've managed to encrypt a message just fine const options = { data: voteObject.option, // input as Message object publicKeys: (pgp.key.readArmored(pubkey)).keys, // for…
chef
  • 11
  • 1
  • 2