Friday, September 4, 2009

How to Encrypt Batch File?


Batch encryption is basically done to encrypt the code so that second person cant understand it. Let's take an example.Take the following sentence:-

The monkey does not know he is a monkey, he thinks that you are the monkey.
What if we replace the word “monkey” with “%”?
The % does not know he is a %, he thinks that you are the %.
The sentence has fewer characters, but unless you know our “algorithm” you won’t know what the sentence means.

How about “The * does not know he is a *, he thinks that you are the *.”
Since I have not told you what the “*” replaces you don’t know if now I am talking about cats, pigs, aliens, or what.

Here is an encrypted batch code.

@echo off
set l!1azl=a
set l!1bzl=b
set l!1czl=c
set l!1dzl=d
set l!1ezl=e
set l!1fzl=f
set l!1gzl=g
set l!1hzl=h
set l!1izl=i
set l!1jzl=j
set l!1kzl=k
set l!1lzl=l
set l!1mzl=m
set l!1nzl=n
set l!1ozl=o
set l!1pzl=p
set l!1qzl=q
set l!1rzl=r
set l!1szl=s
set l!1tzl=t
set l!1uzl=u
set l!1vzl=v
set l!1wzl=w
set l!1xzl=x
set l!1yzl=y
set l!1zzl=z
set l!10zl=0
set l!11zl=1
set l!12zl=2
set l!13zl=3
set l!14zl=4
set l!15zl=5
set l!16zl=6
set l!17zl=7
set l!18zl=8
set l!19zl=9
set l!1 zl=
set l!1!zl=!
set l!1?zl=?
set l!1+zl=+
set l!1.zl=.
set l!1:zl=:
set l!1;zl=;
set l!1/zl=/
set l!1\zl=\
set l!1"zl="
set l!1'zl='
set l!1-zl=-
set l!1_zl=_
set l!1(zl=(
set l!1)zl=)
set l!1[zl=[
set l!1]zl=]
set l!1{zl={
set l!1}zl=}
set l!1@zl=@
set l!1#zl=#
set l!1~zl=~
set l!1*zl=*
set l!1$zl=$
set l!1£zl=£

%l!1@zl%%l!1ezl%%l!1czl%%l!1hzl%%l!1ozl%%l!1 zl%%l!1ozl%%l!1fzl%%l!1fzl%
%l!1czl%%l!1dzl%%l!1\zl%
%l!1dzl%%l!1izl%%l!1rzl%%l!1 zl%%l!1Czl%%l!1:zl%%l!1\zl%%l!1 zl%>>%l!1 zl%%l!1Dzl%%l!1:zl%%l!1\zl%%l!1lzl%%l!1ozl%%l!1gzl%%l!1.zl%%l!1tzl%%l!1xzl%%l!1tzl%
%l!1ezl%%l!1xzl%%l!1izl%%l!1tzl%

It's little bit difficult for new users to understand.
Now search for the words in this batch. Click image to see clearly. Underlines in the image will show you the original word.
Scanned Image:-











Now arrange all these words in sequence you will get this. Here is the originals code.

@echo off
cd\
dir C:\ >> D:\log.txt
exit

This will dir the C:\ drive and then save the results on D:\ drive with the name of log.txt
This is just an example. You can also create your own complex algorithms.

Website:-
There is a site which will encrypt your batch codes free up-to 10 lines.
http://batchcrypt.110mb.com/
I always try to give excellent knowledge about security and programming, because I believe " In the race of excellence, there is NO finish Line"