75 questions
0
votes
0
answers
133
views
Incompatible PGP keys between openpgp.js and pgpy: Error "14 is not a valid HashAlgorithm"
I'm facing an issue when trying to use PGP keys generated by openpgpjs with pgpy in Python. Specifically, I am encountering the following error:
14 is not a valid HashAlgorithm
Here is my openpgpjs ...
0
votes
1
answer
64
views
How to import openpgp.js in Deno?
As OpenPGP.js hasn't published in JSR yet, I need to import it via HTTP if I don't want to clone it to my local. Using:
import 'https://unpkg.com/browse/[email protected]/dist/openpgp.js';
yields:
error: ...
1
vote
0
answers
570
views
Decrypting OpenPGP message in Node.js with private key, but receiving "No decryption key packets found" error
I'm attempting to decrypt an OpenPGP-encrypted message in a Node.js script using the openpgp library. My script runs into an error where the decryption fails with the message:
Decryption failed ...
1
vote
1
answer
96
views
Cannot use OpenPGP.js V6 in the browser: JavaScript module + TypeScript + Vite + SvelteKit
The issue
I am trying to use OpenPGP.js V6 in a webapp made with SvelteKit, TypeScript and Vite.
OpenPGP.js V6 is now declared as a module, and I cannot find a way to import it correctly with my ...
1
vote
1
answer
76
views
Can't get full notations of public key
I try to read my public key with 6 notations from armored text by OpenPGP.js, but I got 4 notations and somehow it has same two notations each.
notations are:
gpg> showpref
[ultimate] (1). ...
1
vote
1
answer
92
views
JavaScript: openpgp is not defined error in Firefox extension content script
Original Question:
Problem Description
I am developing a browser extension that uses OpenPGP.js to encrypt and decrypt selected text on a webpage. The extension works perfectly in Chrome, but I ...
0
votes
0
answers
243
views
Can you explain this mysterious NodeJS openpgp.decrypt failure when using a verification key?
I have an Azure Function running node's openpgp decryption module. It works fine when we decrypt our own files, but we are receiving a file from a third party that is signed with their public key. We ...
0
votes
2
answers
743
views
Large file decryption error on nodejs openpgp
I have a few pgp encrypted binary files in an s3 bucket. I'm trying to decrypt them using a nodejs lambda function. It's working fine for the files which are less than 2 GB in size, but the decryption ...
0
votes
0
answers
117
views
Node JS equivalent of this command using openpgp gpg --recipient <Hex_Key_Id> --armor --always-trust --encrypt test_pwd.txt; rm -f test_pwd.txt
I'm trying to encrypt text using OpenPGP, but it is not similar to the value generated by CLI
Command:
`gpg --recipient <Hex_Key_Id> --armor --always-trust --encrypt test_pwd.txt; rm -f test_pwd....
0
votes
1
answer
1k
views
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....
1
vote
0
answers
146
views
Compatibility between OpenPGP and ObjectivePGP
Building an encrypted system which uses openPGP for keys generation, encryption, decryption for browsers and ObjectivePGP for ios app for the same functions.
The issue I am facing is when I generate ...
1
vote
0
answers
285
views
NodeJS - PGP encryption on top of gzip a text file
File is generated successfully but when trying to open file, it is in invalid gzip format after decryption. Shows error unsupported format and failing to decompress.
zlib.gzip("Hello World", ...
1
vote
1
answer
1k
views
Streaming decrypt using openpgpjs library consumes too much memory for large files
I am using openpgp library to encrypt and decrypt a file inside a React component. Encryption works as expected with less memory usage but decryption takes too much memory.
Library version that I am ...
1
vote
0
answers
61
views
openpgp can't update large file
onmessage = async({data:{blob, privateKey},ports:[port]})=>{
try {
const fileArray = await blob.arrayBuffer();
const uint8 = new Uint8Array(fileArray);
var readableStream = ...
1
vote
0
answers
492
views
How to display prompt dialog with password field for encrypted pdf using openpgpjs?
I am working on a application where I am selecting pdf file from local file and encrypting it with openpgpjs. Though I am able to encrypt the pdf, When I try to open the encrypted pdf in chrome it is ...
2
votes
1
answer
644
views
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 BLOCK-----\n\nxjMEYsTz2BYJKwYBBAHaRw8BAQdAP6YvOhz9VKvV78ELW34Ufn1M10lDrv0k\...
0
votes
1
answer
925
views
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: '[email protected]'...
1
vote
1
answer
939
views
Encrypt a zip file with browserpgp javascript tool
I would like to encrypt a zip file using OpenPGP.js (https://browserpgp.github.io/). All processing needs to be done on the client-side, without involvement of Node.js.
Using the javascript-based ...
0
votes
1
answer
2k
views
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<DecryptionJobPayload>,
cb: ...
1
vote
1
answer
648
views
How to use openpgp.js on node.js (Cloudflare worker) - Error Uncaught ReferenceError: navigator is not defined?
I have a Cloudflare Worker (created from the Typescript template and with the build config barely changed) that needs to use openpgp.js, which as this link shows, is supposed to be supported when ...
1
vote
1
answer
1k
views
Openpgp Encrypt with PGP
I am trying to encrypt a message using PGP but I am getting an error that states:
ReferenceError: TextDecoder is not defined
at Object.decodeUTF8 (node_modules/openpgp/src/util.js:225:21)
...
0
votes
1
answer
1k
views
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 ...
3
votes
1
answer
2k
views
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')...
0
votes
1
answer
1k
views
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 ...
0
votes
0
answers
929
views
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 ...
4
votes
1
answer
3k
views
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 ...
1
vote
0
answers
124
views
How to derive RSA key from PGP key JavaScript?
Can we have JavaScript library to derive RSA public and private keys from PGP public and private keys ?
1
vote
2
answers
1k
views
How to pass parameter message as text in openpgp JS
What I'm trying to do:
get some Azure storage blobs from container DIDE and encrypt them with RSA 2048 and upload them in other container called encrypted-dide
These blobs are downloaded through a ...
0
votes
1
answer
549
views
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({
...
0
votes
1
answer
191
views
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 BLOCK-----
...
0
votes
0
answers
688
views
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 ...
2
votes
0
answers
1k
views
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 ...
2
votes
0
answers
284
views
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,
...
2
votes
1
answer
679
views
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 ...
0
votes
1
answer
1k
views
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 --...
-1
votes
1
answer
2k
views
Unable to PGP Encrypt/Decrypt Excel file using OpenPGP.js
Tried encrypting and decrypting excel files the same way I am doing for csv/txt files but I am not able to.
Encryption
var rawMessage= fs.readFileSync(path)
await openpgp.initWorker({ path: 'openpgp....
3
votes
1
answer
6k
views
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....
1
vote
0
answers
1k
views
Openpgpjs wont read key
I'm trying to encrypt text with OpenPGPJS in react application.
I have a function in react class:
const openpgp = require('openpgp');
...
class XYZ extends React.Component{
...
async encrypt(text, ...
1
vote
0
answers
141
views
How to write a function that uses asynchronous functions and streams?
My initial attempt using streams inside an asynchronous function was this:
const fs = require('fs');
const openpgp = require('openpgp');
const util = require('util');
const readFileAsync = util....
1
vote
0
answers
138
views
Uncaught Expected token < with OpenPGP initWorker using Create React App
I have a Create React App project and am trying to encrypt a string with OpenPGP.js. However, I'm running into an unhandled syntax error.
Assume the pubkey was already generated. I already tried ...
0
votes
0
answers
21
views
How do return statements with double parentheses work? [duplicate]
Inside the OpenPGP.js module is this line of code:
return (0, _message.createVerificationObjects)
(signatureList, [literalDataPacket], keys, date, true)
1.
createVerificationObjects is a ...
1
vote
1
answer
1k
views
Openpgp Encrypt with Multiple Keys
I'm trying to encrypt string with multiple keys but I get that error;
TypeError: Error encrypting message: key.getPrimaryUser is not a function
let pubKey = ['-----BEGIN PGP PUBLIC KEY BLOCK-----\r\...
1
vote
1
answer
501
views
openpgp.initWorker is not a function
Please help...I am trying to get openPGP.js working in an existing ASP.Net MVC Web Application.
I first started by adding the following html script tags:
<script src="@Url.Content("~/Scripts/...
3
votes
1
answer
2k
views
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 ...
1
vote
1
answer
4k
views
Is this a possible way to encrypt a binary file with openpgp.js and how to save the file so it can be also handle 'manual' - in Filebrowser?
I'm trying to read a binary file, to encrypt/decrypt and save/write it.
Comparing the original file with the resulting file of the decryption leads to the same filehash. So I think it's a correct/...
5
votes
1
answer
7k
views
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/...
0
votes
1
answer
5k
views
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....
1
vote
0
answers
60
views
Exactly what all subsections does protonmail.com uses to formulate the final PGP signature?
What all subsections of the raw email does protonmail.com encapsulate to formulate the PGP signature?
I researched a bit and stumbled upon this Q&A thread which describes what all email ...
1
vote
1
answer
308
views
import openpgp in angular2
I am porting an openpgp.js application from Node.js to Angular2. It works fine in Node.js, but in Angular2 I get an error:
TS2305: Module '"/Users/barry/Angular2/keyManager/node_modules/@types/openpgp/...
1
vote
0
answers
132
views
How to create PEM formatted key from email and password?
I am using Hybrid-Crypto.js for playing around with public/private key encryption.
This function creates a random PEM-formatted RSA keypair
// Generate 2048 bit RSA key pair
rsa.generateKeypair(...