def __key_expansion(key):
    """
        Input: key - String

        Output: extendedkey - String

        This method extends the key to the desired length using hash methods.
    """
    import hashlib
    extendedkey = ''
    keyhash = key
    for _ in range(32):
        keyhash = hashlib.sha224(keyhash.encode('utf-8')).hexdigest()
        extendedkey += keyhash
    extendedkey = extendedkey[:256]
    return extendedkey
