Page 1 of 1

Encode and Decode Strings

Posted: 24 Apr 2011 19:32
by alleypuppy
Hello. I am trying to create a batch file where I can encode and decode text that I enter, but I am kind of stuck on how to do it. I would like to make it so I can type in "encode [text to be encoded]" or "decode [text to be decoded]" and a result would appear underneath. I would also like to have multiple outcomes for each input. Say I type "encode A", I would like either IZ or IM to appear as the encoded text. I would also like to be able to type in either "decode IZ" or "decode IM" and get the same outcome. I know it's as lot to ask, but any help would be much appreciated! ;)

Re: Encode and Decode Strings

Posted: 25 Apr 2011 06:07
by aGerman
Encoding and decoding in batch is absolutely senseless. Batch is plain text, so everybody can see the algorithms. What you would like to do results in batch code with probably much more than 100 lines. I'm not in the mood to write so much code for senseless things. Out of curiosity we tried to write a ROT13 encryption. It's so slow ...

Regards
aGerman

Re: Encode and Decode Strings

Posted: 25 Apr 2011 16:07
by alleypuppy
Okay. Thanks for the info, though!

Re: Encode and Decode Strings

Posted: 25 Apr 2011 19:40
by dbenham
I've posted a link to an efficient ROT13 encryption routine at the end of the thread that aGerman referenced. It is able to encrypt a 26k file in around 30 seconds. The code is embedded in a larger library of routines with documentation included. The actual file encryption takes roughly 65 lines of code. It should be possible to modify the code to implement any number of ciphers.

aGerman - How do you edit the displayed text associated with a URL within a post?

Dave Benham

Re: Encode and Decode Strings

Posted: 26 Apr 2011 17:20
by aGerman
dbenham wrote:aGerman - How do you edit the displayed text associated with a URL within a post?

This way:

Code: Select all

[url=http://www.dostips.com/forum/faq.php?mode=bbcode#f4r0]BBCode URL[/url]

BBCode URL

Regards
aGerman

Re: Encode and Decode Strings

Posted: 26 Apr 2011 17:37
by dbenham
Thanks aGerman - I'll use that next time I post a link.

Dave