Ragnar & Lagertha are two secret agents of Valhalla wants to share a secret message but could not place the trust on basic ciphers so they decided to come up with their own cipher

We have managed to get the ciphertext

:082_336_88_167755403.

So help us and we will reward you with 50 points

Flag is not wrapped in xiomara

so submit in xiomara{youranswer}

Let’s check the given txt file first.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
custom cipher: consists of two parts 1st encryption using HEN encryption algorithm and then encode using a standard alphmetic puzzle the stardard alphametic puzzle used is {ZCUKZ+NPYFG=GFUKPH} HEN encryption: 'size of plaintext' is number of alphabets in plaintext Multiply the position of alphabet (starting with one) with 'size of plaintext' and do mod 26. now left shift the PT every alphabet with their corresponding value Example for HEN 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 has 1 solution in base 10. It is: 80638 C=0 F=2 G=1 H=9 K=3 N=4 P=5 U=6 Y=7 Z=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.

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 = '' for i in xrange(len(cipher)): if cipher[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}.