|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cryptix.BlockCipher | +--cryptix.IDEA
IDEA is a block cipher with a key length of 16 bytes and a block length of 8 bytes. It is highly popular, being the original cipher in PGP, and has received a lot of cryptanalytic attention.
References
IDEA was written by Dr. X. Lai and Prof. J. Massey. See the IDEA page for more details. The algorithm is subject to patent claims by Ascom Systec Ltd (applied for May 1991) and is licensable.
Field Summary | |
static int |
BLOCK_LENGTH
The length of a block - DEPRECATED - use blockLength() instead. |
static int |
KEY_LENGTH
The length of a the user key - DEPRECATED - use keyLength() instead. |
Constructor Summary | |
IDEA(byte[] userKey)
Create an IDEA block cipher from a key in a byte array. |
Method Summary | |
protected void |
blockDecrypt(byte[] in,
int in_offset,
byte[] out,
int out_offset)
Perform a decryption in the extended class. |
protected void |
blockEncrypt(byte[] in,
int in_offset,
byte[] out,
int out_offset)
Perform an encryption in the extended class. |
int |
blockLength()
Return the block length of this cipher. |
static java.lang.String |
getLinkErrorString()
|
static boolean |
hasFileLibraryLoaded()
|
static boolean |
isLibraryCorrect()
|
int |
keyLength()
Return the key length of this cipher. |
static void |
main(java.lang.String[] argv)
Entry point for self_test . |
void |
native_dks()
Place marker, untested, unworking. |
void |
native_encrypt(byte[] in,
int in_offset,
byte[] out,
int out_offset,
int[] key)
Place marker, untested, unworking. |
void |
native_ks(byte[] userKey)
Place marker, untested, unworking. |
static void |
self_test(java.io.PrintStream out,
java.lang.String[] argv)
Runs algorithm through test data. |
Methods inherited from class cryptix.BlockCipher |
decrypt, decrypt, decrypt, encrypt, encrypt, encrypt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int BLOCK_LENGTH
public static final int KEY_LENGTH
Constructor Detail |
public IDEA(byte[] userKey)
userKey
- the user key in a byte[ keyLength() ] arrayCryptoError
- if length of key array is wrongMethod Detail |
public static final boolean hasFileLibraryLoaded()
public static final boolean isLibraryCorrect()
public static final java.lang.String getLinkErrorString()
public int blockLength()
blockLength
in class BlockCipher
public int keyLength()
keyLength
in class BlockCipher
protected void blockEncrypt(byte[] in, int in_offset, byte[] out, int out_offset)
BlockCipher
in
is encrypted
from in_offset
to (in_offset + blockLength - 1)
and the ciphertext
is written into out
from out_offset
to (out_offset + blockLength - 1)
Note that there will be at least blockLength bytes left in each
array at the supplied offsets, this is checked in the superclass.
The in
and out
buffers can be the same.
blockEncrypt
in class BlockCipher
cryptix.BlockCipher
in
- buffer holding the plaintext to be encryptedin_offset
- the start of plaintext within in
out
- buffer to hold the encrypted ciphertext resultout_offset
- the start of cyphertext within out
protected void blockDecrypt(byte[] in, int in_offset, byte[] out, int out_offset)
BlockCipher
in
is decrypted
from in_offset
to (in_offset + blockLength - 1)
and the plaintext
is written into out
from out_offset
to (out_offset + blockLength - 1)
Note that there will be at least blockLength bytes left in each
array at the supplied offsets, this is checked in the superclass.
The in
and out
buffers can be the same.
blockDecrypt
in class BlockCipher
cryptix.BlockCipher
in
- buffer holding the cyphertext to be decryptedin_offset
- the start of cyphertext within in
out
- buffer to hold the decrypted plaintext resultout_offset
- the start of plaintext within out
public void native_ks(byte[] userKey)
public void native_dks()
public void native_encrypt(byte[] in, int in_offset, byte[] out, int out_offset, int[] key)
public static final void main(java.lang.String[] argv)
self_test
.public static void self_test(java.io.PrintStream out, java.lang.String[] argv) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |