Skip to main content
Challenges Check with modular arithmetic
Reverse engineering Easy Modular arithmetic Solves: 8

Check with modular arithmetic

Author: CyberSamSU
Points
18

Many crackme programs "encrypt" each character using a single linear formula: v = (kod * a + b) mod 256, where kod is the ASCII code of the character, a and b are constant numbers given in the program.

To reverse this, a modular inverse is needed: the inverse of a modulo mod 256 is a_inv such that (a * a_inv) mod 256 == 1. In Python 3.8+, this can be found with a single call: a_inv = pow(a, -1, 256).

Given: a = 67, b = 86. Recover each character from the following sequence of v values:

156 89 161 204 3 137 135 204 175 216 51 221 99 130 209 32 56 13

Formula: kod = ((v - b) * a_inv) mod 256, then chr(kod).

Theory: learn the topic
Learning paths: Reverse engineering 101
Hints 2
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −1 pts Log in
Hint 2 −3 pts Log in
To submit a flag, log in.

First solvers

1. Qodirxon Yoqubjonov 18.09.2026
2. Faxriddin Oripov 02.10.2026
3. Абдул 09.10.2026
4. Максим Мухлади 24.10.2026
5. Mirjaxon Qaxxarov 27.10.2026
6. Odam 04.11.2026
7. Username08 07.11.2026
8. Doston Allayarov 12.11.2026