|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.antiaction.digest.MD5
Java implementation of the MD5 digest algorithm described in rfc1321. Based on the reference implementation in C.
Field Summary | |
protected byte[] |
buffer
Buffer for mid block processing. |
protected int |
bufferedbytes
Buffered bytes from previous call. |
protected long |
count
Processed bit count. |
protected static java.lang.String |
hexList
Hexadecimal conversion tabel. |
protected static byte[] |
PADDING
Padding tabel used to block data. |
protected static int |
S11
Constant for MD5Transform routine. |
protected static int |
S12
Constant for MD5Transform routine. |
protected static int |
S13
Constant for MD5Transform routine. |
protected static int |
S14
Constant for MD5Transform routine. |
protected static int |
S21
Constant for MD5Transform routine. |
protected static int |
S22
Constant for MD5Transform routine. |
protected static int |
S23
Constant for MD5Transform routine. |
protected static int |
S24
Constant for MD5Transform routine. |
protected static int |
S31
Constant for MD5Transform routine. |
protected static int |
S32
Constant for MD5Transform routine. |
protected static int |
S33
Constant for MD5Transform routine. |
protected static int |
S34
Constant for MD5Transform routine. |
protected static int |
S41
Constant for MD5Transform routine. |
protected static int |
S42
Constant for MD5Transform routine. |
protected static int |
S43
Constant for MD5Transform routine. |
protected static int |
S44
Constant for MD5Transform routine. |
protected int[] |
state
Transformation states. |
protected int[] |
x
Temporary transformation data. |
Constructor Summary | |
MD5()
Initialize object and state. |
Method Summary | |
static void |
Decode(int[] output,
byte[] input,
int offset,
int len)
Decodes input (unsigned char) into output (UINT4). |
static void |
Encode(byte[] output,
int[] input,
int len)
Encodes input (UINT4) into output (unsigned char). |
protected static int |
F(int x,
int y,
int z)
Basic MD5 function. |
protected static int |
FF(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
Transformations for rounds 1, 2, 3, and 4. |
void |
Final(byte[] digest)
MD5 finalization. |
protected static int |
G(int x,
int y,
int z)
Basic MD5 function. |
protected static int |
GG(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
Transformations for rounds 1, 2, 3, and 4. |
protected static int |
H(int x,
int y,
int z)
Basic MD5 function. |
protected static int |
HH(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
Transformations for rounds 1, 2, 3, and 4. |
protected static int |
I(int x,
int y,
int z)
Basic MD5 function. |
protected static int |
II(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
Transformations for rounds 1, 2, 3, and 4. |
void |
Init()
Initialize state and all internal data structures. |
static java.lang.String |
MDFile(java.io.File infile)
Returns the message digest of the file content. |
static java.lang.String |
MDFile(java.lang.String fname)
Returns the message digest of the file content. |
static java.lang.String |
MDString(byte[] digest)
Returns the string representation of a message digest. |
static java.lang.String |
MDString(java.lang.String s)
Returns the message digest of the string argument. |
protected static int |
ROTATE_LEFT(int x,
int n)
ROTATE_LEFT rotates x left n bits. |
protected void |
Transform(byte[] block,
int offset)
MD5 basic transformation. |
void |
Update(byte[] input,
int inputOffset,
int inputLen)
MD5 block update operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String hexList
protected static final int S11
protected static final int S12
protected static final int S13
protected static final int S14
protected static final int S21
protected static final int S22
protected static final int S23
protected static final int S24
protected static final int S31
protected static final int S32
protected static final int S33
protected static final int S34
protected static final int S41
protected static final int S42
protected static final int S43
protected static final int S44
protected static final byte[] PADDING
protected int[] state
protected long count
protected int[] x
protected byte[] buffer
protected int bufferedbytes
Constructor Detail |
public MD5()
Method Detail |
protected static int F(int x, int y, int z)
protected static int G(int x, int y, int z)
protected static int H(int x, int y, int z)
protected static int I(int x, int y, int z)
protected static int ROTATE_LEFT(int x, int n)
x
- integer to rotate.n
- positions to rotate.protected static int FF(int a, int b, int c, int d, int x, int s, int ac)
protected static int GG(int a, int b, int c, int d, int x, int s, int ac)
protected static int HH(int a, int b, int c, int d, int x, int s, int ac)
protected static int II(int a, int b, int c, int d, int x, int s, int ac)
public static void Decode(int[] output, byte[] input, int offset, int len)
output
- integer array where converted data is stored.input
- byte array with source data.offset
- offset in source data.len
- length of data to convert.public static void Encode(byte[] output, int[] input, int len)
output
- array of bytes where converted data is stored.input
- integer array with source data.offset
- offset in source data.len
- length of data to convert.protected void Transform(byte[] block, int offset)
block
- data to transform.offset
- offset in data.public void Init()
Update(byte[], int, int)
,
Final(byte[])
public void Update(byte[] input, int inputOffset, int inputLen)
input
- byte array of in data.inputOffset
- starting offset.inputLen
- length of data to digest.Init()
,
Final(byte[])
public void Final(byte[] digest)
digest
- array where the digest is to be placed.Init()
,
Update(byte[], int, int)
public static java.lang.String MDString(byte[] digest)
digest
- byte array containing a message digest.public static java.lang.String MDString(java.lang.String s)
s
- string to digest.public static java.lang.String MDFile(java.lang.String fname)
fname
- filename.public static java.lang.String MDFile(java.io.File infile)
infile
- File handle.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |