Here comes the coding , the code is available in two languages Java and Python ( which is a hacker language 🙂 )
I feel comfortable coding in python as it is very easy 😛 and here is the question
You see the doors to the loading bay of the hangar, but they are locked. However, you are able to extract the password verification program from the control panel… Can you find the password to gain access to the loading bay?
Here are my links in case the above one doesn’t work ( after some time)
Here is the code for better view
#!/usr/bin/env python user_submitted = raw_input("Enter Password: ") if len(user_submitted) != 10: print "Wrong" exit() verify_arr = [193, 35, 9, 33, 1, 9, 3, 33, 9, 225] user_arr =  for char in user_submitted: # '<<' is left bit shift # '>>' is right bit # '|' is bit-wise or # '^' is bit-wise xor # '&' is bit-wise and user_arr.append( (((ord(char) << 5) | (ord(char) >> 3)) ^ 111) & 255 ) if (user_arr == verify_arr): print "Success" else: print "Wrong"
I hope that everyone has a basic idea about the left shift and the right shift in C language , the same applies here.
I was a bit lazy to do the calculation so I have written a small script to get the answers , first to write the script we need to understand the code a bit so that it makes easy for us and saves a lot of time. If you look at the code that verifies the password. we can clearly say that it’s length is 10 as the code verifies whether the length of the password is 10 if not it doesn’t execute.
Here is my script in python:https://drive.google.com/file/d/0BxDZABox5hT2eFdZN3k1NGFaZFk/edit?usp=sharing
This is very easy I checked for the ascii values which matches the to the password then it save it in the array (in python list ) and then add it and print here is the code
verify_arr = [193,35,9,33,1,9,3,33,9,225] password =[0,0,0,0,0,0,0,0,0,0] for i in range(10): for k in range (128): if verify_arr[i]==(((k<<5|k>>3)^111)&255): password[i]=chr(k) break key='' for a in password: key+=a print key
If you interpret (run) the code and the magic happens and you get the code
Here you go coding saved our day . I need not do all the left shift and the bit wise stuff 🙂