The link below is encrypted with Shift Cypher of unknown shift::
qcifgsg.srl.cfu/qcifgsg/VofjofrL/QG50l/2014_H1/wbtc
This link will take you to a CS course offered by edx starting 1st Jan, 2014.
The answer to this problem lies in the link below. But this link too is encrypted with the shift used to encrypt the above link. Go to the original link which is encrypted below and you will find your answer there.
uwgh.uwhvip.qca/obcbmacig/8207770
Request and Clarification:
For example, if 'abc123' were to be encypted with Shift Cypher , it will be 'def123' and the shift used to encypt this text is 3 because each letter is shifted by 3 places in aphabetical order.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
A Shift Cipher is the same thing as a Caesar's cipher. Caesar's cipher is a rather vulnerable cipher and can easily be brute-forced as there are only 26 possible passwords or 'shifts'.The python code below prints all of the 27 possibilities,clearly the one with 12 shifts only makes sense.
def caesar(plainText, shift):
plainText = plainText.lower()
for ch in plainText:
if not ch.isalpha():return plainText
if ch.isalpha():
stayInAlphabet = ord(ch) + shift
if stayInAlphabet > ord('z'):
stayInAlphabet -= 26
finalLetter = chr(stayInAlphabet)
cipherText = ""
cipherText += finalLetter
return cipherText
def sc(p,s):
return reduce(lambda x,y:x+y,[caesar(i,s) for i in p])
for i in range(1,27):
print i,sc('qcifgsg.srl.cfu/qcifgsg/VofjofrL/QG50l/2014_H1/wbtc',i),'\n'
Is there a way in another language to check if a website exists, based off of the same logic in this code? It could tell that http://www.google.com/#q=brilliant exists but not iuuq://xxx.hpphmf.dpn/#r=csjmmjbou doesn't.
This code actually doesn't determine if the URL is valid or not , it just prints all the 26 possibilities. It is possible to make such a program though,all you would have to do was use the urllib library in python. Practically go through the possible URLs and send a request to the site and check it if returns an error
The shift for this shift cipher is 14. The link "uwgh.uwhvip.qca/obcbmacig/8207770" contains "qca". It can be "com"/"edu"/"org"/.. . "com" matches with "qca" by 14 shifts. Thus we get "gist.github.com/anonymous/8207770". A B C D E F G H I J K L M N O P Q R S T U V W X Y Z O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
main()
{ int i,j,x=0, a,b,k,n; char s[]="qcifgsg.srl.cfu/qcifgsg/VofjofrL/QG50l/2014_H1/wbtc", c,s2[]="uwgh.uwhvip.qca/obcbmacig/8207770"; a=strlen (s); b=strlen (s2); for(j=1; j<26; j++) { for(i=0; i<a; i++)
{
if( isalpha( s[i] ) )
{
c=s[i]+j;
if(isupper(s[i]) && (s[i]+j>'Z'))
c=c-26;
else if(islower(s[i]) && (s[i]+j>'z'))
c=c-26;
}
else
c=s[i];
if(c=='e' && x==0)
x++;
else if(c=='d' && x==1)
x++;
else if(c=='x' && x==2)
x++;
else x=0;
if(x==3)
n=j;
}
}for(k=0; k<b; k++)
{
if( isalpha( s2[k] ) )
{
c=s2[k]+n;
if(isupper(s2[k]) && (s2[k]+n>'Z'))
c=c-26;
else if(islower(s2[k]) && (s2[k]+n>'z'))
c=c-26;
}
else
c=s2[k];
printf("%c", c);
} }
The shift in this case is 14 because first link must be 'edx' and instead it is 'srl'. In the English alphabet, 'e' is 14 letters away from 's', so all of the other letters in the first link are 14 letters away from the decrypted phrase. Because the second link has the same shift, all of the letters are shifted by 14. So,
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
# inputLink = "uwgh.uwhvip.qca/obcbmacig/8207770"
# outputLink = ""
#
# for s in inputLink.lower():
# if s in l:
# outputLink += l[l.index(s) - 14]
# else:
# outputLink += s
#
# print outputLink
# Edited
# import string
# l = list(string.ascii_lowercase)
# inputLink = "uwgh.uwhvip.qca/obcbmacig/8207770"
# outputLink = ""
#
# for s in inputLink.lower():
# if s in l:
# outputLink += l[l.index(s) - 14]
# else:
# outputLink += s
#
# print outputLink
At first I checked domains of * q c i f g s g . s r l . c f u / q c i f g s g / V o f j o f r L / Q G 5 0 l / 2 0 1 4 H 1 / w b t c * because we know all the domains . Here domains are .srl and .cfu. And I can match .srl to .edu with 14 backward shift and .cfu becomes .org. And this is my code:
import sys
alpha =['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
encriptedURL= "uwgh.uwhvip.qca/obcbmacig/8207770"
for e in encriptedURL:
if e>='a' and e<='z':
index =(alpha.index(e)-14)%26
if (index)<0:
index = index*-1
sys.stdout.write(alpha[index])
else:
sys.stdout.write(e)
After running this code I have Answer .
Problem Loading...
Note Loading...
Set Loading...
The three letters before the slash are usually "com," "org," etc. Notice that the second letter in "qca" is two letters earlier in the alphabet than the third letter, like in "com." Using this, we find the Caesar cipher is +12, meaning A=M, B=N, C=O, etc. Using this on the rest of the code, the full URL is https://gist.github.com/anonymous/8207770 . The first line on that link says the answer is 1 2 3 .
The fourth line will tell you that you are awesome. (Though I think it would have been really funny if "Secret Message" was coded as well.)