CTF WriteupsJoepardy

CipherTextCTF v2 Writeups Crypto

The Eighth Circle Of Hell Encryption – Crypto

Solution:

After a clumsy search on challenge name “The Eighth Circle Of
Hell Encryption” you will find Malbolge esoteric programming
language ( https://en.wikipedia.org/wiki/Malbolge ) and this table for its
encrypted version :

text=['84','68','46','108','0','46','107','3','','1','89','','4','86','_','3','89','0','42','3','117','1','125','_','46','4','86','107','77','4','1
 07','3']

alph={'0':'a','1':'b','2':'c','3':'d','4':'e','5':'f','6':'g','7':'h','8':'i','9':'j','10':'k','11':'l','12':'m','13':'n','14':'o','15':'p','16':'q','17':'r','18':'s','19':'t','20':'u','21':'v','22':'w','23':'x','24':'y','25':'z'}

malp={'57':'0','109':'1','60':'2','46':'3','84':'4','86':'5','97':'6','99':'7','96':'8','117':'9','89':'10','42':'11','77':'12','75':'13','39':'14','88':'15','126':'16','120':'17','68':'18','108':'19','125':'20','82':'21','69':'22','111':'23','107':'24','78':'25'}

cipher=""

for i in text:
    if i in malp:
        cipher+=alph[malp[i]]
    else:
        cipher+=i
print(cipher)

Using your good eyes on the cipher text and the table any one
could figure out that numbers with value less than 9 and the ‘_’
symbol cant be found on the table so they aren’t encrypted!
Other numbers are encrypted using the table. Our alphabets are
26 characters and the cipher text don’t have any ‘Encrypted’
number with result more than 25 so the encryption is done using
a map of 0 to 25 mapped using the table above and 0 to 25
number refer to the 26 alphabet characters so with a little python
code you will solve the challenge. The code is:

then you will get an unfamiliar text that is weird and scary:
esdt0dy3_1k_4f_3k0l3j1u_d4fym4y3
so what the heck is this text?

After running a bit of substitution ciphers, Ceaser Cipher (key = 18) in particular, you will get this readable text:
malb0lg3_1s_4n_3s0t3r1c_l4ngu4g3

Carmichael – Crypto

Cipher text: gevcyr_qrf_pna_or_qbar_jvgu_nyy_nytbevguzf

Solution 1:

After seeing “code” file content we realize the encryption is done
using Ceaser cipher in “enc” and “dec” functions, triple DES style,
3 keys where used also but the keys are missing.
So, with a fuzzy search on challenge name “Carmichael” we find
this page ( https://en.wikipedia.org/wiki/List_of_OEIS_sequences ) and

And by using first 3 numbers { 561, 1105, 1729 } as keys you can use the code ( enc(dec(enc(c,k[0]),k[1]),k[2]) ) to encrypt anything and by
reversing the code you will get ( dec(enc(dec(c,k[2]),k[1]),k[0]) ) as
decryption and solve it to get the flag:
triple_des_can_be_done_with_all_algorithms.

Solution 2:

To get keys you can also brute force them.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close