|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--MD5
Implementation of RSA's MD5 hash generator
| Field Summary | |
(package private) MD5State |
finals
If Final() has been called, finals is set to the current finals state. |
(package private) static byte[] |
padding
Padding for Final() |
(package private) MD5State |
state
MD5 state |
| Constructor Summary | |
MD5()
Class constructor |
|
MD5(java.lang.Object ob)
Initialize class, and update hash with ob.toString() |
|
| Method Summary | |
java.lang.String |
asHex()
Returns 32-character hex representation of this objects hash |
static java.lang.String |
asHex(byte[] hash)
Turns array of bytes into string representing each byte as unsigned hex number. |
java.lang.String |
debugDump()
|
private int[] |
Decode(byte[] buffer,
int len,
int shift)
|
private byte[] |
Encode(int[] input,
int len)
|
private int |
FF(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
byte[] |
Final()
Returns array of bytes (16 bytes) representing hash as of the current state of this object. |
private int |
GG(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
private int |
HH(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
private int |
II(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
void |
Init()
Initialize MD5 internal state (object can be reused just by calling Init() after every Final() |
static java.lang.String |
md5crypt(java.lang.String input)
One-stop md5 string encrypting. |
private int |
rotate_left(int x,
int n)
|
private void |
Transform(MD5State state,
byte[] buffer,
int shift)
|
private int |
uadd(int a,
int b)
|
private int |
uadd(int a,
int b,
int c)
|
private int |
uadd(int a,
int b,
int c,
int d)
|
void |
Update(byte b)
Updates hash with a single byte |
void |
Update(byte[] buffer)
Updates hash with given array of bytes |
void |
Update(byte[] buffer,
int length)
|
void |
Update(byte[] buffer,
int offset,
int length)
Plain update, updates this object |
void |
Update(MD5State stat,
byte[] buffer,
int offset,
int length)
Updates hash with the bytebuffer given (using at maximum length bytes from that buffer) |
void |
Update(java.lang.String s)
Update buffer with given string. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
MD5State state
MD5State finals
static byte[] padding
| Constructor Detail |
public MD5()
public MD5(java.lang.Object ob)
ob - Object, ob.toString() is used to update hash
after initialization| Method Detail |
public void Init()
public java.lang.String debugDump()
private int rotate_left(int x,
int n)
private int uadd(int a,
int b)
private int uadd(int a,
int b,
int c)
private int uadd(int a,
int b,
int c,
int d)
private int FF(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
private int GG(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
private int HH(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
private int II(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
private int[] Decode(byte[] buffer,
int len,
int shift)
private void Transform(MD5State state,
byte[] buffer,
int shift)
public void Update(MD5State stat,
byte[] buffer,
int offset,
int length)
state - Which state is updatedbuffer - Array of bytes to be hashedoffset - Offset to buffer arraylength - Use at maximum `length' bytes (absolute
maximum is buffer.length)
public void Update(byte[] buffer,
int offset,
int length)
public void Update(byte[] buffer,
int length)
public void Update(byte[] buffer)
buffer - Array of bytes to use for updating the hashpublic void Update(byte b)
b - Single byte to update the hashpublic void Update(java.lang.String s)
s - String to be update to hash (is used as
s.getBytes())
private byte[] Encode(int[] input,
int len)
public byte[] Final()
public static java.lang.String asHex(byte[] hash)
hash - Array of bytes to convert to hex-stringpublic java.lang.String asHex()
public static java.lang.String md5crypt(java.lang.String input)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||