| java.lang.Object com.mysql.jdbc.Security
Security | class Security (Code) | | Methods for doing secure authentication with MySQL-4.1 and newer.
author: Mark Matthews version: $Id: Security.java 3726 2005-05-19 15:52:24Z mmatthews $ |
createKeyFromOldPassword | static byte[] createKeyFromOldPassword(String passwd) throws NoSuchAlgorithmException(Code) | | Creates key from old password to decode scramble Used in 4.1
authentication with passwords stored pre-4.1 hashing.
Parameters: passwd - the password to create the key from 20 byte generated key throws: NoSuchAlgorithmException - if the message digest 'SHA-1' is not available. |
getBinaryPassword | static byte[] getBinaryPassword(int[] salt, boolean usingNewPasswords) throws NoSuchAlgorithmException(Code) | | DOCUMENT ME!
Parameters: salt - DOCUMENT ME! Parameters: usingNewPasswords - DOCUMENT ME! DOCUMENT ME! throws: NoSuchAlgorithmException - if the message digest 'SHA-1' is not available. |
makeScrambledPassword | static String makeScrambledPassword(String password) throws NoSuchAlgorithmException(Code) | | Creates password to be stored in user database from raw string.
Handles Pre-MySQL 4.1 passwords.
Parameters: password - plaintext password scrambled password throws: NoSuchAlgorithmException - if the message digest 'SHA-1' is not available. |
passwordCrypt | static void passwordCrypt(byte[] from, byte[] to, byte[] password, int length)(Code) | | Encrypt/Decrypt function used for password encryption in authentication
Simple XOR is used here but it is OK as we crypt random strings
Parameters: from - IN Data for encryption Parameters: to - OUT Encrypt data to the buffer (may be the same) Parameters: password - IN Password used for encryption (same length) Parameters: length - IN Length of data to encrypt |
passwordHashStage1 | static byte[] passwordHashStage1(String password) throws NoSuchAlgorithmException(Code) | | Stage one password hashing, used in MySQL 4.1 password handling
Parameters: password - plaintext password stage one hash of password throws: NoSuchAlgorithmException - if the message digest 'SHA-1' is not available. |
passwordHashStage2 | static byte[] passwordHashStage2(byte[] hashedPassword, byte[] salt) throws NoSuchAlgorithmException(Code) | | Stage two password hashing used in MySQL 4.1 password handling
Parameters: hash - from passwordHashStage1 Parameters: salt - salt used for stage two hashing result of stage two password hash throws: NoSuchAlgorithmException - if the message digest 'SHA-1' is not available. |
|
|