@Override
    public void setKey(String key) throws Exception {

        byte[] keyB = key.getBytes();

        if (keyB == null) {
            throw new RuntimeException("Invalid key: Key was null");
        }
        if (keyB.length < 16) {
            throw new RuntimeException("Invalid key: Length was less than 16 bytes");
        }
        for (int off = 0, i = 0; i < 4; i++) {
            S[i] = ((keyB[off++] & 0xff))
                    | ((keyB[off++] & 0xff) << 8)
                    | ((keyB[off++] & 0xff) << 16)
                    | ((keyB[off++] & 0xff) << 24);
        }
    }