Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Decrypt this:
#11
This challenge isn't challenging no more. Here is my original proggie:

Code:
DECLARE FUNCTION decript$ (a$)
DECLARE FUNCTION encript$ (a$)
a$ = "HELLO WORLD"
PRINT a$
b$ = encript$(a$)
PRINT b$
c$ = decript$(b$)
PRINT c$

FUNCTION decript$ (a$)
   c% = VAL(a$): res$ = CHR$(c%)
   o$ = RIGHT$(a$, LEN(a$) - LEN(LTRIM$(STR$(VAL(a$)))))
   WHILE o$ <> ""
      m$ = LEFT$(o$, 1)
      o$ = RIGHT$(o$, LEN(o$) - 1)
      IF m$ = "<" THEN c% = c% - VAL(o$) ELSE IF m$ = ">" THEN c% = c% + VAL(o$)
      IF m$ <> "=" THEN o$ = RIGHT$(o$, LEN(o$) - LEN(LTRIM$(STR$(VAL(o$)))))
      res$ = res$ + CHR$(c%)
   WEND
   decript$ = res$
END FUNCTION

FUNCTION encript$ (a$)
   a% = ASC(LEFT$(a$, 1)): out$ = LTRIM$(STR$(a%))
   FOR i% = 2 TO LEN(a$)
      m% = ASC(MID$(a$, i%, 1))
      IF m% = a% THEN
         out$ = out$ + "="
      ELSEIF m% < a% THEN
         out$ = out$ + "<" + LTRIM$(STR$(a% - m%))
      ELSE
         out$ = out$ + ">" + LTRIM$(STR$(m% - a%))
      END IF
      a% = m%
   NEXT i%
   encript$ = out$
END FUNCTION

I've invented another encryptation algo. The output was:

Code:
35520781707917087370403237390843093082270089242032262084180723599073160833251033

Now crack this one.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#12
Hey? Dont i get *any* credit? I cracked your old algo, and i wrote a program to decypher it! And i had it mainly worked out before megs post.
Reply
#13
Hey...you get credit, Dark. I couldn't have done that to save my life. :o
I'm good at encryption (hey, nobody's cracked it yet! :wink: ) And I suck at decryption. It's easy to be that way. Tongue
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#14
Of course, dark_prevail, you get credit. I just thought that you used the hint, and with the hint the challenge disappeared. Nice algo, btw. I was a little bit pissed off and I didn't even check it. My apologies Smile

Now give this a go:

Code:
35520781707917087370403237390843093082270089242032262084180723599073160833251033

This time it is a little bit harder until you find the pattern.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#15
Thanks for the credit =D

Its ok, no apoligies needed, nathan. I would have been pissed off to, if someone had comprimised my challenge like that. =P

Quote:Nice algo, btw.
Hah! Its a pile of spagetti Tongue

I will have a look at your new, code, although it looks a lot harder. =P
Reply
#16
I don't think it is spaghetti. What was challenging in my first encryption problem was not the decryption itself but coding a decent parser to do the work, and you just did a simple and fast snippet. Look at mine's, it is just unreadable code Tongue I guess it is harder to decypher my decyphering funcion than decyphering the cyphered code itself Big Grin
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)