Computer Hope

Microsoft => Microsoft DOS => Topic started by: anisa on October 27, 2008, 08:24:52 PM

Title: (ask) how to hide/encrypt batch script content
Post by: anisa on October 27, 2008, 08:24:52 PM

i need to hide/encrypt batch script contents from other user.
the batch file contains a username and password to SQL.

thanks
Title: Re: (ask) how to hide/encrypt batch script content
Post by: gpl on October 28, 2008, 02:42:08 AM
You could use a batch compiler

I have seen one project that wraps up a batch in an exe, then expands it on the fly - it all depends how secure you want to make it, if it is just keeping it hidden from prying eyes, that might work for you

Graham
Title: Re: (ask) how to hide/encrypt batch script content
Post by: fireballs on October 28, 2008, 03:07:14 AM
http://www.computerhope.com/download/utility/Bat_To_Exe_Converter.zip (http://www.computerhope.com/download/utility/Bat_To_Exe_Converter.zip)

Batch compiler. It's not amazingly secure but it does make it harder to see what's going on and reverse engineer the code.

FB
Title: Re: (ask) how to hide/encrypt batch script content
Post by: anisa on October 28, 2008, 07:41:42 PM
thanks to graham and FB

are there another way to keep extension still .bat but with content encrypted?
 
Title: Re: (ask) how to hide/encrypt batch script content
Post by: Dias de verano on October 29, 2008, 01:20:10 AM
thanks to graham and FB

are there another way to keep extension still .bat but with content encrypted?
 

A batch file is a plain text file. But maybe you can make a .bat file call an exe file. Better, though, to solve the problem you seem to have with the "other user" you mentioned.

If you mean ***any*** "other user" or person who may have access to what you want to hide, and they have an indefinite amount of time available, ***any*** scheme of concealment must be regarded as crackable. A batch file would be especially leaky. The problem is that passwords are meant to be carried in people's heads. The whole point of a password is that it is never written down or stored anywhere. You did know this?

If you are thinking of one person only, who has limited batch knowledge, then something like this might work

Code: [Select]
@echo off
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
set A=%5&set B=%6&set C=%8&set D=%3
for %%? in (1 2 3 4 5 6 7 8 9) do shift
set A=%C%%7%A%&set C=%D%%4%B%&set D=%7
for %%? in (1 2 3 4 5 6 7 8 9) do shift
echo %A% %C%%2%2 %8%D%%4!

Trouble is, if your batch knowledge is as limited as theirs is, you won't easily be able to deploy such a method, (you need to be able to understand how the code works!)  and if they read this thread, they'll know what you did!

Code: [Select]
S:\Test\Batch\encrypt>crypt-demo.bat
GOD BLESS YOU!
Title: Re: (ask) how to hide/encrypt batch script content
Post by: Dias de verano on October 29, 2008, 02:32:16 PM
In fact, before thinking about encrypting the batch file, you should first get organised and use such things as user accounts and folder permissions to make sure that you are the only person who can get into the folder where it is, and the only person who can run or open it in an editor.
Title: Re: (ask) how to hide/encrypt batch script content
Post by: zask on January 16, 2016, 07:58:57 PM
Give me any code you have and ill do it for you.

for example

@echo off
title Encripted.bat by Zask
set qdmh=xyg
set qdmh=s
GoTo qdmh
set qdmh=rc
:qdmh
set sgzl=ybh
set sgzl=e
GoTo sgzl
set sgzl=lk
:sgzl
set jlbq=rrc
set jlbq=t
GoTo jlbq
set jlbq=nl
:jlbq
%qdmh%%sgzl%%jlbq% ky=dme
%qdmh%%sgzl%%jlbq% ky=a
GoTo ky
%qdmh%%sgzl%%jlbq%  ky=oy
:ky
%qdmh%%sgzl%%jlbq% ix=pfj
%qdmh%%sgzl%%jlbq% ix=b
GoTo ix
%qdmh%%sgzl%%jlbq%  ix=na
:ix
%qdmh%%sgzl%%jlbq% qp=pnd
%qdmh%%sgzl%%jlbq% qp=c
GoTo qp
%qdmh%%sgzl%%jlbq%  qp=gl
:qp
%qdmh%%sgzl%%jlbq% uc=ejm
%qdmh%%sgzl%%jlbq% uc=d
GoTo uc
%qdmh%%sgzl%%jlbq%  uc=wq
:uc
%qdmh%%sgzl%%jlbq% dv=bpu
%qdmh%%sgzl%%jlbq% dv=e
GoTo dv
%qdmh%%sgzl%%jlbq%  dv=gt
:dv
%qdmh%%sgzl%%jlbq% xs=gpw
%qdmh%%sgzl%%jlbq% xs=f
GoTo xs
%qdmh%%sgzl%%jlbq%  xs=tw
:xs
%qdmh%%sgzl%%jlbq% bb=uvc
%qdmh%%sgzl%%jlbq% bb=g
GoTo bb
%qdmh%%sgzl%%jlbq%  bb=or
:bb
%qdmh%%s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%ge%%xr%: H%qv%%lj%%as%R%qv%%lj%%as%P%qv%%lj%%as%, %bb%%ge%%ar%%dv% %qe%%dv%%tc% %tc%%dv% %gp%%ke%%dv% %qp%%qv%%uc%%dv% %ky%%zl%%uc% %as%%qv%%sr%%qe% %zl%%ky%%tc%%dv% %xh%%ge%%lj%%lj% %ix%%dv% %xr%%ke%%qv%%sr%%gp%%dv%%uc% %qe%%dv%%tc% %qv%%sr%%gp% %qv%%zl% %tc%%as% %xh%%ky%%lj%%lj%.
Title: Re: (ask) how to hide/encrypt batch script content
Post by: patio on January 17, 2016, 07:20:02 AM
zask the Topic is over 8 years old...
Title: Re: (ask) how to hide/encrypt batch script content
Post by: Salmon Trout on January 17, 2016, 08:20:43 AM
And look who the last person before zask was...
Title: Re: (ask) how to hide/encrypt batch script content
Post by: patio on January 17, 2016, 08:29:29 AM
 :P    :P
Title: Re: (ask) how to hide/encrypt batch script content
Post by: zask on January 17, 2016, 10:13:07 AM
zask the Topic is over 8 years old...
lol i was hoping he would be able to see it somehow, knowing that there is no encryption software out there for batch, i could help. I found this random forum on google XD
Title: Re: (ask) how to hide/encrypt batch script content
Post by: Geek-9pm on January 17, 2016, 10:33:38 AM
l..  found this random forum on google XD
Who is the random forum. Do you mean this forum?
Wear are a Random  Forum ???
Title: Re: (ask) how to hide/encrypt batch script content
Post by: patio on January 17, 2016, 11:11:15 AM
Can we stop already ? ?
Title: Re: (ask) how to hide/encrypt batch script content
Post by: zask on January 18, 2016, 06:21:09 PM
Who is the random forum. Do you mean this forum?
Wear are a Random  Forum ???

Yes thats what i mean lol