eTextReader
Class StringCrypto
java.lang.Object
eTextReader.StringCrypto
public class StringCrypto
- extends java.lang.Object
A class to encrypt and decrypt strings.
The class reads a serialized SecretKey object from
the file Hansens.dat. If the system property etext.KeyFileDirectory is
specified, then it will first try to read the key from that directory.
If the system property is not specified, or reading the key file in that
directory fails, then the current working directory is tried
- Version:
- 1.0 6-30-03
- Author:
- Chris Johnson (special thanks to Addison-Wesley), Ryan McFall
- See Also:
- DesEncrypter
Field Summary |
(package private) javax.crypto.Cipher |
dcipher
|
(package private) javax.crypto.Cipher |
ecipher
|
(package private) javax.crypto.SecretKey |
key
|
private static java.lang.String |
KEY_FILE_NAME
|
Method Summary |
java.lang.String |
decrypt(java.lang.String str)
|
java.lang.String |
encrypt(java.lang.String str)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_FILE_NAME
private static final java.lang.String KEY_FILE_NAME
- See Also:
- Constant Field Values
ecipher
javax.crypto.Cipher ecipher
dcipher
javax.crypto.Cipher dcipher
key
javax.crypto.SecretKey key
StringCrypto
public StringCrypto()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
encrypt
public java.lang.String encrypt(java.lang.String str)
decrypt
public java.lang.String decrypt(java.lang.String str)