Javascript cryptography library to sign form data in browser

clyfe picture clyfe · Nov 14, 2010 · Viewed 8.9k times · Source

I am looking for a JS crypto lib (similar to, say, OpenSSL's libcrypto) that facilitates digital signing of data in the browser.
I want to sign form form data on the client side using a private key (RSA, PKI certificates or similar).

EXAMPLE

  1. Form data loads in browser
  2. User A reviews data and signs it => the signature is created in the browser using the js lib and the private key signature=RSA_encrypt(A_private_key, hash(data))
  3. The form data and signature is sent to the server and stored

  4. Another user (B) can check the validity of the signature by comparing hash(data) with RSA_decrypt(A_public_key, signature) If someone alters the form data the signature will no longer be valid.

EDIT

https://developer.mozilla.org/en/javascript_crypto
http://www.hanewin.net/encrypt
http://tomas.styblo.name/cryptoapplet/

VIA APPLETS
Best way to sign data in web form with user certificate
! => http://www.nakov.com/research/documents-signing/digital-document-signing-in-java-based-web-applications/
http://www.nakov.com/research/documents-signing/
http://www.developer.com/java/other/article.php/10936_3587361_1
http://www.developer.com/java/web/article.php/3083161
http://blogs.nologin.es/rickyepoderi/index.php?/archives/12-Signature-Applet.html

RELATED
http://ccff02.minfin.fgov.be/CCFF_Authentication/views/login/signature/signatureHelp.html
http://msdn.microsoft.com/en-us/library/cc778518%28VS.85%29.aspx

Answer

Evan Moran picture Evan Moran · Nov 15, 2010

This library should help.

website: http://www.ohdave.com/rsa/ library: http://www.ohdave.com/rsa/RSA.js