com.compoze.util
Class IdeaCipher
java.lang.Object
com.compoze.util.IdeaCipher
public class IdeaCipher
- extends java.lang.Object
Method Summary |
int |
blockSize()
|
byte[] |
decrypt(byte[] cipherText)
Encrypts some cleartext to a new byte array with ciphertext. |
void |
decrypt(byte[] cipherText,
byte[] clearText)
|
void |
decrypt(byte[] cipherText,
int cipherOff,
byte[] clearText,
int clearOff)
|
byte[] |
encrypt(byte[] clearText)
Encrypts some cleartext to a new byte array with ciphertext. |
void |
encrypt(byte[] clearText,
byte[] cipherText)
|
void |
encrypt(byte[] clearText,
int clearOff,
byte[] cipherText,
int cipherOff)
|
static byte[] |
getBytesFromLong(long lLong)
Get an array of bytes from a long. |
static long |
getLongFromBytes(byte[] byteArray)
|
int |
keySize()
|
static void |
main(java.lang.String[] args)
|
byte[] |
makeKey(java.lang.String keyStr)
|
void |
setKey(byte[] key)
|
void |
setKey(java.lang.String keyStr)
|
static void |
spreadShortsToBytes(int[] inShorts,
int inOff,
byte[] outBytes,
int outOff,
int shortLen)
|
static void |
squashBytesToShorts(byte[] inBytes,
int inOff,
int[] outShorts,
int outOff,
int shortLen)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
blockSize
public int blockSize
keySize
public int keySize
IdeaCipher
public IdeaCipher()
- Constructor.
IdeaCipher
public IdeaCipher(int keySize,
int blockSize)
IdeaCipher
public IdeaCipher(java.lang.String keyStr)
IdeaCipher
public IdeaCipher(byte[] key)
blockSize
public int blockSize()
encrypt
public void encrypt(byte[] clearText,
byte[] cipherText)
decrypt
public void decrypt(byte[] cipherText,
byte[] clearText)
setKey
public void setKey(byte[] key)
encrypt
public byte[] encrypt(byte[] clearText)
throws java.io.IOException
- Encrypts some cleartext to a new byte array with ciphertext.
- Throws:
java.io.IOException
decrypt
public byte[] decrypt(byte[] cipherText)
throws java.io.IOException
- Encrypts some cleartext to a new byte array with ciphertext.
- Throws:
java.io.IOException
encrypt
public void encrypt(byte[] clearText,
int clearOff,
byte[] cipherText,
int cipherOff)
decrypt
public void decrypt(byte[] cipherText,
int cipherOff,
byte[] clearText,
int clearOff)
keySize
public int keySize()
setKey
public void setKey(java.lang.String keyStr)
makeKey
public byte[] makeKey(java.lang.String keyStr)
squashBytesToShorts
public static void squashBytesToShorts(byte[] inBytes,
int inOff,
int[] outShorts,
int outOff,
int shortLen)
spreadShortsToBytes
public static void spreadShortsToBytes(int[] inShorts,
int inOff,
byte[] outBytes,
int outOff,
int shortLen)
getLongFromBytes
public static long getLongFromBytes(byte[] byteArray)
getBytesFromLong
public static byte[] getBytesFromLong(long lLong)
- Get an array of bytes from a long.
- Parameters:
lLong
- the long
- Returns:
- the array of bytes
main
public static void main(java.lang.String[] args)
Copyright ©1999-2008 Oracle All rights reserved.