|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Function 解密(xx As String, yy As String) As String
Dim datx() As Byte
Dim datx1() As Byte
Dim daty() As Byte
Dim H As Long
Dim s As String
Dim d As New Dictionary
If xx = "" Or yy = "" Then Exit Function
s = "ェヴうウぅゥいイぃィあアぁЯяЮюЭэЬьЫыЪъЩщШшЧчЦцХхФфУуТтСсрПпОоНнМмЛлКкЙйИиЗзЖжЁёЕеДдГгВвБбАаΩωΨψΧχΦφΥυΤτΣσΡρΠπΟοΞξΝνΜμΛλΚκΙιΘθΗηΖζΕεΔδΓγΒβΑαZzzZyyYxxXwwWVvvVǖǚǜǘūǔüùúUuuU℡TttTsSRrrRQqqQPppPōǒòóoOnNmMlLKkkKJjjJīǐìíIiiIHhhHɡGggGfFēěêèéeEdDcCbBāǎàáaA┫┪┩┨┧┦┥┤┋┊┇┆┃│⊕++﹢〆〃〞〝~}|{`_^]\[@?;:/.,*)(&%$#987654321"
For i = 0 To 255
d(Mid(s, i + 1, 1)) = i
Next i
ReDim datx(0 To Len(xx) - 1)
For i = 0 To Len(xx) - 1
If d.Exists(Mid(xx, i + 1, 1)) Then datx(i) = d(Mid(xx, i + 1, 1)) '明码转数字
Next i
datx1 = datx
daty = StrConv(yy, vbFromUnicode)
j = 0
For i = 0 To UBound(datx)
If j > UBound(daty) Then j = 0
datx(i) = datx(i) Xor daty(j)
j = j + 1
Next i
For i = UBound(datx) - 1 To 2 Step -2
H = datx(i)
H = Abs(H - datx1(i))
datx(i - 2) = datx(i - 2) Xor H
datx(i - 1) = datx(i - 1) Xor H
Next i
解密 = StrConv(datx, vbUnicode)
End Function
Sub peng()
MsgBox 解密(加密("中华人民工和ゥいイぃィあアぁЯяЮюЭэЬьЫыЪъЩщШшЧчЦцХхФфУу国45模压", "12345"), "12345")
End Sub
Function 加密(xx As String, yy As String) As String '方案1不行换另一种方式加密
Dim datx() As Byte
Dim datx1() As Byte
Dim daty() As Byte
Dim H As Long
Dim s As String
s = "ェヴうウぅゥいイぃィあアぁЯяЮюЭэЬьЫыЪъЩщШшЧчЦцХхФфУуТтСсрПпОоНнМмЛлКкЙйИиЗзЖжЁёЕеДдГгВвБбАаΩωΨψΧχΦφΥυΤτΣσΡρΠπΟοΞξΝνΜμΛλΚκΙιΘθΗηΖζΕεΔδΓγΒβΑαZzzZyyYxxXwwWVvvVǖǚǜǘūǔüùúUuuU℡TttTsSRrrRQqqQPppPōǒòóoOnNmMlLKkkKJjjJīǐìíIiiIHhhHɡGggGfFēěêèéeEdDcCbBāǎàáaA┫┪┩┨┧┦┥┤┋┊┇┆┃│⊕++﹢〆〃〞〝~}|{`_^]\[@?;:/.,*)(&%$#987654321"
If xx = "" Or yy = "" Then Exit Function
daty = StrConv(yy, vbFromUnicode)
datx = StrConv(xx, vbFromUnicode)
datx1 = datx
j = 0
For i = 0 To UBound(datx)
If j > UBound(daty) Then j = 0
datx(i) = datx(i) Xor daty(j)
j = j + 1
Next i
For i = UBound(datx) - 1 To 2 Step -2
H = datx(i)
H = Abs(H - datx1(i))
datx(i - 2) = datx(i - 2) Xor H
datx(i - 1) = datx(i - 1) Xor H
Next i
xx = ""
For i = 0 To UBound(datx) '变成明码
xx = xx & Mid(s, datx(i) + 1, 1)
Next i
加密 = xx
End Function
|
评分
-
1
查看全部评分
-
|