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
2
votes
0 answers

browserify chokes when requiring openpgp

When I run browserify on a file containing require ('openpgp'), the error message says it cannot find ./config module. Test file: var openpgp = require ('openpgp'); Error message: Error: Cannot find module './config' from…
tgoneil
  • 1,522
  • 3
  • 19
  • 30
2
votes
1 answer

Calculate the key id of public key using openpgp.js

Using OpenPGP.js v1.3.0 I can successfully create a public/private key pair and encrypt/decrypt ok. I am struggling to obtain the key id using this function (found in openpgp.js and public_key.js): /** * Calculates the key id of the key * @return…
user2677034
  • 624
  • 10
  • 20
2
votes
1 answer

OpenPGP.js passing PGP block to javascript variable

I have setup a file using OpenPGP.js which encrypts a message. I need to set the PGP blocks to a javascript variable so i can pass it to the encrypt/decrypt functions. When I paste it in normally it breaks the script as its multiple lines. I have…
user4287915
  • 366
  • 2
  • 11
1
vote
0 answers

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 keys using objectivePGP on my ios app and try to…
Aman Gupta
  • 23
  • 6
1
vote
0 answers

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", async (err, compressedData) => { if (err) { …
1
vote
1 answer

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 using is: 5.7.0 Below is the code sample with…
Sumit Sahoo
  • 2,949
  • 1
  • 25
  • 37
1
vote
0 answers

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 = new ReadableStream({ start(controller) { …
1
vote
0 answers

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 showing dialog with message "Failed to load PDF…
KonTash
  • 158
  • 1
  • 2
  • 15
1
vote
1 answer

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 browserpgp.js, encryption of plaintext file is easy,…
1
vote
1 answer

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 running on Node.js. When I build it with npm run…
Renato
  • 12,940
  • 3
  • 54
  • 85
1
vote
1 answer

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) at Do.read…
Rene Enriquez
  • 1,418
  • 1
  • 13
  • 33
1
vote
0 answers

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 ?
Pand005
  • 1,095
  • 3
  • 23
  • 53
1
vote
2 answers

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 stream(here Microsoft did a good job…
A B
  • 177
  • 1
  • 3
  • 13
1
vote
0 answers

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, targetKey){ await openpgp.initWorker({…
Khan
  • 37
  • 1
  • 3
1
vote
0 answers

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.promisify(require('fs').readFile); const encryptFile…