class MySQLPasswordEncryptor {

    public static byte[] encryptWithMySQL41(final byte[] password, final byte[] seed) throws NoSuchAlgorithmException {
        MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
        byte[] passwordSha1 = messageDigest.digest(password);
        byte[] concatSeed = concatSeed(messageDigest, seed, messageDigest.digest(passwordSha1));
        return xorPassword(passwordSha1, concatSeed);
    }

}