Qbasicnews.com
September 17, 2019, 05:31:59 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Challenge: Write an algo  (Read 7143 times)
Zack
*/-\*
*****
Posts: 3974



WWW
« 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]
Logged

f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #1 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$
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Zack
*/-\*
*****
Posts: 3974



WWW
« Reply #2 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.
Logged

f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #3 on: December 12, 2003, 02:12:00 PM »

yes, please do. i wanna try
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #4 on: December 12, 2003, 05:05:42 PM »

Aw sorry about that - Now I realize I should've PMed you...

My apollogies.  :oops:
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Neo
Na_th_an
*****
Posts: 2150



« Reply #5 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 Wink I don't mind that I can't enter anything. :roll:
Logged
Anonymous
Guest
« Reply #6 on: December 15, 2003, 05:10:39 PM »

in the spirit of password-less encryption, i give you this. 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! Wink

EDIT: Note: You must open this in qbasic to see all the characters properly... i think
Logged
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #7 on: December 15, 2003, 06:12:38 PM »

dead link.
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Anonymous
Guest
« Reply #8 on: December 15, 2003, 06:21:14 PM »

my apologies... it should be this
EDIT:This one should work... finally lol sorry
my bad.
Logged
Lachie Dazdarian
I hold this place together
*****
Posts: 955



WWW
« Reply #9 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.
Logged
Neo
Na_th_an
*****
Posts: 2150



« Reply #10 on: December 17, 2003, 10:04:53 AM »

When using a XOR-encryption (only), the encryption is the same as the decryption Wink
Logged
Lachie Dazdarian
I hold this place together
*****
Posts: 955



WWW
« Reply #11 on: December 17, 2003, 10:30:14 AM »

Right...How did he knew it was a XOR encryption? And the exact code used?
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #12 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 Smiley
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!