Jump to content
kristoffersantiago

brainXploit 5: Crack the code

Recommended Posts

caneacsu

Cipher 1:


PS C:\> $cipher1 = 5, 8, 1, 14, 13, 0, 2, 2, 8, 18, 4, 16, 20, 4, 13, 2, 4



PS C:\> ( $cipher1 | foreach { [char][byte]( 65 + $_ ) } ) -join "" 

FIBONACCISEQUENCE

If you assign the letter A to 0, B to 1 and so on, the sequence results in 'FIBONACCISEQUENCE'. Best guess this is meant to be 'Fibonacci Sequence'

Cipher 2:

Caesar's cipher is one of the most widely known encryption techniques. It comes from Julius Caesar who used a right shift of 3 letters to encrypt his military messages. Doing a left shift of 3, we'll get the original message. 


PS C:\> $cipher2 = 'x', 's', 'k', 'l', 'v', 'v', 'o', 'h', 'h', 'y', 'l', 'h', 'v'



PS C:\> ( $cipher2 | foreach { [char]( [byte][char]$_ - [byte]3 ) } ) -join ""

uphissleevies

This results in 'uphissleevies'. Best guess it's meant to be 'up his sleevies'

Thanks ! 

 

P.S. That's Powershell

P.S.2: You guys could also try technical challenges, some form of CTF. Examples:

                     - web app (hosted on hack.me) with a flaw that needs to be exploited to find a secret token. 

                     - binary to be reverse engineered

                    - sky is the limit :) 

  • Like 1

Share this post


Link to post
Share on other sites
Jens

P.S.2: - 1-Already planned, great idea ;) 

Share this post


Link to post
Share on other sites
MrGrj

Here is my try:


import string





def cipher1():

    x = [5, 8, 1, 14, 13, 0, 2, 2, 8, 18, 4, 16, 20, 4, 13, 2, 4]

    for a in x:

        print(chr(ord('a') + a))





def cipher2(plaintext, shift):

    alphabet = string.ascii_lowercase

    shifted_alphabet = alphabet[shift:] + alphabet[:shift]

    table = str.maketrans(alphabet, shifted_alphabet)

    return plaintext.translate(table)



if __name__ == '__main__':

    cipher1()  # this will print "fibonaccisequence"

    print(cipher2('xsklvvohhylhv', -3))  # this will print "uphissleevies"

It's Python for those who are not familiar with the language. Easy peasy :)

  • Like 1

Share this post


Link to post
Share on other sites
kristoffersantiago

brainXploit5_answer.png

The first cipher involved a simple substitution cipher where each letter was assigned a number starting with A=0, B=1, C=2, and so on. Applying this would give the answer: "FIBONACCISEQUENCE" - a sequence characterized by by the fact that every number after the first two is the sum of the two preceding ones: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The hint refers to the Fibonacci spiral, an approximation of the golden spiral created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling. [1]

The hint gives away the second challenge. Julius Caesar was believed to have used codes that shift each letter to the right or left when sending out military communications. This technique became known as the Caesar cipher[2]. In this example, the letters were moved three places to the right, giving A=X, B=Y, C=Z, D=A, and so on. Using this method would reveal the message: "UPHISSLEEVIES" which is a reference to the old joke: "Where does the general keep his armies?" (apparently, it's because he keeps his ARMS in SLEEVES, so his ARMIES are...yep, up his SLEEVIES) :D

 

@caneacsu and @MrGrj both got it right! 

Share this post


Link to post
Share on other sites
Omega

seems like i'm too late, but still here's my solution :)

#Answer 1
x = [5, 8, 1, 14, 13, 0, 2, 2, 8, 18, 4, 16, 20, 4, 13, 2, 4]
x.each {|x| print (65 + x).chr}
 
#Answer 2
def ceasar(str,n)
    abc = ("a".."z").to_a.join
    abc_rot = abc.chars.rotate(n).join
    str.tr(abc, abc_rot)
end
print ceasar("xsklvvohhylhv", -3)

 

Share this post


Link to post
Share on other sites
Jens

It's never too late Omega, everyone can give it a shot at any time ;)

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×