private static byte[] readPasswordFromHex(String hexPassword) {
        byte[] passwordBytes = new byte[hexPassword.length() / 2];
        for (int i = 0; i < passwordBytes.length; i++) {
            passwordBytes[i] = (byte) Integer.parseInt(hexPassword.substring(2 * i, 2 * i + 2), 16);
        }
        return passwordBytes;
    }