Code Monkey home page Code Monkey logo

browserpgp.github.io's Introduction

browserPGP Logo

browserPGP

A website that makes using PGP simple and secure. All work is done client side, so no private data leaves your computer.

If you want to be extra secure, disable internet while using this site.

  • ar0n#1462

browserpgp.github.io's People

Contributors

ar00n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

haxwire vaginessa

browserpgp.github.io's Issues

encrypt and decrypt zip file

I am able to encrypt and decrypt the contents of a text file using the browserPGP tool.
This is my encryption code. I am not including the input of key from a textbox.

const publicKeys = await Promise.all(publicKeysArmored.map(armoredKey => openpgp.readKey({ armoredKey }))); 
var blob = new Blob(["Lorem Ipsum is simply dummy text of the printing and typesetting industry. "], { type: "text/plain;charset=utf-8" });
//saveAs(blob,'decrypted.txt');
 
  var file = new File([blob], "plaintext.txt", { type: "text/plain", });
  var fileReader = new FileReader();
  
  fileReader.onload = function() 
  {
        const message = await openpgp.createMessage({ text: fileReader.result}); 
        const encrypted = await openpgp.encrypt(
        {        
           message, 
           encryptionKeys: publicKeys
        });        
         var blob3 = new Blob([encrypted],{type: 'text/plain'} );    
         saveAs(blob3, 'encrypted.txt'); 
  }
  fileReader.readAsText(file);
}

However, I am not able to encrypt and decrypt a zip file. The decrypted zip file is always corrupt.
I use the same code, but convert the zip file contents into plaintext, which I think is not a good idea.

var zipFile = new JSZip();
zipFile.file("Metadata.txt", 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. ');

var plaintextbytes = new Uint8Array(zipFile);
var plainTextString = new TextDecoder().decode(plaintextbytes);
const message = await openpgp.createMessage({ text: plainTextString });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.