China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-21 09:38
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] [Discussion] Non-compiled Batch Processing Encryption Scheme and Code DigestI View 110,360 Replies 364
Floor 61 Posted 2006-07-26 21:04 ·  中国 广东 广州 电信
中级用户
★★
Credits 201
Posts 72
Joined 2005-11-20 20:57
20-year member
UID 45624
Status Offline
What is most concerned is: Excuse me, moderators and experts such as yuanyong630, if this tool is used to encrypt a more complex batch processing, will there be operation errors and other situations?
Floor 62 Posted 2006-07-26 21:09 ·  中国 湖南 娄底 新化县 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
19-year member
UID 58987
From 湖南.娄底
Status Offline
Originally posted by cain at 2006-7-26 21:04:
The most concerned thing is: May I ask the moderator and experts such as yuanyong630, if this tool is used to encrypt more complex batch processing, will there be operation errors and other situations?

It should not. After encryption, only a section of code is generated at the beginning of the file. When this section of code is run, an error will be prompted.

Then the following commands will be executed. It will not interrupt the execution of the following commands. Please rest assured.

[ Last edited by pengfei on 2006-10-2 at 09:15 ]
Floor 63 Posted 2006-07-27 03:57 ·  中国 广东 中山 广东瑞江科技有限公司BGP数据中心
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
This method can be seen with type under DOS. I think the best one is still the encryption method proposed by the moderator of version 3742668 on the 11th floor. After all, no one will slowly look for your code among so many English words???
Floor 64 Posted 2006-07-27 06:35 ·  中国 北京 电信
初级用户
Credits 49
Posts 13
Joined 2006-07-13 11:21
19-year member
UID 58500
Status Offline
If this tool is used to encrypt more complex batch processing, there will be no any problems.

Thanks "pengfei".

Finally, I bring a section of code. Everyone guess what the password is? (It's very simple)

@echo off
set a=1
set d=0
:sub
cls
@echo.
@echo.
@echo.
@echo.
@echo.
@echo.
@echo.
choice /c:1234567890 /n . Please enter the DOS entry password (3-%a%):

if errorlevel 10 goto 10
if errorlevel 9 goto 9
if errorlevel 8 goto 8
if errorlevel 7 goto 7
if errorlevel 6 goto 6
if errorlevel 5 goto 5
if errorlevel 4 goto 4
if errorlevel 3 goto 3
if errorlevel 2 goto 2

if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:10
if %d%==2 set d=3
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:9
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:8
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:7
if %d%==0 set d=1
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:6
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:5
if %d%==1 set d=2
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:4
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:3
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:2
if %a%==3 goto run
if %a%==2 set a=3
if %a%==1 set a=2
goto sub

:run
if %d%==3 goto end
cls
@echo Incorrect password, please enter again!!!
pause >nul
goto sub

:end
Floor 65 Posted 2006-07-29 18:33 ·  中国 山西 运城 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Originally posted by zxcv at 2006-7-23 16:10:
Simpler way:
Create a new "a.txt" text file, open it, copy 【ൡ挊獬਍】(excluding the 【】), paste it into "a.txt" text file. When saving, it prompts "Contains Unicode characters....", select "Cancel", change the encoding to "Unicode" and save.

Batch processing: copy/b a.txt+the file to be encrypted.bat encrypted.bat

Re zxcv『Post 14』:

According to your plan, an automated password generator script with relatively high automation has been made. Since it uses itself as the encryption key, it is itself a segment of ciphertext, so the code cannot be posted directly, and can only be uploaded as an attachment.

[ Last edited by willsort on 2006-7-29 at 18:35 ]
Attachments
EncryBat.rar (433 bytes, Credits to download 100 pts, Downloads: 105)
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 66 Posted 2006-07-29 22:29 ·  中国 辽宁 锦州 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
Re yuanyong630
Brother, the code on floor 34, I cracked it by inputting from 9 to 0. In the worst case, you can crack it by inputting from 0 to 9 three times in a row. It seems you forgot to clear the variable d at the appropriate time.

Although I haven't interjected all the time, this discussion is very interesting. I also occasionally try to encrypt something.
  ☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul

Floor 67 Posted 2006-07-29 23:16 ·  中国 北京 电信
初级用户
Credits 49
Posts 13
Joined 2006-07-13 11:21
19-year member
UID 58500
Status Offline
My code does have some bugs. Thanks everyone! I've learned a lot! Thanks
Floor 68 Posted 2006-07-29 23:20 ·  中国 北京 电信
初级用户
Credits 49
Posts 13
Joined 2006-07-13 11:21
19-year member
UID 58500
Status Offline
md .\Dial-up Networking.{992CFFA0-F557-101A-88EC-00DD010CCC48}

md .\Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}

md .\Recycle Bin.{645FF040-5081-101B-9F08-00AA002F954E}

md .\Scheduled Tasks.{D6277990-4C6A-11CF-8D87-00AA0060F5BF}

md .\Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

md<nul>nul .\Network Neighborhood.{208D2C60-3AEA-1069-A2D7-08002B30309D}

md<nul>nul .\My Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}

md<nul>nul .\My Documents.{450D8FBA-AD25-11D0-98A8-0800361B1103}

md<nul>nul .\Briefcase.{85bbd920-42a0-1069-a2e4-08002b30309d}
Floor 69 Posted 2006-07-30 02:11 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Originally posted by willsort at 2006-7-29 18:33:

Re zxcv『Post 14』:

Made an automated password generator script with a relatively high level of automation according to your plan. Since it uses itself as the encryption key, it is itself a piece of ciphertext, so therefore...

Modify it: if not == if exist %1 copy /b "%~f0"+%1 enc_%1>nul&echo. Enc_%1 is create.&goto :eof

Remove the ":EncryBat_Encryption" part

Just keep the following for actual use:
@echo off
if......
if......
:EncryBat_Display
就行了^_^

[ Last edited by zxcv on 2006-7-30 at 02:15 ]
Floor 70 Posted 2006-07-31 04:08 ·  中国 河北 石家庄 电信
新手上路
Credits 2
Posts 1
Joined 2006-07-31 03:02
19-year member
UID 59533
Status Offline
Learning
Floor 71 Posted 2006-08-02 10:44 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Modified at post 74...

[ Last edited by zxcv on 2006-8-3 at 21:15 ]
Floor 72 Posted 2006-08-03 17:26 ·  中国 山西 大同 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline

───────────────── Moderation Record ─────────────────
Performed by: Will Sort
Operations: Merged topic {21804}How to prevent others from viewing and modifying the content of "Do not convert.bat"? -> Posts 1~26
     Merged topic {22053}Post a batch processing encryption tool -> Posts 27~70
     Merged topic {22254}I also post a batch processing encryption tool^_^ -> Post 71
Explanation: The operated topics have direct contextual connections with this topic
───────────────── Moderation Record ─────────────────


Re zxcv:

There is a small issue with your modification. In the line "if not == if exist %~f1", the enhanced command line parameter reference (%~1) is used, so it needs to be enclosed in quotes to prevent a syntax error when the file name contains spaces. As follows:

if not "%~n1"=="" if exist "%~f1" ...

If the original parameter reference (%1) is used, because the system or the caller automatically adds quotes to parameters containing spaces, quotes should not be used at this time, otherwise the spaces in the parameters will be exposed due to incorrect quote matching. For example:

if not ""space file name""=="" if exist ""space file name"" ... (syntax error)

If the enhanced parameter reference (%~1) is used, because the quotes in parameters containing spaces are automatically removed by the system, quotes must be used at this time, otherwise the spaces in the parameters will be exposed due to the lack of quote protection.

if not == if exist space file name ... (syntax error)
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 73 Posted 2006-08-03 18:11 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 48
Posts 20
Joined 2005-08-19 17:57
20-year member
UID 41795
Status Offline
Looking into it`
Floor 74 Posted 2006-08-03 20:24 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Thanks to moderator willsort for the correction.

The modifications are as follows:


  1. @echo off
  2. if not "%~n0"=="EncryBat" goto EncryBat_Display
  3. if not "%~n1"=="" if exist "%~f1" copy/b "%~f0"+"%~f1" "%~dp1enc_%~nx1">nul 2>nul&cls&echo.&echo. Enc_%~nx1 is create.&goto :eof

  4. :EncryBat_Help
  5. echo.
  6. echo %~n0 - Cryptographic machine for batch program
  7. echo zxcv@cn-dos, willsort@cn-dos - 2006-8-4 - CMD@WinXP
  8. echo.
  9. echo Useage: %~n0 batch_program_with_extname
  10. echo Reference: http://www.cn-dos.net/forum/viewthread.php?tid=22053
  11. if /i not [%0]== pause
  12. goto :eof

  13. :EncryBat_Display
zxcv posted on: 2006-08-04 11:20


Correct the error that encrypted files cannot be generated for file names with spaces

[ Last edited by zxcv on 2006-8-4 at 11:31 ]
Attachments
EncryBat.rar (430 bytes, Credits to download 1 pts, Downloads: 1358)
Floor 75 Posted 2006-08-05 08:34 ·  中国 上海 东方有线
中级用户
★★
Credits 377
Posts 66
Joined 2005-04-04 00:00
21-year member
UID 37817
Gender Male
Status Offline
The text in the graphical menu window of the encrypted batch processing opened in the CMD window is incorrect when using the EncryBat from the upper floor!
‹ Prev 1 3 4 5 6 7 25 Next ›
Forum Jump: