public static final byte[] scramble411(byte[] pass, byte[] seed) throws NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance("SHA-1");
        byte[] pass1 = md.digest(pass);
        md.reset();
        byte[] pass2 = md.digest(pass1);
        md.reset();
        md.update(seed);
        byte[] pass3 = md.digest(pass2);
        for (int i = 0; i < pass3.length; i++) {
            pass3[i] = (byte) (pass3[i] ^ pass1[i]);
        }
        return pass3;
    }
@Test
    public void testScramble411() throws NoSuchAlgorithmException {
        byte[] bytes1 = new byte[]{90, 11, -19, 60, 27, -27, 22, 92,
                -38, 4, 40, -62, -100, 74, 17, 6, 115, -37, -119, -126};

        byte[] bytes2 = new byte[]{-101, -23, 45, 38, -113, 65, -12,
                -55, 106, 25, -88, 107, 66, 59, -104, 11, -63, 110, -23, 83};

        Assert.assertArrayEquals(bytes1, MySQLPasswordEncrypter
                .scramble411(new byte[0], new byte[0]));
        Assert.assertArrayEquals(bytes2, MySQLPasswordEncrypter
                .scramble411(
                        new byte[]{1, 2, 3, 4, 5, 6, 7, 8}, new byte[]{1, 1}));
    }