Encryption/Programming Challange

The fear of every surveillance society: citizens protecting their own privacy with strong cryptography

Encryption/Programming Challange

Post by Th3_M4d_H4tt3r on Sat Aug 17, 2013 3:55 am
([msg=76893]see Encryption/Programming Challange[/msg])

I hope this gets turned into an HTS mission, cuz' I have a little challenge for you guys, I made my own encryption in python using a number based "key".

here is the code I used to encrypt it:
Code: Select all
password=list("test123")

def encrypt(password):
   count = 0
   encrypted_password = ""
   for x in password:
      password[count] = x
      count = count+1
   for i in range(0, len(password)):
      try:
         encrypted_password = encrypted_password + password[i] + password[i+3]
         if encrypted_password+encrypted_password==password:
            break
      except:
         break
   print encrypted_password

encrypt(password)

this is my encrypted message:
Code: Select all
Y0o
u    efnuccrkyipntge dd_ipda sistw!o!r!d.  =T h"i"s
   mfeosrs axg ei nw apsa sesnwcorrydp:t
e   d    puassisnwgo rtdh[icso ucnotd]e :=

xd
e   f    ceonucnrty p=t (cpoausnstw+o1r
d   )f:o
r    cio uinnt  r=a n0g
e   (e0n,c rlyepnt(epda_spsawsosrwdo)r)d:
=       "t"r
y   :f
o   r       xe nicnr yppatsesdw_oprads:s
w   o   rpda s=s weonrcdr[ycpotuendt_]p a=s sxw
o   r   dc o+u npta s=s wcoorudn[ti+]1
+    fpoars siw oirnd [ria+n1g5e](
0   ,       liefn (epnacsrsywpotredd)_)p:a
s   s   wtorryd:+
e   n   c   reynpctreydp_tpeads_spwaosrsdw=o=rpda s=s weonrcdr:y
p   t   e   d   _bpraesaskw
o   r   de x+c eppats:s
w   o   r   db[rie]a k+
   pparsisnwto redn[cir+y1p5t]e
d   _   p   aisfs weonrcdr
y
petnecdr_yppats(spwaosrsdw+oerndc)


Try to reverse-engineer the code and post the message.

Good luck HTS!
Tip me if I helped you!
BTC Address: 15wu8gxFAemZH3jC4km3Z8gMYtKHLxpnEv
User avatar
Th3_M4d_H4tt3r
Experienced User
Experienced User
 
Posts: 54
Joined: Tue Jun 18, 2013 8:25 am
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by Tentra on Sat Aug 17, 2013 8:29 pm
([msg=76898]see Re: Encryption/Programming Challange[/msg])

I don't understand your code.

What is the purpose of this:
Code: Select all
for x in password:
   password[count] = x
   count = count+1


Your code seems to try an generate a more secure password using "test123" as a seed, however, where is the data actually encrypted using the password?

Was the plaintext passed into the `encrypt` function which resulted in the ciphertext you posted?
User avatar
Tentra
Poster
Poster
 
Posts: 161
Joined: Wed Apr 30, 2008 4:52 pm
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by Th3_M4d_H4tt3r on Mon Aug 19, 2013 1:44 pm
([msg=76907]see Re: Encryption/Programming Challange[/msg])

No, what I did is encrypted some plain-text; and posted the results; test123 what a test in the program. The program was original designed to recongnize a pattern (<- HINT), but it encrypted it instead.
Tip me if I helped you!
BTC Address: 15wu8gxFAemZH3jC4km3Z8gMYtKHLxpnEv
User avatar
Th3_M4d_H4tt3r
Experienced User
Experienced User
 
Posts: 54
Joined: Tue Jun 18, 2013 8:25 am
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by Goatboy on Thu Aug 22, 2013 8:22 am
([msg=76964]see Re: Encryption/Programming Challange[/msg])

I won't post the results, but apparently I "fucking did it!!!"

Looks like you didn't post the entire encrypted output though. Part of the message I deciphered was cut off (middle of line 12 of deciphered output) but I got the gist.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2823
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by Th3_M4d_H4tt3r on Thu Aug 22, 2013 11:15 am
([msg=76972]see Re: Encryption/Programming Challange[/msg])

Wow, good job! how did you decode it?
Tip me if I helped you!
BTC Address: 15wu8gxFAemZH3jC4km3Z8gMYtKHLxpnEv
User avatar
Th3_M4d_H4tt3r
Experienced User
Experienced User
 
Posts: 54
Joined: Tue Jun 18, 2013 8:25 am
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by Goatboy on Thu Aug 22, 2013 11:54 am
([msg=76974]see Re: Encryption/Programming Challange[/msg])

I looked at it for about 5 seconds and erased every other character. The repeated exclamation points and overall layout tipped me off right away.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2823
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by DrRoach on Thu Aug 22, 2013 12:58 pm
([msg=76975]see Re: Encryption/Programming Challange[/msg])

Not a bad encryption figured most of it out from a glimpse just being a pain but I wouldn't recommended adding passwords in text as an encryption because people will always be able to figure it out especially in some cases where people have reading disorders like dyslexia for example it could just jump out at them :P but yeah cool encryption I like it ;)
DrRoach
Poster
Poster
 
Posts: 155
Joined: Fri Feb 22, 2013 6:53 pm
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by mShred on Thu Aug 22, 2013 6:51 pm
([msg=76981]see Re: Encryption/Programming Challange[/msg])

Lol, this was actually a little interesting. But Goatboy is right, after you look at it, you can basically depict it out. And looking at your script, you should be able to read what's going on.
I posted a little script to decrypt it below, as long as that's alright of course.

Code: Select all
<?php

        error_reporting(0);

        $t = str_split(file_get_contents('t.txt'),1);

        for($i=0; $i<(count($t)); $i++)
        {
                if((($i % 2) == 0) && (($t[$i] . $t[$i+1]) != '  ' ))
                {
                        echo($t[$i]);
                }
        }

        echo("\r\n");

?>
Image

For those about to rock.
User avatar
mShred
Administrator
Administrator
 
Posts: 1749
Joined: Tue Jun 22, 2010 4:22 pm
Blog: View Blog (2)


Re: Encryption/Programming Challange

Post by Kataclysmic on Wed Oct 09, 2013 11:08 pm
([msg=77645]see Re: Encryption/Programming Challange[/msg])

I am currently doing something in python to decrypt it, but I am compelled to tell you that the
Code: Select all
for x in password:
      password[count] = x
      count = count+1

is pointless and does not change the outcome of your program.

-- Wed Oct 09, 2013 11:30 pm --

Goatboy wrote:I won't post the results, but apparently I "fucking did it!!!"

Looks like you didn't post the entire encrypted output though. Part of the message I deciphered was cut off (middle of line 12 of deciphered output) but I got the gist.

The reason it is cut off it because of the method of breaking the loop. Once it tries to do + password[i+3] when i+3 > len(password) it causes and error which breaks the loop and the message will not be encrypted from that point on giving only a partial message.

-- Thu Oct 10, 2013 12:26 am --

alright here is my code that I used to decrypt the message. very simple.
Code: Select all
def decrypt(password):
    decrypted_password = password[0::2]
    decrypted_password += password[-5]+password[-3]+password[-1]
    return "".join(decrypted_password)
http://lawofcode.com
What will you learn?
Kataclysmic
New User
New User
 
Posts: 27
Joined: Wed Oct 09, 2013 10:15 pm
Blog: View Blog (0)


Re: Encryption/Programming Challange

Post by WallShadow on Mon Oct 21, 2013 12:37 am
([msg=77788]see Re: Encryption/Programming Challange[/msg])

sorry for necro, i just can't pass up a cryptography challenge just like that.

it was an easy vertical transposition cipher with a key of 2. an automatic transposition cracker picked it up in less than a minute. although the code formatting didn't go over well with the cracker :(
User avatar
WallShadow
Contributor
Contributor
 
Posts: 601
Joined: Tue Mar 06, 2012 9:37 pm
Blog: View Blog (0)


Next

Return to Crypto

Who is online

Users browsing this forum: No registered users and 0 guests