SRL Archive - News and General

String Encryt/Decrypt Script Help


turbobk

2010-04-06 07:28:53

Hey Guys,
I have made a scar script that encrypts/decrypts words and/or full sentences and I was wondering would it be crackable or would someone need the original scar code to know how to decrypt it?

Well its not really 'encryption' it substitutes each individual letter/number for another random letter/number and then stores the letters it needs in a .txt file for decryption later on.

So would anyone think its crackable?

This is a string that has been 'encrypted', just to see what it looks like.
*( KRZDB ESAK BXX )* It has to do with SRL ;)

Thanks,
TurboBk. :)

Frement

2010-04-06 07:55:02

Everything is possible :) I would guess that is something like: "hello **** srl" or something, i dunno. Anyways…the decrypthing would take long.

mixster

2010-04-06 08:04:35

Simba owns all

turbobk

2010-04-06 08:07:12

OMFG WTF HOW?

How did you do that so easily mixster? freakin genius! :D

Frement

2010-04-06 08:39:09

From: turbobk
OMFG WTF HOW?

How did you do that so easily mixster? freakin genius! :D


Basicly i could make a generator that makes tries to decrypt it and then see from the list which it would be, but it would take long to compile the list. And even longer to read.

turbobk

2010-04-06 08:43:22

Damn, lol.
I've just made it a bit better it encrypts the string then encrypts the encrypted string again twice. So it should be alot harder to crack now lol.

If mixster or anyone else can figure this out then… WOW! :D
*( RU KLF XHD URBFIK YJRQ LFY YJKD R UHRO JHIE )*

Frement

2010-04-06 09:16:30

From: turbobk
Damn, lol.
I've just made it a bit better it encrypts the string then encrypts the encrypted string again twice. So it should be alot harder to crack now lol.

If mixster or anyone else can figure this out then… WOW! :D
*( RU KLF XHD URBFIK YJRQ LFY YJKD R UHRO JHIE )*


Does it generate the swap table randomly?

Tim0suprem0

2010-04-06 09:31:21

From: turbobk
Damn, lol.
I've just made it a bit better it encrypts the string then encrypts the encrypted string again twice. So it should be alot harder to crack now lol.

If mixster or anyone else can figure this out then… WOW! :D
*( RU KLF XHD URBFIK YJRQ LFY YJKD R UHRO JHIE )*


YOU DO FAIL HARD ;)


Dude encrypting it multiple times doesn't do anything because it still points to the same letter :p Took me about 15 seconds.

turbobk

2010-04-06 10:08:22

Seriously.. how?!? :o

Wizzup?

2010-04-06 10:09:27

I didn't decipher any but it looks like you are using mono substitution. This can be cracked within seconds, literally. :)
http://en.wikipedia.org/wiki/Substitution_cipher


#!/usr/bin/python

from random import random
from sys import argv

def encrypt(s, a= ''):
if a == '':
a = range(ord('A'), ord('Z')+1)
map(lambda x: chr(x), a)
a.sort(lambda x, y: 1 if random() > 0.5 else -1)

res = ''
for c in s:
res = res + a[ord(c) - ord('A')]

return res

if len(argv) > 1:
str = argv[1]
else:
print "Needs moar args"
exit(1)
print encrypt(str, map(lambda x: chr(x), range(ord('Z'), ord('A') - 1, -1)))

Aside from that, you can easily use dictionary attacks. Long words are mostly very easy, and give away the rest.

turbobk

2010-04-06 10:15:33

Oh s**t! really?
Wow I fail… I thought it would be alot harder to crack than that! >.<
How can that code crack it so easily does it look for actual words?

Wizzup?

2010-04-06 10:30:00

From: turbobk
Oh s**t! really?
Wow I fail… I thought it would be alot harder to crack than that! >.<
How can that code crack it so easily does it look for actual words?


Take for example the word

"abolitionists" =>
$ ./wordmatch.py 
ABCDEFECGEHFH


#!/usr/bin/python

def wordRepr(w):

y = {}
z = ""
c = 0
for x in w:
if y.has_key(x):
z = z + y[x]
else:
y[x] = chr(ord('A') + c)
z = z + y[x]
c = c + 1
return z


print wordRepr("ABOLITIONISTS")

There aren't much words that will also return ABCDEFECGEHFH.
In fact, in a dictionary of 57046 words, it is the only match.

Here: http://vila.villavu.com/cgi-bin/gitweb/gitweb.cgi?p=crypto.git;a=summary
This is some very ugly code that I wrote very quickly. It contains the dictionaries + ``canonical'' dictionary. (in wlist/)
I didn't write any code to find the stuff in there, since I do that all with unix commands. grep, etc.

turbobk

2010-04-06 10:44:29

Oh ok! I see what you mean.

Would it help if I added another 'ciphertext' line which it will switch between the two different lines randomly and then after that rearrange the order of the words / letters?

Would that make it polygraphic?
I'm not familiar with this encryption stuff, as you can tell lol.

Nice work on that code btw ;)

Wizzup?

2010-04-06 18:18:40

From: turbobk
Oh ok! I see what you mean.

Would it help if I added another 'ciphertext' line which it will switch between the two different lines randomly and then after that rearrange the order of the words / letters?

Would that make it polygraphic?
I'm not familiar with this encryption stuff, as you can tell lol.

Nice work on that code btw ;)


It will help a bit, but not too much. It will not really be poly.

turbobk

2010-04-06 23:46:03

Ok, I've made it more secure with a second ciphertext line and it now jumbles up the letters, hopefully so a dictionary cant crack it.

I am hoping this won't be as easily or at all crackable :redface:
But I am sure it will be.. :(
*( LWERGBD KKJ CTKZPA QFWID MLJQDG DKMNCM BCB LXIOJJCU )*



Thanks,
TurboBk. :)

Gu3st...

2010-04-07 08:56:07

See if you can figure this out, turbobk:
596F7520646964206974203B29
or
0100011101110010011000010111010001110011
It's a pretty basic encryption :)

n3ss3s

2010-04-07 09:46:18

From: Zyt3x

0100011101110010011000010111010001110011


= grats

(its obviously binary so ye)

n3ss3s

2010-04-07 09:49:42

From: turbobk
Ok, I've made it more secure with a second ciphertext line and it now jumbles up the letters, hopefully so a dictionary cant crack it.

I am hoping this won't be as easily or at all crackable :redface:
But I am sure it will be.. :(
*( LWERGBD KKJ CTKZPA QFWID MLJQDG DKMNCM BCB LXIOJJCU )*



Thanks,
TurboBk. :)


is this backwards? Cant think of a 3 letter word that starts with 2 same letters..

turbobk

2010-04-07 10:12:52

From: Zyt3x
See if you can figure this out, turbobk:
596F7520646964206974203B29
or
0100011101110010011000010111010001110011
It's a pretty basic encryption :)


You did it ;)
Grats


Sure was..
Now figure out mine!! :D
*( LWERGBD KKJ CTKZPA QFWID MLJQDG DKMNCM BCB LXIOJJCU )*


From: n3ss3s
is this backwards? Cant think of a 3 letter word that starts with 2 same letters..


It splits up and rearranges the words, so spaces are not where they should be. :P

Wizzup?

2010-04-07 11:06:43

From: turbobk
You did it ;)
Grats


Sure was..
Now figure out mine!! :D
*( LWERGBD KKJ CTKZPA QFWID MLJQDG DKMNCM BCB LXIOJJCU )*




It splits up and rearranges the words, so spaces are not where they should be. :P


Splitting up AND rearranging the words makes it rather hard, especially if it is random… And even more with so little text.

/scratch$ ./s.py
LWERGBDKKJCTKZPAQFWIDMLJQDGDKMNCMBCBLXIOJJCU
{'A': 1, 'C': 4, 'B': 3, 'E': 1, 'D': 4, 'G': 2, 'F': 1, 'I': 2, 'H': 0, 'K': 4, 'J': 4, 'M': 3, 'L': 3, 'O': 1, 'N': 1, 'Q': 2, 'P': 1, 'S': 0, 'R': 1, 'U': 1, 'T': 1, 'W': 2, 'V': 0, 'Y': 0, 'X': 1, 'Z': 1}


I don't have time nor will to do a letter frequency attack, really… There's not a lot of characters.

Daniel

2010-04-07 11:06:49

Try and decrypt this string, from my own algorithm:
2282613VXBD413261YDGJ16046BFI664DH26804F

Here are a few hints:
Daniel = 6482613TVXZ371261WZPS16946XOR687ZQ27614O
Merlijn = 6282613NPRT381261QTWZ17206RVY699TX28120V
Hello World = 3882613OQSU381261RUXN15366SWZ633UY25536W
Dan's The Man = 2282613RTVX385261UXNQ16846VZP696XO28084Z

;)

Try and make something like that turbobk, despite the simplicity :) Look into those types of encryptions as-well, apart from substitution ;)

turbobk

2010-04-08 01:28:20

Even made it more secure now.. well hopefully.

Someone leet please try to crack this, I need to know if someone here can?
Because if not then 90% of other people won't be able to.

*( CL LCKMTWJFHJKC EHK DADDOHZ )*

Thanks,
TurboBk. :)

turbobk

2010-04-09 23:04:18

So I see no one here can crack it! :D
W00t!

Thanks for all your help guys.
TurboBk.

Gu3st...

2010-04-10 04:56:33

No one bothers to crack it.

Frement

2010-04-10 05:22:39

From: turbobk
So I see no one here can crack it! :D
W00t!

Thanks for all your help guys.
TurboBk.


Write us a 10 word sentence with that.

caused

2010-04-10 09:57:38

Xor encryption is the best :]. (If your password is as long as your original text, that is ;) )

If you want us to crack your text either tell us how you exactly encrypted it, or post a text with at least 500 words.

mixster

2010-04-10 12:17:29

Working on breaking it now, give me an hour or so as I'm lazy.
Edit: Oh right, forgot about this. Left script running with a small bug in it, so produced invalid results. May try again tonight otherwise tomorrow.

Gu3st...

2010-04-10 18:30:08

What about a longer text? Then I'll be able to break it for sure :)

turbobk

2010-04-10 22:21:49

Haha yeah it would be alot easier to crack with more text.
If mixster can't crack the last one I posted then I'll post a longer sentence. ;)

mixster

2010-04-10 22:54:52

Could you confirm that it starts with `no one'? If so, then I should be able to crack it faster, but otherwise I probably can't be bothered. If it doesn't start with `no one', then is the bit that says `JFHJK' originally `crack'?

weequ

2010-04-11 04:09:39

Damn I wish I knew how to encrypty and crack :)

turbobk

2010-04-11 04:10:22

*( CL LCKMTWJFHJKC EHK DADDOHZ )*

It doesn't say 'no one' anywhere in that text, and no 'crack' either! :D
I see it's a fair bit harder than the first encryption I made lol. Yey!

mixster

2010-04-11 09:22:09

Only because by blurring the word boundaries it makes it much more annoying to spot possible words in the text. It's still very much crackable if someone has some idea of what's being sent.

turbobk

2010-04-11 21:36:38

*** DECRYPT STRING ***
Input: CL LCKMTWJFHJKC EHK DADDOHZ
Output: TURBOBKS PRO ENCRYPTION LOL


*** ENCRYPT STRING ***
Input: MIXSTER OWNZ ALL
Output: PX BKHD SH ZJVKRS

I'm working on making the two cipher tables completely random at the moment :P

Sandstorm

2010-04-11 22:24:15

OOR@Q*()QPORQOP*RL@LR*RO@@+)>OMTOOUV@>*ORL>+TV(KP)V)U*TKQT+RK))R)P)>PMOU>K(VMOUMK@))QKV>R+TQUPV()P)>PMOU>K(VMOUMK@))QKV>R+TQUPV(*))()UT*P(Q)*M+*MUOKU+@V+M>T(>+OTMLQ**V)T@V@)MMV@MVML>PK*UVV*)Q+U+LP*PQ+)**>LRT>Q>OR@*@@P(*>MQPOOOR@Q*()QPORQOP*RL@LR*RO@@+)>OMTOOUV@>*ORL>+TV(KP)V)U*TKQT+RK))RLRTVKVL)Q>UUK+>+R+(Q*RKUT*(L(M@)OOUV@>*ORL>+TV(KP)V)U*TKQT+RK))R@@TQORTVP(RO(+VK*))+@OT+V(LPT@T+

Lol, hi there.

~Sand