With the current protocols, the designed in mechanism for protecting data is the HTTP authentication mechanism. When you access a site you type in your user name and password and the web site returns your page with your data. Unfortunately if there are any proxy servers, especially any caching proxy servers, between you and your web page then there are copies of your private data sprinkled across the Web.
Java can fix this in a unique way, it can do this by sending both the data, and a program for displaying the data on a single web page. Then when asked, the program (applet) can display the data for the user. This web page has an example of such an applet.
<!-- CipherText : account-summaryThe applet
TextWidgeton this page re-reads the page from the server and searches it for this special comment. When it finds it, it decodes the hex encoded data into binary data and waits for a key to unlock the data.
Password applet on the page simply waits for
the user to type some characters into it and a <CR>. When it
sees the return character it sends the text (unmodified) to the text
widget that then uses it to try to decode the data it is holding.
If the data decodes successfully (there is a checksum embedded in it).
Then the text widget displays the data, otherwise it remains silent.
It is important to note that while the password is sent "in the clear" to the text widget applet, it does so only in the context of the memory space of this web page, the password has not been sent over the network or exposed in any way.
vote4it, just like that. In lower case and the total of seven characters.
Now press enter and watch the box below. Voila' the encrypted text appears as clear text! The really useful thing is that even though this page may be cached on servers all over the net, only a person who knows the right password to type to the password applet will be able to read the data. (actually this text is quite susceptible to cryptanalysis however if you were to use DES-3 as the encryption engine that would not be the case.)
The program to generate the cipher text is called: GenerateCipherText.java.