Poly1305 tag without knowing ChaCha20_Key
from flask import Flask, make_response, request from Crypto.Util.number import * from Crypto.Cipher import ChaCha20_Poly1305 import secrets import requests import hashlib CHACHA_KEY = secrets.token_bytes(32) app = Flask(__name__) encrypted_text = [] @app.route(‘/api’, methods=[‘POST’]) def api(): try: pkt = request.headers.get(‘pkt’) msg = bytes.fromhex(pkt) nonce = b”random_text_Lorem_ipsum_sim_ahmet_next_ales” nonce = hashlib.sha256(msg[:32] + nonce[:32]).digest()[:12] cipher = ChaCha20_Poly1305.new(key=CHACHA_KEY, nonce=nonce) ct, tag = […]