|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.security.AbstractStringEncryption
com.jcorporate.expresso.core.security.strongencryption.StringEncryption
StringEncryption.java
Copyright 2000, 2001 Jcorporate Ltd.
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.
Byte Array Format Information:
An encrypted string has the following format:
Byte 0: File Version Number(whole number only)
Bytes 1-6: 3 character desgination for the encryption mode used. UTF-16 BE
Bytes 7-14/22: The 8/16 byte random input vector to the encrypted system.
Bytes 15+/23++ : The Actual Encrypted Data
| Field Summary | |
protected static ByteArrayCounter |
ivCounter128
|
protected static ByteArrayCounter |
ivCounter64
|
| Constructor Summary | |
StringEncryption()
class for encapsulating encryption. |
|
| Method Summary | |
byte[] |
decrypt(byte[] inputData)
Same as decryptString, but only deals in byte arrays. |
void |
destroy()
Unregisters the cryptographic handler |
byte[] |
encrypt(byte[] inputData)
Same as encryptString, but only deals in byte arrays. |
byte[] |
encrypt(byte[] inputData,
String theShortCipherString)
Encrypts a byte array of data based upon the method desired. |
void |
init()
|
| Methods inherited from class com.jcorporate.expresso.core.security.AbstractStringEncryption |
decryptString, encryptString, getCryptoManager, getPreparedPassKey, preparePassKey, setCryptoManager |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static ByteArrayCounter ivCounter64
protected static ByteArrayCounter ivCounter128
| Constructor Detail |
public StringEncryption()
| Method Detail |
public void init()
throws ChainedException
init in class AbstractStringEncryptionChainedExceptionpublic void destroy()
destroy in class AbstractStringEncryption
public byte[] decrypt(byte[] inputData)
throws ChainedException
decrypt in class AbstractStringEncryptioninputData - The input data to decrypt
ChainedException - Upn encryption error
public byte[] encrypt(byte[] inputData,
String theShortCipherString)
throws ChainedException
inputData - The data to encrypttheShortCipherString - The 'short name' of the cipher to use
ChainedException - Upon error encrypting
public byte[] encrypt(byte[] inputData)
throws ChainedException
encrypt in class AbstractStringEncryptioninputData - The data to encrypt
ChainedException
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||