views:

283

answers:

1

I'm looking to do some client-side PGP encryption in Javascript. I've found some GPL library scattered on the web, but for obvious reason, I cannot use that code due to licensing issues.

I'm looking for some BSD-like license library that would accomplish the same thing. Anyone know of a library I could use?

+2  A: 

Could you please point me at the GPL Javascript library you've found?

The reason why I am asking is that OpenPGP is not a simple format. As you probably know, it includes a comprehensive key infrastructure mechanism that is quite non-trivial to implement. Besides, cryptographic algorithms used in OpenPGP (in particular, DSA and Elgamal) require long integers maths engine, implementing which in effective way is a kind of time-taking task too. That is why I doubt there could be an effective OpenPGP engine implemented in Javascript (just because of its size -- for instance, the overall size of the source code of one of OpenPGP libraries I am aware of is about 1Mb. It is just hard to imagine a piece of Javascript code of such size, leaving aside the task of interpreting it by a browser).

To perform client-side OpenPGP computations within a browser, it would be more natural to use one of existing component-oriented technologies, such as ActiveX (COM) or Silverlight. There are several related products available on the market. You can easily find them by googling by something like "OpenPGP activex components" / "OpenPGP silverlight components" / ...

Ken Johnson
For the record, numeric formats in JS are long by default, allowing ridiculously large numbers with no extra effort. I've even seen RSA implementations in JS. As mentioned, however, performance is a definite issue due to the complexity of the code.
mattbasta
The set of mathematical operations required by cryptographic algorithms is not limited by basic addition/subtraction/multiplication. The cornerstone operation here is modular exponentiation. Nevertheless, the availability of native long numbers implementation in Javascript surely simplifies the task.
Ken Johnson
http://www.hanewin.net/encrypt/This library is not GPL per say, but it uses some modified GPL code. Therefore cannot be used by my application
Shadow_x99