Forgot your password?
typodupeerror
Encryption Programming Security IT

OpenPGP Implemented In JavaScript 167

Posted by Unknown Lamer
from the what-won't-someone-do-next dept.
angry tapir writes with this excerpt from Tech World: "Researchers from German security firm Recurity Labs have released a JavaScript implementation of the OpenPGP specification that allows users to encrypt and decrypt webmail messages. Called GPG4Browsers, the tool functions as an extension for Google Chrome and now is capable of working with GMail." A quick gander at the source leaves me with the impression that it should be more or less portable to other browsers. It's also built using a lot of off-the-shelf Javascript libraries. (Who knew Javascript had a bignum library and a number of cipher implementations?)
This discussion has been archived. No new comments can be posted.

OpenPGP Implemented In JavaScript

Comments Filter:
  • by Anonymous Coward on Tuesday November 22, 2011 @06:57AM (#38133860)

    http://www.matasano.com/articles/javascript-cryptography/

  • Key management (Score:4, Interesting)

    by DrXym (126579) on Tuesday November 22, 2011 @07:09AM (#38133918)
    So where do the keys get stored? If it's the HTML web storage, does that mean that you can only store keys per domain? Is that even advisable? And what stops a compromised site from lifting your keys while it's about encrypting or signing a message for you?

    I think for reasons of trust that if you were to use js PGP that it should be from a browser extension that could be reviewed and be within your control to some extent. Or better yet if the js became a core part of a browser where the code could be implicitly trusted. I'd love to see something like Firefox support go further and use a lib like this so unsigned certs could instead describe a web of trust via PGP and modify the manner in which Firefox presents such certs to a user. CAs are the biggest racket on the web and are IMO the biggest impediment to https being the default protocol for web activity.

  • Re:Who knew? (Score:5, Interesting)

    by Anonymous Coward on Tuesday November 22, 2011 @07:37AM (#38134030)

    The short book, JavaScript: The Good Parts, by Douglas Crockford ....

  • Re:Who knew? (Score:5, Interesting)

    by slim (1652) <`ten.puntrah' `ta' `nhoj'> on Tuesday November 22, 2011 @08:17AM (#38134214) Homepage

    It can't be done. The problem is that the language itself is so horribly broken that anything built upon it, be it libraries, applications, tutorials or books, will inherently be horrible, too. JavaScript just can't be salvaged. It needs to be discarded.

    I used to think this, but I don't any more. The aforementioned Crockford book is the bible on this.

    There is a "pleasant" Javascript community, and what they have done is to separate Javascript into three parts:
      - the good parts -- use them
      - the bad parts -- avoid using them altogether
      - the missing parts -- build acceptable workarounds to these using what's available

    For example, Javascript has a horrible tendency for scripts to pollute the global variable namespace. The community came up with the CommonJS module convention, which solves the problem rather neatly.

  • by Anonymous Coward on Tuesday November 22, 2011 @08:23AM (#38134256)

    Generally speaking, porting cryptographic implementations between systems is not as easy as "do both implementations produce the same output for the many test inputs tried?".

    Proper implementations will mitigate against side channel attacks by:

    • Ensuring loops within crypto implementations execute in constant time regardless of the input (both plaintext and key)
    • Ensuring keypresses are obtained on a poll cycle as opposed to being handled on each interrupt (if the key is inputted via keyboard)
    • Ensuring that keypresses are sent securely from the kernel to a lightweight userspace application that performs the encryption/decryption
    • Avoiding the storage of key material or plaintext in memory where upon deallocation (this could occur without the application having a chance to exit gracefully and overwrite the memory), another process can read the now-free memory region to obtain the key or plaintext
    • Ensuring there is no doubt as to the validity and trustworthiness of passphrase prompts

    I'm skeptical as to whether a web browser implementation (in JavaScript, not part of the browser itself) can address the issues listed above.

  • Re:Who knew? (Score:4, Interesting)

    by aztracker1 (702135) on Tuesday November 22, 2011 @11:17AM (#38135806) Homepage
    I'm afraid I have to agree on this one... Recently a programmer was let go because he simply couldn't creatively code his way out of a paper bag. Of course now I'm stuck picking up the slack, but 1/3 of my time was spent helping the other guy, and most of what he got done is what I actually did.

FORTRAN is for pipe stress freaks and crystallography weenies.

Working...