com.jcorporate.expresso.core.security.weakencryption
Class StringEncryption
java.lang.Object
com.jcorporate.expresso.core.security.AbstractStringEncryption
com.jcorporate.expresso.core.security.weakencryption.StringEncryption
- public class StringEncryption
- extends AbstractStringEncryption
This class provides basic string encryption. It'll provide the services of
password whitening and automatic selection of encryption.
Known Vulnerabilities. The actual whitened password remains in memory for
performance sake. An attacker may find the actual password by looking at swap
files looking for Base64 encoded strings. (Not too hard to grep out) but it requires
an attacker to gain access to the swap partition of the server. Do not use this
class for a personal encryption program.
- Author:
- Michael Rimov
|
Method Summary |
byte[] |
decrypt(byte[] inputData)
Same as decryptString, but only deals in byte arrays. |
byte[] |
encrypt(byte[] inputData)
Same as encryptString, but only deals in byte arrays. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ivCounter
protected static ByteArrayCounter ivCounter
StringEncryption
public StringEncryption()
throws ChainedException
- Throws:
ChainedException
decrypt
public byte[] decrypt(byte[] inputData)
throws ChainedException,
IllegalArgumentException
- Same as decryptString, but only deals in byte arrays. This method must be
implemented by descendants of this class.
- Specified by:
decrypt in class AbstractStringEncryption
- Parameters:
inputData - A byte aray of data to decrypt
- Returns:
-
- Throws:
ChainedException - If there's an error decrypting the data
IllegalArgumentException
encrypt
public byte[] encrypt(byte[] inputData)
throws ChainedException,
IllegalArgumentException
- Same as encryptString, but only deals in byte arrays. This must be implemented
by the descendants of this class.
- Specified by:
encrypt in class AbstractStringEncryption
- Parameters:
inputData - A byte array to encrypt
- Returns:
-
- Throws:
ChainedException
IllegalArgumentException
Please see www.jcorporate.com for information about new Expresso releases.