Cannot Decrypt Zip Files #1219
Replies: 3 comments 2 replies
-
You cannot use fromText() for ZIP files, as they aren't text. Look for a function called fromBinary() or similar. |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to decrypt a zip.gpg file which I am first downloading and then trying to decrypt and then trying to store it in the indexeddb of the browser as a blob. But what I am not able to understand is how do I pass the downloaded file in the message parameter of decrypt. And in what way should I read the blob file. Thanks you |
Beta Was this translation helpful? Give feedback.
-
Hey 👋 In v5, you need to pass something like: await openpgp.readMessage({
binaryMessage: uint8Array
}) |
Beta Was this translation helpful? Give feedback.
-
I am getting incorrect zip file while trying to decrypt the zip file while this is working fine for csv files.
const options = {
message: openpgp.message.fromText((await stream).Body.toString()),
publicKeys: (await openpgp.key.readArmored(public_key.Value)).keys,
armor: false
};
console.log(" options are ", options)
const encrypted = await openpgp.encrypt(options);
Beta Was this translation helpful? Give feedback.
All reactions