Web Cipher
Abstract
Web Cipher is a client-side, cryptographically secure document encryptiontechnology. It allows even an inexperienced web author to establish virtuallyuncrackable safety measures on confidential data. Web Cipher is also fast,substantially overcoming the problem of speed in browser-based cryptology. Itaverages almost 15K per second in real-world tests on an iMac 333 MHz computer,much faster than similar utilities.
Also see
- Before you use
- Choosing a good key
- How it works
- Disclaimer
- Test page (the key is cipher123)
Documentation
What the controls mean
- Script source
- The default value of the script source is 'cipher.js'. For a Web Cipher documentto work, you'll need the cipher.js file in the locationspecified in this box. What this usually means is that you'll put it in the samedirectory/folder as your Web Cipher protected document. Advanced users may wishto change this, however. See Before you use.
- Key
- This control is at the heart of the encryption process. Your key functions asa password to your data, blocking unauthorized access. Read Choosing a good key.
- Open in new window
- When you click View/Extract Document, the original source is shown in yourbrowser. This option is used to control whether it displays in the originalbrowser window or a popup.
Each of the buttons performs a specific function. When the action iscomplete the text in the Content box changes. Progress is shown in the statusbar.
- Encipher
- This performs the encryption process on your data. By using this functionalone you can use the security of Web Cipher for other purposes.
- Decipher
- This is the reverse of Encipher. Enter the key, then click Decipher todecrypt an encrypted Web Cipher message.
- Protect Document
- Clicking this will encrypt your data and wrap it inside of a stand-aloneHTML document ready to be uploaded to the Web. Read the instructions for more information.
- Clicking this will remove the HTML wrapper from a Web Cipher document,and attempt to decrypt it. If successful it will show the original sourcein the Content box as well as in your browser window. It acts as a sort ofdecoder and/or preview.
Before you use
You will need the script file cipher.jsin order to use Web Cipher. The generated HTML page will reference this fileaccording to the entry in the "Script source" box. If you are going to beusing Web Cipher on numerous documents, it would be smart to store the scriptfile in one place (e.g. /cipher.js), and change the "Script source" to reflectthat location.
- Avoid unnecessary encryption! Encryption is a drastic andvery unfriendly thing to do. Please think carefully before you use it.
- Test your pages. Some browsers don't support the scriptsnecessary for Web Cipher. Others have *bugs* that interfere with the encryptionof certain characters. In order for Web Cipher to work, you must use a browserthat doesn't have this problem, or use entity references for those characters.
Choosing a good key
A key is the lock on your data. The security of the lock is based ultimatelyon your choice of key. Using a repetitive key (like '----') or an easilyguessed one (like your mother's maiden name) can defeat even the best encryptiontechnique.
- The longer the better. (At least if you remember it!)
- Be unusual. Don't use common words or typical things(like your pet's name) for the key.
- Arbitrary is good. The best keys are based on essentiallyrandom data. If possible, use a something totally irrelevant for the key, orbetter yet, think of about 10-15 random letters/numbers/symbols for each key.
- Don't use the same key all the time! If you do, it'll takejust one break to break everything. Change keys as often as possible.
How it works
The document is broken into 64-byte segments. Each segment is encipheredusing a 1-byte random salt combined with your key. Additionally, each byte isconverted to base-16 to ensure the returning of transfer-safe values. An eight-bitchecksum of the password is stored to reduce the hassle of entering the wrong key.
o = output stringc = input stringk = key stringl = length of stringn = character numberr = salto[0..l-1] = c[0..l-1] ^ r ^ k[n % l]
Disclaimer
Web Cipher is offered as is, without warranty. Use at your own risk.
Based on JavaScript by Joseph Myers, e_mayilme@hotmail.com.