rgbCTF-2020

CTF Writeup - https://ctf.rgbsec.xyz/

Home Other writeups of rgbCTF-2020
14 July 2020

A Fine Day

by raghul-rajasekar

It’s a fine day to break some ciphers!

Sujd jd bgxopksbm ljsu tg tqqjgb xjkubo. Tqqjgb xjkubod tob t qvor vq dhidsjshsjvg xjkubo. Jsd nbp xvgdjdsd vq slv ghribod, t tgm i. Sv bgxopks t cbssbo, rhcsjkcp jsd kctxb jg sub tckutibs (dv t=0, i=1, bsx.) ip t, tgm subg tmm i. Qjgtccp stnb suts rvm 26 tgm xvgwbos js itxn jgsv t xutotxsbo.
Sub tqqjgb xjkubo jdg’s obtccp suts dsovgf. Djgxb js’d rvm 26, subob tob vgcp t qbl uhgmobm mjqqbobgs nbpd, lujxu xtg ib btdjcp iohsb qvoxbm. Tgpltp, ubob’d pvho qctf: ofiXSQ{t_qjgb_tqqjgb_xjkubo}

Solution

Looking at the ciphertext, it seems like only alphabets have been replaced with other alphabets, with capital and small letters retaining their case. This led me to suspect that a simple substitution cipher was used. Using https://quipqiup.com/ to crack the cipher, we get the following plaintext containing the flag: This is encrypted with an affine cipher. Affine ciphers are a form of substitution cipher. Its key consists of two numbers, a and b. To encrypt a letter, multiply its place in the alphabet (so a=0, b=1, etc.) by a, and then add b. Finally take that mod 26 and convert it back into a character. The affine cipher isn't really that strong. Since it's mod 26, there are only a few hundred different keys, which can be easily brute forced. Anyway, here's your flag: rgbCTF{a_fine_affine_cipher}

Flag

rgbCTF{a_fine_affine_cipher}
tags: