『楼 主』:
原创:"加密"文件又一法 ------ expand命令的一蹊跷用法
使用 LLM 解释/回答一下
expand命令用来展开一个或多个压缩文件,具体用法看 expand /?
大家试试cmd下执行下面这条命令: cd c:\ &>a.txt echo test &expand a.txt b.txt:bb &del a.txt
现在去c:\看看,多了个b.txt ,再一看是一个空文件,刚刚的a.txt明明不是空文件,怎么展开到b.txt为空文件了那?这蹊跷吧!呵呵
好了,现在来还原a.txt,执行:cd c:\ &expand b.txt:bb a.txt
现在看看,是不是又还原了,a.txt的内容正是我们刚刚echo写进去的
好了,现在来利用这点
我们用它来“加密”文件
执行:expand 源文件 目标文件:** ,**可以随便写(我只测试了写字母),加密完后删除源文件,这样别人不管怎么样也看不到源文件了
我们需要“解密”文件时
执行:expand 目标文件:** 源文件 ,就好,注意这里的**一定要和“加密”时用的**完全相同,不同的话是“解密”不了的,
还有你直接执行:expand 目标文件 源文件 ,是不可以的
呵呵,好用吗?实用吗?经测试,完全可以用,改新文件的名字、复制新文件到别的路径、重起系统都不影响
问题:为什么是个空文件那?用空文件又怎么可以还原那?不解,望大虾给解释下
大家来讨论下哈~
Last edited by he200377 on 2006-9-26 at 08:00 ]
The expand command is used to expand one or more compressed files. For the specific usage, please look at expand /?
Everyone, try executing the following command under cmd: cd c:\ &>a.txt echo test &expand a.txt b.txt:bb &del a.txt
Now go to c:\ and see, there is an additional b.txt, and then it is found to be an empty file. The a.txt just now was obviously not an empty file. Why is it expanded to b.txt as an empty file? That's strange! Hehe
Okay, now to restore a.txt, execute: cd c:\ &expand b.txt:bb a.txt
Now see, isn't it restored again? The content of a.txt is exactly what we just wrote in with echo
Okay, now let's use this
We use it to "encrypt" files
Execute: expand source file target file:**, ** can be written randomly (I only tested writing letters). After encryption, delete the source file, so that others can't see the source file no matter what
When we need to "decrypt" the file
Execute: expand target file:** source file, just note that ** must be exactly the same as the ** used in "encryption", otherwise it can't be "decrypted"
Also, directly executing: expand target file source file is not okay
Hehe, is it easy to use? Is it practical? After testing, it can be used completely. Changing the name of the new file, copying the new file to other paths, restarting the system, etc., have no impact
Question: Why is it an empty file? How can it be restored with an empty file? I don't understand, hope the experts can explain
Everyone, come and discuss~
Last edited by he200377 on 2006-9-26 at 08:00 ]
|