def METHOD_NAME(cls, secret: bytes, key: bytes):
    """Python implementation of SystemFunction005.
    Decrypts a block of data with DES using given key.
    Note that key can be longer than 7 bytes."""
    decrypted_data = b""
    j = 0  # key index
    for i in range(0, len(secret), 8):
        enc_block = secret[i : i + 8]
        block_key = key[j : j + 7]
        des_key = hashdump.Hashdump.sidbytes_to_key(block_key)
        des = DES.new(des_key, DES.MODE_ECB)
        enc_block = enc_block + b"\x00" * int(abs(8 - len(enc_block)) % 8)
        decrypted_data += des.decrypt(
            enc_block
        )  # lgtm [py/weak-cryptographic-algorithm]
        j += 7
        if len(key[j : j + 7]) < 7:
            j = len(key[j : j + 7])
    (dec_data_len,) = unpack("<L", decrypted_data[:4])
    return decrypted_data[8 : 8 + dec_data_len]