Batch Encryption (help)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
aPinoy
Posts: 3
Joined: 16 Oct 2010 09:44

Batch Encryption (help)

#1 Post by aPinoy » 16 Oct 2010 10:02

This is my first post in this forum so be gentle with me :)


what do you think i should add/remove/edit to increase/improve the "encryption" of by batch?

This is just a simple Echo command I made that displays a simple message "January imong birthday?" or in english, " Is your birthday in January"

I hope you can help me guys... esp aGerman
i'm into so-called encryption of batch right now.

Code: Select all

@echo off&set !=1 2 3 4 5 6 7 8 9&setlocal
%1 %0 :: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
for %%s in ("A=%2" "B=%3" "C=%5" "D=%8" "E=%9") do set %%s
for %%# in (%!%) do shift
for %%s in ("A=%2%A%%6" "B=%A%" "C=%1%5%7%6%D%" "D=%B%%1" "E=%E%%C%%A%") do set %%s
for %%# in (%!%) do shift
color f2&echo.&echo %A%%4%B%%1%8 %C% %D%%1%3%E%%8?&echo.&pause

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch Encryption (help)

#2 Post by aGerman » 16 Oct 2010 17:07

Interesting batch file.
Well, your intention was to get an encryption but this is not realy an encryption, it's an algorithm to create a special combination of letters. What I mean is if you want to let the batch file write "Yes my birthday is in january" you would need a completely new algorithm.
You should think about a rule that would be valid for each text. It may not be a complicated rule because batch is plain text and everybody who want to find out what you try to encrypt will get it :wink:

Greetings to the Philippines
aGerman

aPinoy
Posts: 3
Joined: 16 Oct 2010 09:44

Re: Batch Encryption (help)

#3 Post by aPinoy » 16 Oct 2010 22:14

thanks aGerman! you're very good, i know.

i know this is somewhat new since i made it in my own and based on my own experiences on batch. actually, i hesitated to post it here at first (because it might be copied), but duhh, i don't care. I want to share now.

if I share this, i know it will be corrected and it might become more "hard to read".

i am an "unorthodox" batch coder but not as good as you. so expect me to experiment a lot.

greetings to germany!

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch Encryption (help)

#4 Post by aGerman » 17 Oct 2010 13:49

Well aPinoy, for me your batch code seems absolutely OK. It depends on what you wanna do. BTW jeb is much better with those experimental stuff than me. Here you will find a similar theme.
Never fear to share this here. Don't get me wrong but no credible programmer would ever use batch (or any other plain text language) for encrypting. So nobody will steal your idea to make money out of it :wink:
OK. A proposal from my site. ASCII coding is a good option for batch. For printable ASCII characters you could use a trick that jeb showed to me: %=ExitCodeASCII% (instead of %errorlevel%).
Example:

Code: Select all

@echo off &setlocal enabledelayedexpansion
::                 J  a  n  u  a  r  y     i  m  o  n  g     b  i  r  t  h  d  a  y  ?
:: ASCII (hex)    4a 61 6e 75 61 72 79 20 69 6d 6f 6e 67 20 62 69 72 74 68 64 61 79 3f
:: without spaces 4a616e7561727920696d6f6e672062697274686461793f
:: opposite       f397164686472796260276e6f6d6960297271657e616a4
:: Now it's kinda unreadable ;-)

set "encrypted=f397164686472796260276e6f6d6960297271657e616a4"

set /a n=0
:loop
  set "hex=!encrypted:~%n%,2!"
  if "%hex%"=="" goto exitLoop
  set "hex=%hex:~-1%%hex:~,1%"
  set /a dec=0x%hex%
  cmd /c exit %dec%
  set "string=%=exitcodeascii%%string%"
  set /a n+=2
goto :loop

:exitLoop
echo\!string!
pause>nul



Regards
aGerman

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: Batch Encryption (help)

#5 Post by ghostmachine4 » 17 Oct 2010 19:50

See my post here as well

aPinoy
Posts: 3
Joined: 16 Oct 2010 09:44

Re: Batch Encryption (help)

#6 Post by aPinoy » 19 Oct 2010 09:53

wah :shock:
what can i say..
you guys are so good! thanks to all of you guys.

derek.hansen
Posts: 3
Joined: 21 Oct 2010 16:56

Re: Batch Encryption (help)

#7 Post by derek.hansen » 21 Oct 2010 17:18

:shock: thts rediculous!!!

can you explain how to read that quick?? jw lol

Post Reply