Javascript cryptography library to sign form data in browser [closed]

假装没事ソ 提交于 2019-11-30 11:09:29

问题


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


回答1:


This library should help.

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




回答2:


I've done it in JavaScript for the client-side and Java for the server-side. This is based on Travis Tidwell's implementation.



来源:https://stackoverflow.com/questions/4176574/javascript-cryptography-library-to-sign-form-data-in-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!