Multiply the position of alphabet(starting with one)with'size of plaintext'anddomod26.

now left shift the PT every alphabet with their corresponding value

Example forHEN encryption scheme:

Plaintext:I_AM

Size of plaintext:3

Ciphertext:F_UD

So, we need to solve the alphametic puzzle first to retrieve the letters of ciphertext. Also, notice that underscores are ignored both calculating the size and the position in the example given. There are lots of websites that solve alphametic puzzles. Let’s use one of them and retrieve the solution.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

The following alphametic puzzle:

ZCUKZ

+NPYFG

------

GFUKPH

has1solution inbase10.

It is:

80638C=0F=2G=1H=9K=3N=4P=5U=6Y=7Z=8

+45721

------

126359

Now, we can convert the numerical cipher to alphabetical cipher.

1

2

082_336_88_167755403

CZF_KKU_ZZ_GUYYPPNCK

Now, we need to right shift every character by (position * size) % 26.

Here is the python script I created for the task.

decrypt.py

Python

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

#!/usr/bin/env python

alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'

cipher='CZF_KKU_ZZ_GUYYPPNCK'

size=17

pos=0

plain=''

foriinxrange(len(cipher)):

ifcipher[i]=='_':

plain+='_'

else:

pos+=1

shift=pos*size

newpos=(ord(cipher[i])-ord('A')+shift)%26

plain+=alphabet[newpos]

print'xiomara{'+plain+'}'

Let’s run the script and get the flag.

1

2

$python decrypt.py

xiomara{THE_ARS_OF_DIDUCTION}

Here is the flag xiomara{THE_ARS_OF_DIDUCTION}.

Umut Barış Öztunç

Security researcher who participates in Capture The Flag events, also the founder of BreakPoint CTF team.