CTR: reused nonce
SamChat — the laboratory's internal secure messenger. All messages are encrypted with AES-128-CTR: counter block = 8-byte nonce ‖ 8-byte counter (big-endian, starting from 0); key — one for the entire system.
The developers promised to choose the nonce randomly for each message. But after restarting the server, the nonce generator seems to have returned to its old state… You are given a one-day copy of the network log — samchat-trafik.jsonl (on each line: seq, time, from, kind, nonce, ct).
The server sends the kind=hello record every day. Its plaintext is always in this template (the fields are taken from the from and time values of the same line):
SAMCHAT/2.3 HELLO node=<from> date=<time dagi sana, YYYY-MM-DD> status=OK motd="Bugungi xavfsizlik eslatmasi: parollarni hech kimga bermang va ularni muntazam almashtiring!"
Someone sent a new laboratory key in the log. Find the key — the flag in the format BAYROQ{...}.