First you need to generate a key pair. (Actually, it's a trio.) This is the slowest part. Pick how large a key you want. Larger keys are more secure, but take longer to generate, and somewhat longer to use (especially decrypting the orders). 512 bit key modulos (32 byte keys, ie p and q are 256 bits each) are still considered somewhat secure. My browser took almost 6 minutes to generate a key of this size. Try a smaller one first, like 8 bytes and multiply that time by 4 to see how long it might take for you.
Encrypting the orders takes very little time, maybe a second or two, but those decrypting will notice a definate lag (22 seconds for me).
Note that many browsers require you to NOT cancel the script after it is taking a while to generate the keys. I've tested this on InternetExplorer 5 (win). If you find it works/doesn't work with another browser, let me know. I've been told that Netscape is much slower than Microsoft for this type of thing.
Generate a key trio. For example, when I did I got:
Put a copy of crypto.js on your hard drive and on the server. Then add the
following to your public script on your server:
And put the following in your private script (probably on your local hard
disk -- not on the internet -- if your private key is found this whole thing is
useless.)
Ok, so you might want to do something more interesting than just put the data into document.form.text.value (this assumes you have a <form name="form"> in your document, by the way).
Enjoy!
John