| Modifier and Type | Field and Description |
|---|---|
| private static int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static byte[] | |
| public static byte[] | Returns: bytespassword password, byte[] seed seed)Hashing for MySQL-4.1 authentication. |
| public static byte[] | Returns: bytespassword password, byte[] seed seed)Scrambling for caching_sha2_password plugin. |
| public static void | xorString(byte[]
IN Data for encryption from, byte[] OUT Encrypt data to the buffer (may be the same) to, byte[] IN Scramble used for encryption scramble, int IN Length of data to encrypt length)Encrypt/Decrypt function used for password encryption in authentication Simple XOR is used here but it is OK as we encrypt random strings |
| CACHING_SHA2_DIGEST_LENGTH | back to summary |
|---|---|
| private static int CACHING_SHA2_DIGEST_LENGTH | |
| Security | back to summary |
|---|---|
| private Security() Prevent construction. | |
| scramble411 | back to summary |
|---|---|
| public static byte[] scramble411(String password, byte[] seed, String passwordEncoding) | |
| scramble411 | back to summary |
|---|---|
| public static byte[] scramble411(byte[] password, byte[] seed) Hashing for MySQL-4.1 authentication. Algorithm is as follows (c.f. sql/auth/password.c):
SERVER: public_seed=create_random_string()
send(public_seed)
CLIENT: recv(public_seed)
hash_stage1=sha1("password")
hash_stage2=sha1(hash_stage1)
reply=xor(hash_stage1, sha1(public_seed,hash_stage2))
send(reply)
| |
| scrambleCachingSha2 | back to summary |
|---|---|
| public static byte[] scrambleCachingSha2(byte[] password, byte[] seed) throws DigestException Scrambling for caching_sha2_password plugin. Scramble = XOR(SHA2(password), SHA2(SHA2(SHA2(password)), Nonce))
| |
| xorString | back to summary |
|---|---|
| public static void xorString(byte[] from, byte[] to, byte[] scramble, int length) Encrypt/Decrypt function used for password encryption in authentication Simple XOR is used here but it is OK as we encrypt random strings
| |