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-26 19:55
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Trying out a new encryption idea too: View 2,655 Replies 36
Original Poster Posted 2008-06-22 20:40 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
First, change the form a little:

@echo off&setlocal enabledelayedexpansion
set code=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 "zw=for %%i in (%code%) do "&set "wz=set "&set "ww=call :zh"
%ww%
!_5!!_3!!_8!!_15! !_2!!_2!!_19!.!_2!!_1!!_20!!_8!!_15!!_13!.!_3!!_14!
!_16!!_1!!_21!!_19!!_5!
:zh
%zw%(%wz%/a n+=1&%wz%_!n!=%%i)
批处理之家新域名:www.bathome.net
Floor 2 Posted 2008-06-22 20:45 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
初级用户
Credits 78
Posts 39
Joined 2008-06-20 06:03
18-year member
UID 120614
Gender Male
Status Offline
Expert!!!!
Floor 3 Posted 2008-06-22 21:14 ·  中国 北京 联通(数字北京大厦IDC机房)
银牌会员
★★★
Credits 1,287
Posts 634
Joined 2007-05-02 15:06
19-year member
UID 87277
Gender Male
From cmd.exe
Status Offline
Using variables in place of commands
Clever... but just export the variable table...
Floor 4 Posted 2008-06-22 21:33 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by knoppix7 at 2008-6-22 21:14:
Using variables in place of commands
Clever... but just export the variable table...

Add password verification too (after entering it, it won't report an error, but if it's wrong it just won't run), and for now don't change the letter order:

@echo off&setlocal enabledelayedexpansion
set /p code=Please enter the run password:
set "zw=for %%i in (%code%) do "&set "wz=set "&set "ww=call :zh"
%ww%
!_5!!_3!!_8!!_15! !_2!!_2!!_19!.!_2!!_1!!_20!!_8!!_15!!_13!.!_3!!_14!
!_16!!_1!!_21!!_19!!_5!
:zh
%zw%(%wz%/a n+=1&%wz%_!n!=%%i)

This way even if the variables are exported, without knowing the password it still won't work, hehe.

[ Last edited by zw19750516 on 2008-6-22 at 09:36 PM ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
PPdos +6 2008-06-23 07:45
批处理之家新域名:www.bathome.net
Floor 5 Posted 2008-06-22 22:30 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
a b c z e q q h...
The password isn't absolute... Spend a little time and you can come up with several passwords~
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 6 Posted 2008-06-22 22:35 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
If a wrong password happens to get combined into commands like del or rd, that'd be depressing, hehe.
Floor 7 Posted 2008-06-22 22:41 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
Feels like this thread is good for helping newbies understand what variable expansion is~
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 8 Posted 2008-06-22 22:43 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by HAT at 2008-6-22 22:35:
If a wrong password happens to get combined into commands like del or rd, that'd be depressing, hehe.

Haha, yes, looking at it this way, even brute-force cracking won't do.
批处理之家新域名:www.bathome.net
Floor 9 Posted 2008-06-22 22:58 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by pusofalse at 2008-6-22 22:30:
a b c z e q q h...
The password isn't absolute... Spend a little time and you can come up with several passwords~

What if my password were like this: a 0 z # c 4 + q - ....................x @. Then I think the password would definitely be absolute, and basically impossible to solve. Hehe, I thought of this idea today while lying on the bed. It should count as original; at least nobody on cn-dos has brought it up before.
批处理之家新域名:www.bathome.net
Floor 10 Posted 2008-06-22 23:30 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
Looking at the senior member's code, the letter z isn't used, so z can be removed...
a b c are all present, so the first three letters have to be a b c
d isn't used either, so the fourth position can be any letter, number, or Chinese character~
e has to be in the fifth position... and so on...
From this we can infer it...

[ Last edited by pusofalse on 2008-6-22 at 11:34 PM ]
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 11 Posted 2008-06-23 00:13 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
a b c CN e  dos batch h encryption 处 理 室 m n o p 。 加 s t u 密 新 思 路 .


If each position can only be changed once, then there can be 19 passwords...
If it can be changed multiple times, then there can be countless passwords~
You just have to make sure of the positions...

[ Last edited by pusofalse on 2008-6-23 at 12:30 AM ]
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 12 Posted 2008-06-23 00:27 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by pusofalse at 2008-6-23 00:13:
a b c CN e  dos batch h encryption 处 理 室 m n o p 。 加 s t u 密 新 思 路 .


If each position can only be changed once, then there can be 14 passwords...
If it can be changed multiple times, there can ...

Come on, I can scramble the order and add useless characters into the password, then modify the batch file myself according to the password — that's my idea. For example: when password code is b a c........, then every a in the batch file is written as !_2!; when password code is ..........................s g a(the 30th position), then every a in the batch file is written as !_30!
批处理之家新域名:www.bathome.net
Floor 13 Posted 2008-06-23 00:37 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
Originally posted by zw19750516 at 2008-6-23 12:27 AM:

Come on, I can scramble the order and add useless characters into the password, then modify the batch file myself according to the password — that's my idea. For example: when password code is b a c........, then every a in the batch file is written as ...


Oh~ so that's how it is, you still have to modify the batch file too?~ In that case it really would be hard to crack... what if you forget it yourself, ^_^
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 14 Posted 2008-06-23 00:54 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by pusofalse at 2008-6-23 00:37:


Oh~ so that's how it is, you still have to modify the batch file too?~ In that case it really would be hard to crack... what if you forget it yourself, ^_^

Just write yourself a ciphertext comparison table, or use an encryption batch file to encrypt things in bulk. Anyway, there are plenty of ways — the key is your way of thinking.
ps: if it's encrypted like this, then no matter how much someone inserts echo into the batch file, it's useless, because first code has to be assigned the correct value before any encrypted command can run.

[ Last edited by zw19750516 on 2008-6-23 at 12:57 AM ]
批处理之家新域名:www.bathome.net
Floor 15 Posted 2008-06-23 08:01 ·  法国
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
The idea of using variables to replace commands is often seen in batch virus applications. What is used here is not a "password" but "ciphertext". The biggest drawback of ciphertext is that the longer the program, the easier the ciphertext is to crack, because some commands will appear repeatedly, and all appear at the beginning of lines.
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Forum Jump: