Tags: binary dna crypto encoding 

Rating: 0

For this challenge, we are given a txt file.

Link: https://github.com/joeyjon123/riftCTF/blob/master/Cryptochall3.txt

The file contains the following string:

From our biology lessons, we recognize that this is a string of DNA Codons. The hint also contained lyrics to DNA, a song/rap by Kendrick Lamar.

Looking up DNA encryption/decryption techniques, we find that A, C, G, and T are all mapped to binary values. When combined, they form a binary string which should decode to the flag.

We first tried using the standard mappings:
A(0) – 00 | T(1) – 01 | C(2) – 10 | G(3) – 11

Resulting binary string:

When we translate this to ASCII, we do not get a valid string. Therefore, we decided to start with the flag.

We know the flag begins with riftCTF{ and the first letter is r. Converted to binary, r is 01110010. The first 4 characters of the string we were given are GATC.

Therefore, we tried to solve using these mappings:
T(0) – 00 | G(1) – 01 | C(2) – 10 | A(3) – 11

Resulting binary string:

When we translate this to ASCII, we do not get a valid string again. Thus, we decided to reverse every block of 4 characters.

Resulting string:

Repeating the steps as before, we know that CTAG maps to r which maps to 01110010.
We figure out that the mappings for each character are:
A(0) – 00 | C(1) – 01 | G(2) – 10 | T(3) – 11

Resulting binary string:

When we translate this to ASCII, we get riftCTF{S74y_safe_fr0m_C0roN4}.

Flag: riftCTF{S74y_safe_fr0m_C0roN4}