Challenges
Affine cipher — encryption
Cryptography
Medium
Affine cipher
Solves: 6
Affine cipher — encryption
Author: CyberSamSU
Points
30
The Affine cipher is a generalization of the Caesar cipher. Each letter is first converted to a number (A = 0, B = 1, ..., Z = 25), then the following formula is applied:
E(x) = (a * x + b) mod 26
Here a and b are the key. An important condition: the number a must be coprime with 26 (GCD(a, 26) = 1), otherwise decryption will be impossible. Therefore, there are only 12 variants for a: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25.
This time you need to encrypt. Key: a = 7, b = 12. Plaintext: KRIPTOGRAFIYA.
Place the result (in uppercase, without spaces) into the flag: BAYROQ{KL4SS1K_<shifrmatn>}
To check: the index of the letter K is 10, (7 * 10 + 12) mod 26 = 82 mod 26 = 4 → E.
Theory: learn the topic
To submit a flag, log in.