Qbasicnews.com

QbasicNews.Com => Challenges => Topic started by: Zack on December 12, 2003, 11:56:07 AM



Title: Challenge: Write an algo
Post by: Zack on December 12, 2003, 11:56:07 AM
Write an algo to decrypt this:
J#hmlt#tkbw#zlv$qf#wkjmhjmd-#Gjg#kf#ejqf#pj{#pklwp#lq#lmoz#ejuf<#Tfoo/#wl#wfoo#zlv#wkf#wqvwk/#jm#boo#wkjp#f{`jwfnfmw/#J$uf#hjmgb#olpw#wqb`h#nzpfoe-#Avw#afjmd#bp#wkjp#jp#b#-77#Nbdmvn#---#zlv$uf#dlw#wl#bph#zlvqpfoe#lmf#rvfpwjlm9#$Gl#J#effo#ov`hz<$#Tfoo/#gl#zb#svmh<
Your score will increase if:
1) You actually manage to decrypt it
2) How readable the code is.
[EDIT]Actually, that isn't going to work since there might be some unprintable chars there...here's a text file with the same thing, pure ASCII: http://www.thegeekery.org/ciph.txt [/EDIT]


Title: Challenge: Write an algo
Post by: na_th_an on December 12, 2003, 12:32:22 PM
Code:
' I saw the # that looked spaces. ASC("#")=35, so it was SPACE+3
' I figured out that you XORed something to encode this, as I cheated
' seeing your latest subroutines ;) So I tried...

OPEN "ciph.txt" FOR INPUT AS #1
LINE INPUT #1, ciphered$
CLOSE #1

deciphered$ = ""

FOR i% = 1 TO LEN(ciphered$)
   current$ = MID$(ciphered$, i%, 1)
   dec% = ASC(current$) XOR 3
   deciphered$ = deciphered$ + CHR$(dec%)
NEXT i%

PRINT deciphered$


Title: Challenge: Write an algo
Post by: Zack on December 12, 2003, 01:57:04 PM
Very good, Nath!
5 points for code readability, and 3 for just figuring it out.
You should have PMed me the result, now nobody else can try.

I might make another challenge, more secure algo.


Title: Challenge: Write an algo
Post by: whitetiger0990 on December 12, 2003, 02:12:00 PM
yes, please do. i wanna try


Title: Challenge: Write an algo
Post by: na_th_an on December 12, 2003, 05:05:42 PM
Aw sorry about that - Now I realize I should've PMed you...

My apollogies.  :oops:


Title: Challenge: Write an algo
Post by: Neo on December 15, 2003, 05:58:51 AM
Quote from: "Zack"
Very good, Nath!
5 points for code readability, and 3 for just figuring it out.
You should have PMed me the result, now nobody else can try.

I might make another challenge, more secure algo.

Hehe. lol. I already saw it was some kind of practical example of your new-discovered encryption... where the decryption and encryption routines are the same ;) I don't mind that I can't enter anything. :roll:


Title: Challenge: Write an algo
Post by: Anonymous on December 15, 2003, 05:10:39 PM
in the spirit of password-less encryption, i give you this (http://members.aol.com/rubentbstk/progsnstuf/Locked.txt). This is my feeble newbie attempt at encryption from 3 yrs ago. The algo is something pretty neat though... i dont know if anyone has ever done anything like this before. Mad props if you can do it! ;)

EDIT: Note: You must open this in qbasic to see all the characters properly... i think


Title: Challenge: Write an algo
Post by: whitetiger0990 on December 15, 2003, 06:12:38 PM
dead link.


Title: Challenge: Write an algo
Post by: Anonymous on December 15, 2003, 06:21:14 PM
my apologies... it should be this (http://members.aol.com/rubentbstk/Progsnstuf/Locked.txt)
EDIT:This one should work... finally lol sorry
my bad.


Title: Challenge: Write an algo
Post by: Lachie Dazdarian on December 17, 2003, 07:19:12 AM
And how do you decryipt in the first place? I mean, the stuff Nathan just did is like magic to me.


Title: Challenge: Write an algo
Post by: Neo on December 17, 2003, 10:04:53 AM
When using a XOR-encryption (only), the encryption is the same as the decryption ;)


Title: Challenge: Write an algo
Post by: Lachie Dazdarian on December 17, 2003, 10:30:14 AM
Right...How did he knew it was a XOR encryption? And the exact code used?


Title: Challenge: Write an algo
Post by: na_th_an on December 17, 2003, 03:30:45 PM
Well, first of all I examined the stream. I saw that the symbol # repeated all over the place, in a pseudocyclic fashion, so I guessed it was the encoded "SPACE" character. As it looked so much as the "word delimiter" I guessed that a straightforward method was used, and that each symbol represented one only character. I noticed that ASC("#") = ASC(" ") XOR 3, partially guessing 'cause this guy had posted two XOR encryption/decryption algos earlier that week. I cheated :)