def KSA(key: bytes) -> list:
    """
    Key Scheduling algorithm
    is the first process in rc4. It
    returns an 'extended' key which
    has a higher enthropy then the
    simple concatenation.

    params:
        key: IV + Wi-Fi password
    returns:
        list of bytes, 'extended' key
    """
    table = list(range(256))
    y = 0

    for x in range(256):
        y = (y + table[x] + key[x % len(key)]) % 256
        table[x], table[y] = table[y], table[x]

    return table