Skip to main content
Challenges ECB oracle: byte-by-byte recovery
Cryptography Hard Oracle attacks Solves: 7

ECB oracle: byte-by-byte recovery

Author: CyberSamSU
Points
95

Imagine the site appends a secret to your inputted text, encrypts it, and returns the ciphertext:

oracle(x) = AES-ECB-shifrlash(KALIT, PKCS7(x || SIR))

Both the key and the SECRET are unknown to you. But in ECB, each 16-byte block is encrypted independently — and this is exactly what allows recovering the SECRET byte by byte.

Attack idea (for the first byte):

  1. Send x = "AAAAAAAAAAAAAAA" (15 As). The first block will consist of 15 ta A + SIR[0].
  2. Now send x = "AAAAAAAAAAAAAAA" + nomzod and compare the first blocks. The matching candidate is exactly SIR[0].
  3. Once SECRET[0] is known, you find SECRET[1] by sending 14 As, and so on.

We don't have a live server, therefore the responses to all necessary requests have been obtained in advance and written to the attached javoblar.json file. The file is a simple JSON dictionary:

{
  "<so'rov baytlarining SHA-256 hex xeshi>": "<javob shifrmatni hex>",
  ...
}

The requests are stored by hash, because the requests themselves contain the discovered parts of the SECRET — they cannot be left in plaintext. To get the response, search for your request like this: jadval[hashlib.sha256(x).hexdigest()].

The table contains the following requests:

  • b"A" * k, where k = 0..31 — to determine the length of the SECRET;
  • b"A" * (15 - (i % 16)) + SIR[:i] + nomzod — for each i position and each candidate.

Candidate alphabet (the SECRET consists only of these characters): uppercase Latin letters, lowercase Latin letters, numbers and _ { } characters — 65 in total.

Attention: when finding the i-byte, the block number to be compared is equal to i // 16 (32 characters starting from 32*blok in the hex string). Use only the letter A as padding — the table contains exactly such requests.

Attached files
javoblar.json Log in to download
SHA-256 checksums
javoblar.json: f88d41b22f9e1dfb6afbef924db65e4e47f8fa5d9900ce349436b7588f24ba8c
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −9 pts Log in
Hint 2 −19 pts Log in
Hint 3 −28 pts Log in
To submit a flag, log in.

First solvers

1. W.o.X 17.09.2026
2. Лазиз 04.10.2026
3. testrejim 09.10.2026
4. Mirjaxon Qaxxarov 26.10.2026
5. Odam 04.11.2026
6. arcanum 11.11.2026
7. Furqat Turayev 11.11.2026