A friend asked me to look at a puzzle at the hiring page of a company he was applying to. Here is my attempt to the problem. Haven't seen the problem before, so I am not sure if I solved it completely, but sharing my attempt here.
A zipped folder containing a text file and 2 images with following content.
In [69]:
GivenString = "GGCTACTAACATGCCTTTCAACTTCCAGGGTTACTGTCAGGGTACTTATGCTCGCATTTACAAGGGCCCTACTCACTGTCAGAAGGGCTTTGGTCTTCAGGGCAATTCAAAAGAGAACCTACCGATCAATCCATCAGAGAACGAGCTTGGATGTGATACCCCTCACGCAGAAACGGCAGTTTGCATGTGGCGCGACAAAGCACCGCTTACGGAATGGATGTCGGGTGTCCGGGATACACTACTGGCTATAACATTCTGTATCAAGGCTCGGGTCGTATGGGTTAGGATGAGGTAGATCTAGAAGCTTTTCTTCCAGGGCCTCTTTTCTACGAGCGAGCCGCGATACACTCAGAATTGCAGCGTACCCTTTCTTGGATTTAACCAAATAAGCATTACCATCTAAACCATAGATATCAATAAACTGAAATGACACCTGCCGTCGGTTCTACCCGATGCGAATGGTTGAATCCGACGCAATTGACGATTCCAGGCCGGGGCACTATGCAGACGCAAAACCAAAATTTGTAATACATGCGCGGGATGCGGTGTAGAGATCTTTAGACGCTAGCCGCTCGGAAAATGTGTTGGTTTTGCCCGTCAGGGCCCTACTCAGGGTCATGGTAATATTGATTAGACGGGTCCCTGCTTCTCGGGCCACCTGGGTTAGGGTTCCAGCCCGTCCAATAGCTAGGTTTTTGATTATAATGCGGGTTACCCGGGTTATACTGACACTGCCCGCTACTATAAAATTCTCCACTGTCATCGTAACCCGAATCTCTTTGATTCTCACTTACTGTCGACGGCTCGGTTCTTCCAAGCACTGCA"
print(len(GivenString))
Provided string is a multiple of three. Seems promising. Lets build a hashmap out of the wheel provided. What seems apparent is outmost letter is encoded by sequence of letters from center to periphery (or vice versa).
In [70]:
import string
charlist = [chr(9658), chr(9608)]+ \
list(string.ascii_uppercase)+ \
list([str(x) for x in range(10)])+ \
list("~!@#$%^&*()-+{}\/<>,.?:;` ")
x = 'TCAG'
symbollist = [k+j+i for k in x for j in x for i in x]
mapping = dict(zip(symbollist, charlist))
Now that we have a hashmap. Lets try to decode the string provided.
In [71]:
DecodedString = ''
for i in range(0,len(GivenString),3):
decode = mapping[GivenString[i:i+3]]
DecodedString += decode
In [72]:
DecodedString
Out[72]:
Not quite perfect, but you can make out some words
"YOU ARE HALFWAY THERE."
"LVE THE ENIGMA"
"DROP US A █ZT-YJQ:►MAIL AT AHMXLVQQI@CUREFIT.COM"
Now I am no cryptography expert, but given they have some nice bunch of keys in one of the images, next logical step is to try out enigma cipher. A simple google search leads you to these nice folks by the name of Practical Cryptography.
They have an online tool to encrypt/decrypt things with enigma. I tried multiple parts of above string in their website. What I think is a possible solution is to decode part in the e-mail address.
Seems alright. I guess I have got the e-mail address alright. Didn't try sending them e-mail yet. Didn't try solving the meaning of rest of the sentence as well. If any of you figure it out, let me know in the comments.