org.paulneve.wlab.utilities
Class DesEncrypter
java.lang.Object
org.paulneve.wlab.utilities.DesEncrypter
public class DesEncrypter
- extends java.lang.Object
Encrypts/Decrypts strings with DES. Mostly nabbed from
http://www.exampledepot.com/egs/javax.crypto/PassKey.html
The key used is hard coded, so we are not exactly stretching the
boundaries of cryptography here. The intent is simply to
obscufate the HTML and particularly the VNC applet parameter values
to prevent students from getting details of the internal network,
default VNC passwords, etc. There is a corresponding version of this
over in the TightVNC hacked version that decodes the parameters.
Field Summary |
(package private) javax.crypto.Cipher |
dcipher
|
(package private) javax.crypto.Cipher |
ecipher
|
(package private) int |
iterationCount
|
(package private) byte[] |
salt
|
Constructor Summary |
DesEncrypter(java.lang.String passPhrase)
Creates a new encrypter object, with the supplied passPhrase. |
Method Summary |
java.lang.String |
decrypt(java.lang.String str)
Descrypts a string |
java.lang.String |
encrypt(java.lang.String str)
Encrypts a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ecipher
javax.crypto.Cipher ecipher
dcipher
javax.crypto.Cipher dcipher
salt
byte[] salt
iterationCount
int iterationCount
DesEncrypter
public DesEncrypter(java.lang.String passPhrase)
- Creates a new encrypter object, with the supplied passPhrase.
- Parameters:
passPhrase
- a string
encrypt
public java.lang.String encrypt(java.lang.String str)
- Encrypts a string
- Parameters:
str
- string to encrypt
- Returns:
- an ecrypted string
decrypt
public java.lang.String decrypt(java.lang.String str)
- Descrypts a string
- Parameters:
str
- string to decrypt
- Returns:
- decrypted string