Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

DC's Cryptanalysis challenge 1


ghost's Avatar
0 0

Note: This isn't a real challenge. It has no authority and will not affect your points. That said, it should be fun, and an introduction to the art of cryptanalysis.

What is cryptanalysis you ask? Besides being a cool word, it is the science/art/act of teasing the original message out of the encrypted one, or of breaking encryption.

So, without further ado, I present you with my first cryptanalysis challenge:

The following message has been encrypted using the python code I submitted to the code bank. Unfortunately, the algorithm I used only allows for 255 keys, which isn't very secure. PM me with the password included as part of the message, and I'll post a reply here saying you passed the challenge. Encrypted message (ciphertext)

m3yDv6R9lLKukpe/k5C2wK6djLuuoph6k5GYwKyijL2kopy2pI2MequRn7Gkt7bDrX2bsax8o7Gkkba4q6KcsqyNjLSrkZC+pKHCtqx8f8STkZjDr6KMeqOhf7KskrbEq6KXsaN8srKskcK2rLeutpazjJ+rkZ+xrZGQxK19rsCtt5uxq6KXsZWQfreVt6TArHyUsq2zn7WTw7WH

More will be forthcoming.


richohealey's Avatar
Python Ninja
0 0

it's not in the code bank yet!

a ha ahha ha

and i look forward to it


ghost's Avatar
0 0

Oops. :) you can find and replace tab for an actual tab.

#basic rot 255 base 64 encoded encryption. insecure, for demonstration purposes.
#coded by digital chameleon
import base64
def encrypt(strPlaintext,intKey):
[tab]strPlaintext=base64.b64encode(strPlaintext)
[tab]strCiphertext=''
[tab]for strLetter in strPlaintext:
[tab][tab]try:
[tab][tab][tab]strCiphertext=strCiphertext+chr(ord(strLetter)+intKey)
[tab][tab]except ValueError:
[tab][tab][tab]strCiphertext=strCiphertext+chr((ord(strLetter)+intKey)-256)
[tab]strCiphertext=base64.b64encode(strCiphertext)
[tab]print "'",strCiphertext,"'"
def decrypt(strCiphertext,intKey):
[tab]strPlaintext=''
[tab]try:
[tab][tab]strCiphertext=base64.b64decode(strCiphertext)
[tab][tab]for strLetter in strCiphertext:
[tab][tab][tab]try:
[tab][tab][tab][tab]strPlaintext=strPlaintext+chr(ord(strLetter)-intKey)
[tab][tab][tab]except ValueError:
[tab][tab][tab][tab]strPlaintext=strPlaintext+chr((ord(strLetter)-intKey)+256)
[tab][tab]strPlaintext=base64.b64decode(strPlaintext)
[tab]except TypeError:
[tab][tab]print 'not gonna happen. Wrong key?'
[tab]print "'",strPlaintext,"'"
strPlaintext=raw_input('Encrypt what message? ')
intKey=int(raw_input('Using what key (0-255))? '))
encrypt(strPlaintext,intKey)
strCiphertext=raw_input('Decrypt what message? ')
intKey=int(raw_input('Using what key (1-255))? '))
decrypt(strCiphertext,intKey)



ghost's Avatar
0 0

All you need to do is a brute-force attack for all keys.


ghost's Avatar
0 0

This was a close one. I had three submissions for this challenge yesterday, all within 20 minutes of each other. In third place, we have richohealey at 08:08 C'mon people, we all knew richo could do this. He's a python ninja. In second, by a hair, we have xtrmsk8r91 at 08:04 Can't say I've talked to xtrmsk8r91, but he nailed the answer, and python isn't even his first language! And in first place, to be honored in my sig for the coming month, Nirucesis at 07:53. An up and coming star we have here. Only a member for two days, Nirucesis managed to crack this one wide open.

Anybody who wants the second place in my sig, DC's cryptanalysis challenge #2 is still waiting for somebody to crack it, and I think you'll find it a bit harder than this one.

This challenge is open ended. If anybody wants to complete it, PM me the password and I'll post a thread here confirming it.