Crypto CTF 2019

Decode Me! - Crypto [122 pts]

Decode me! D: mb xwhvxw mlnX 4X6AhPLAR4eupSRJ6FLt8AgE6JsLdBRxq57L8IeMyBRHp6IGsmgFIB5E :ztey xam lb lbaH

I reversed the string because it looked like it needed and got Habl bl max yetz: E5BIFgmsGI6pHRByMeI8L75qxRBdLsJ6EgA8tLF6JRSpue4RALPhA6X4 Xnlm wxvhwx bm :D Which by the smiley face I know I did something right. I did rot and closest I found was ROT7 Ohis is the flag: L5IPMntzNP6wOYIfTlP8S75xeYIkSzQ6LnH8aSM6QYZwbl4YHSWoH6E4 Eust decode it :K Some of that was right but the middle was not base64 and capital was wrong so I went back and checked to get the first letter to T and that was ROT12 This is the flag: Q0NURntzSU1wTDNfYlU3X20xeDNkXzV1QnM3aXR1VDEwbl9DMXBoM1J9 Just decode it :P And finally, decode it using base64. Below is the code that helped me do all this.

cipher = "D: mb xwhvxw mlnX 4X6AhPLAR4eupSRJ6FLt8AgE6JsLdBRxq57L8IeMyBRHp6IGsmgFIB5E :ztey xam lb lbaH"
print("Original Cipher: ", cipher)
cipher = cipher[::-1]
print("Cipher Reversed: ", cipher)
decoded_cipher = ""

for i in range(len(cipher)):
    val = ord(cipher[i])
    if cipher[i].isupper():
        val += 12
        if val > ord('Z'):
            val -= 26
        decoded_cipher += chr(val)
    elif cipher[i].islower():
        val += 7
        if val > ord('z'):
            val -= 26
        decoded_cipher += chr(val)
    elif cipher[i].isdigit():
        val = ord('0') + (int(cipher[i])+ 5) % 10
        decoded_cipher += chr(val)
    else:
        decoded_cipher += cipher[i]

print(decoded_cipher)

Flag: CCTF{sIMpL3_bU7_m1x3d_5uBs7ituT10n_C1ph3R}

Last updated