def init_aes(shared_secret, nonce):
"<STR_LIT>"<EOL>ss = hashlib.sha512(unhexlify(shared_secret)).digest()<EOL>"<STR_LIT>"<EOL>seed = bytes(str(nonce), "<STR_LIT:ascii>") + hexlify(ss)<EOL>seed_digest = hexlify(hashlib.sha512(seed).digest()).decode("<STR_LIT:ascii>")<EOL>"<STR_LIT>"<EOL>key = unhexlify(seed_digest[<NUM_LIT:0>:<NUM_LIT:64>])<EOL>iv = unhexlify(seed_digest[<NUM_LIT:64>:<NUM_LIT>])<EOL>return AES.new(key, AES.MODE_CBC, iv)<EOL>
Initialize AES instance

        :param hex shared_secret: Shared Secret to use as encryption key
        :param int nonce: Random nonce
        :return: AES instance
        :rtype: AES