标题:加密-解密TXT文件
只看楼主
花三千
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-9-12
 问题点数:0 回复次数:19 
加密-解密TXT文件
加密-解密TXT文件
将以下代码复制保存为333.VBS文件,奇数次运行该VBS文件是加密你要加密的TXT文件,
偶数次运行该VBS文件是解密你已加密的TXT文件

'***-----***-------***加密-解密.vbs***-----***------****

z=inputbox("请输入路径","加密-解密TXT文件","e:\12345\123.txt")

'---------------------------------------------1
set fso=CreateObject("Scripting.FileSystemObject")
set fsofile=fso.OpenTextFile(z, 1, true)
tempstr=fsofile.Readall
tempstr=replace(tempstr, "a", "※")
tempstr=replace(tempstr, "b", "£")
tempstr=replace(tempstr, "c", "¥")
tempstr=replace(tempstr, "d", "¢")
tempstr=replace(tempstr, "e", "¬")
tempstr=replace(tempstr, "f", "]")

tempstr=replace(tempstr, "※", "f")
tempstr=replace(tempstr, "£", "e")
tempstr=replace(tempstr, "¥", "d")
tempstr=replace(tempstr, "¢", "c")
tempstr=replace(tempstr, "¬", "b")
tempstr=replace(tempstr, "]", "a")
fsofile.close
set fsofile1=fso.OpenTextFile(z, 2, true)
fsofile1.WriteLine tempstr
fsofile1.close
'---------------------------------------------2
set fso=CreateObject("Scripting.FileSystemObject")
set fsofile=fso.OpenTextFile(z, 1, true)
tempstr=fsofile.Readall
tempstr=replace(tempstr, "g", "※")
tempstr=replace(tempstr, "h", "£")
tempstr=replace(tempstr, "i", "¥")
tempstr=replace(tempstr, "1", "¢")
tempstr=replace(tempstr, "2", "¬")
tempstr=replace(tempstr, "3", "]")

tempstr=replace(tempstr, "※", "3")
tempstr=replace(tempstr, "£", "2")
tempstr=replace(tempstr, "¥", "1")
tempstr=replace(tempstr, "¢", "i")
tempstr=replace(tempstr, "¬", "h")
tempstr=replace(tempstr, "]", "g")
fsofile.close
set fsofile1=fso.OpenTextFile(z, 2, true)
fsofile1.WriteLine tempstr
fsofile1.close
'---------------------------------------------3
set fso=CreateObject("Scripting.FileSystemObject")
set fsofile=fso.OpenTextFile(z, 1, true)
tempstr=fsofile.Readall
tempstr=replace(tempstr, "j", "※")
tempstr=replace(tempstr, "k", "£")
tempstr=replace(tempstr, "l", "¥")
tempstr=replace(tempstr, "4", "¢")
tempstr=replace(tempstr, "5", "¬")
tempstr=replace(tempstr, "6", "]")

tempstr=replace(tempstr, "※", "6")
tempstr=replace(tempstr, "£", "5")
tempstr=replace(tempstr, "¥", "4")
tempstr=replace(tempstr, "¢", "l")
tempstr=replace(tempstr, "¬", "k")
tempstr=replace(tempstr, "]", "j")
fsofile.close
set fsofile1=fso.OpenTextFile(z, 2, true)
fsofile1.WriteLine tempstr
fsofile1.close
'---------------------------------------------4
set fso=CreateObject("Scripting.FileSystemObject")
set fsofile=fso.OpenTextFile(z, 1, true)
tempstr=fsofile.Readall
tempstr=replace(tempstr, "m", "※")
tempstr=replace(tempstr, "n", "£")
tempstr=replace(tempstr, "o", "¥")
tempstr=replace(tempstr, ",", "¢")
tempstr=replace(tempstr, ".", "¬")
tempstr=replace(tempstr, "/", "]")

tempstr=replace(tempstr, "※", "/")
tempstr=replace(tempstr, "£", ".")
tempstr=replace(tempstr, "¥", ",")
tempstr=replace(tempstr, "¢", "o")
tempstr=replace(tempstr, "¬", "n")
tempstr=replace(tempstr, "]", "m")
fsofile.close
set fsofile1=fso.OpenTextFile(z, 2, true)
fsofile1.WriteLine tempstr
fsofile1.close
'---------------------------------------------5
set fso=CreateObject("Scripting.FileSystemObject")
set fsofile=fso.OpenTextFile(z, 1, true)
tempstr=fsofile.Readall
tempstr=replace(tempstr, "p", "※")
tempstr=replace(tempstr, "q", "£")
tempstr=replace(tempstr, "r", "¥")
tempstr=replace(tempstr, " ", "¢")
tempstr=replace(tempstr, "\", "¬")
tempstr=replace(tempstr, "=", "]")

tempstr=replace(tempstr, "※", "=")
tempstr=replace(tempstr, "£", "\")
tempstr=replace(tempstr, "¥", " ")
tempstr=replace(tempstr, "¢", "r")
tempstr=replace(tempstr, "¬", "q")
tempstr=replace(tempstr, "]", "p")
fsofile.close
set fsofile1=fso.OpenTextFile(z, 2, true)
fsofile1.WriteLine tempstr
fsofile1.close
'---------------------------------------------6
set fso=CreateObject("Scripting.FileSystemObject")
set fsofile=fso.OpenTextFile(z, 1, true)
tempstr=fsofile.Readall
tempstr=replace(tempstr, "s", "※")
tempstr=replace(tempstr, "t", "£")
tempstr=replace(tempstr, "u", "¥")
tempstr=replace(tempstr, "7", "¢")
tempstr=replace(tempstr, "8", "¬")
tempstr=replace(tempstr, "9", "]")

tempstr=replace(tempstr, "※", "9")
tempstr=replace(tempstr, "£", "8")
tempstr=replace(tempstr, "¥", "7")
tempstr=replace(tempstr, "¢", "u")
tempstr=replace(tempstr, "¬", "t")
tempstr=replace(tempstr, "]", "s")
fsofile.close
set fsofile1=fso.OpenTextFile(z, 2, true)
fsofile1.WriteLine tempstr
fsofile1.close
'---------------------------------------------7
set fso=CreateObject("Scripting.FileSystemObject")
set fsofile=fso.OpenTextFile(z, 1, true)
tempstr=fsofile.Readall
tempstr=replace(tempstr, "v", "※")
tempstr=replace(tempstr, "w", "£")
tempstr=replace(tempstr, "x", "¥")
tempstr=replace(tempstr, "%", "¢")
tempstr=replace(tempstr, ")", "¬")
tempstr=replace(tempstr, "(", "]")

tempstr=replace(tempstr, "※", "(")
tempstr=replace(tempstr, "£", ")")
tempstr=replace(tempstr, "¥", "%")
tempstr=replace(tempstr, "¢", "x")
tempstr=replace(tempstr, "¬", "w")
tempstr=replace(tempstr, "]", "v")
fsofile.close
set fsofile1=fso.OpenTextFile(z, 2, true)
fsofile1.WriteLine tempstr
fsofile1.close
msgbox "OK"

[此贴子已经被作者于2007-10-14 20:25:45编辑过]

搜索更多相关主题的帖子: TXT文件 解密 fso set 
2007-10-14 20:09
缘吇弹
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:地球
等 级:版主
威 望:43
帖 子:3038
专家分:27
注 册:2007-7-2
得分:0 
哈哈,乱码加密.
帮你顶一个.

Repeat  Life=Study;Until (death);
2007-10-14 22:35
WSY379
Rank: 6Rank: 6
来 自:网络农民
等 级:贵宾
威 望:28
帖 子:1293
专家分:3
注 册:2007-6-24
得分:0 
哈哈~

/祈福/如果生命以如残喘~!那我活着的唯一意义就是你!~所以我封存了所有的记忆~!等你回来~!!!!!!!
2007-10-15 00:13
lthiy
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:9
帖 子:849
专家分:0
注 册:2007-4-4
得分:0 

偶也来顶一个


2007-10-15 09:32
hc2008
Rank: 1
等 级:新手上路
帖 子:88
专家分:0
注 册:2007-1-4
得分:0 
对文字没有什么用啊
2007-10-15 15:32
hc2008
Rank: 1
等 级:新手上路
帖 子:88
专家分:0
注 册:2007-1-4
得分:0 
对文字没有用,只加密数字!
2007-10-15 15:35
卡卡希比
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:2283
专家分:189
注 册:2007-7-1
得分:0 

修改一下


PLEASE FLUSH AFTER USE!
2007-10-15 23:08
cnenc
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:35
帖 子:2913
专家分:514
注 册:2007-1-29
得分:0 
呵呵,替换算法...
2007-10-16 15:11
花三千
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-9-12
得分:0 
对文字有用啊
例如:tempstr=replace(tempstr, "小鸡巴", "大大的")
就把"小鸡巴"换成了"大大的"

2007-11-03 11:44
the_king
Rank: 1
等 级:新手上路
威 望:1
帖 子:70
专家分:0
注 册:2007-9-14
得分:0 
经典的老式加密算法,不错,顶一个...
2007-11-07 22:11



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-177592-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.105253 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved