From 636e8b1382194b9be8c4f03caf11378b33d6640d Mon Sep 17 00:00:00 2001
From: cbonar This library provides specifications and basic functions to add encryption to HTML form elements. It does not contain cryptographic functions ; it's more a 'user-friendly' wrapper
- around cryptographic functions, dedicated to securing web forms.
- It has 2 layers :
-
-
-
-
This way you define a simple encryption on all password fields of a form, that will take place when it is submitted.
-
-<HEAD>
-...
-<SCRIPT type="text/javascript">
- // pubKey is defined elsewhere : it is the public key used by the default RSA encoder
- var mycipher = new {@link Ciform.Cipher Ciform.Cipher}({'pubKey':pubkey});
-</SCRIPT>
-...
-</HEAD>
-...
-<FORM action="http://myserver/mypage.php" onsubmit="javascript:mycipher.{@link Ciform.Cipher#encryptForm encryptForm}(this,{'allowTypes':"password"});">
-...
-
-
- You can use several {@link Ciform.Cipher Ciform.Cipher} objects at the same time.
-
-var toServer1 = new {@link Ciform.Cipher Ciform.Cipher}({'pubKey':pubkey1});
-// in the following line the server is not the same one, so the public key is different
-var toServer2 = new {@link Ciform.Cipher Ciform.Cipher}({'pubKey':pubKey2});
-...
-toServer1.encryptForm(document.forms[1]);
-...
-toServer2.encryptField($('#country'));
-
-
-
-
-var ciform = new {@link Ciform.Cipher Ciform.Cipher}({'pubKey':pubkey});
-...
-// encrypts an input field : the encrypted value will replace its current value
-ciform.{@link Ciform.Cipher#encryptField encryptField}(document.getElementById('myFieldId'));
-...
-// encrypts the parameters in a URL (and replaces the original value)
-document.getElementById('anAnchor').href = ciform.{@link Ciform.Cipher#encryptURL encryptURL}(document.getElementById('anAnchor').href);
-
-
- @requires http://www.hanewin.net/encrypt/rsa/base64.js
- @requires http://www.hanewin.net/encrypt/rsa/hex.js
- @requires http://pajhome.org.uk/crypt/md5/sha1.js
- @requires http://www.hanewin.net/encrypt/rsa/rsa.js
- @author cbonar at users dot sf dot net.
-
- For more informations, see http://plugnauth.sourceforge.net/ciform.
-*/
+ * @fileoverview
+ *
+ * This library provides specifications and basic functions to add encryption to HTML form elements.
+ * + * + *Home : http://ciform.googlecode.com
+ * + *It does not contain cryptographic functions ; it's more a 'user-friendly' wrapper + * around cryptographic functions, dedicated to securing web forms. + *
+ * + *It has 2 layers :
This way you define a simple encryption on all password fields of a form, that will take place when it is submitted.
+ *
+ * <HEAD>
+ * ...
+ * <SCRIPT type="text/javascript">
+ * // pubKey is defined elsewhere : it is the public key used by the default RSA encoder
+ * var mycipher = new {@link Ciform.Cipher}({'pubKey':pubkey});
+ * </SCRIPT>
+ * ...
+ * </HEAD>
+ * ...
+ * <FORM action="http://myserver/mypage.php" onsubmit="javascript:mycipher.encryptForm(this,{'allowTypes':"password"});">
+ * ...
+ *
+ *
+ * You can use several {@link Ciform.Cipher} objects at the same time.
+ *
+ * var toServer1 = new {@link Ciform.Cipher}({'pubKey':pubkey1});
+ * // in the following line the server is not the same one, so the public key is different
+ * var toServer2 = new {@link Ciform.Cipher}({'pubKey':pubKey2});
+ * ...
+ * toServer1.encryptForm(document.forms[1]);
+ * ...
+ * toServer2.encryptField($('#country'));
+ *
+ *
+ *
+ *
+ * var ciform = new {@link Ciform.Cipher}({'pubKey':pubkey});
+ * ...
+ * // encrypts an input field : the encrypted value will replace its current value ; see {@link Ciform.Cipher#encryptField}
+ * ciform.encryptField(document.getElementById('myFieldId'));
+ * ...
+ * // encrypts the parameters in a URL (and replaces the original value) : {@link Ciform.Cipher#encryptURL}
+ * document.getElementById('anAnchor').href = ciform.encryptURL(document.getElementById('anAnchor').href);
+ *
+ *
+ * @author nicobo
+ */
@@ -90,6 +87,11 @@ document.getElementById('anAnchor').href = ciform.{@link Ciform.Cipher#encryptUR
NOTE : The first letter is in upper case mainly to prevent errors like using 'ciform' to name a variable,
and because it should also be considered as an Object containing the definitions of this library.
It is not very clean since other namespaces are named with lower case characters, but there's currently no perfect solution in Javascript.
{'encoder':myencoder,'onerror':function(e,context){dosomething()}} to this constructor
- to provide it your custom encoder and a custom error handler.
+ For instance, provide {'encoder':myencoder,'onerror':function(e,context){dosomething()}}
+ to use a custom encoder and a custom error handler.
*/
Ciform.Cipher = function( options )
{
diff --git a/ciform/src/test/js/scrapbook.html b/ciform/src/test/js/scrapbook.html
index 43cd9c5..437f761 100644
--- a/ciform/src/test/js/scrapbook.html
+++ b/ciform/src/test/js/scrapbook.html
@@ -1,11 +1,6 @@
-
-
-
-
-
-
+