主頁(yè) > 知識(shí)庫(kù) > 怎樣給文件加密最安全?

怎樣給文件加密最安全?

熱門(mén)標(biāo)簽:遼寧營(yíng)銷(xiāo)智能外呼系統(tǒng)價(jià)格多少 重慶400電話哪里辦理 武漢如何辦理400電話 推銷(xiāo)電話機(jī)器人怎么打電話的 語(yǔ)音電銷(xiāo)機(jī)器人視頻 400電話是怎么申請(qǐng) 常州智能外呼電銷(xiāo)機(jī)器人如何 自適應(yīng)地圖標(biāo)注 教育機(jī)構(gòu)地圖標(biāo)注

%@ Language = VBScript%>
%

Response.Expires = 0


p = "abcdefg"
Set TestPWD = New CPassWord
TestPWD.EnPWD p
TestPWD.UnPWD TestPWD.ShowPWD(True)

k = TestPWD.ShowPWD(True)
l = TestPWD.ShowPWD(False)
Set TestPWD = Nothing

With Response
.Write "
原文:" p "br>"
.Write "
加密后:" k "br>"
.Write "
解密后:" L "br>"
End With


Class CPassWord
Private CEnPWD,CUnPWD

Private Function My_Hex(My_Hex_Source)
  My_Hex = Hex(My_Hex_Source)
  If Len(My_Hex) = 1 Then
   My_Hex = "0" My_Hex
  End If
End Function

Private Function My_UnHex(My_UnHex_Source)
  If Len(My_UnHex_Source) = 2 Then
   Temp_Value = My_HexReplace(Left(My_UnHex_Source,1))
  End If
  My_UnHex = Temp_Value * 16 + My_HexReplace(Right(My_UnHex_Source,1))
End Function

Private Function My_HexReplace(My_HexReplace_Source)
  If Asc(My_HexReplace_Source) > 64 Then
   My_HexReplace = Asc(UCase(My_HexReplace_Source)) - 55
  Else
   My_HexReplace = Asc(My_HexReplace_Source) - 48
  End If
End Function

Public Property Get ShowPWD(EnP)

' 輸出.
  If EnP Then
   ShowPWD = CEnPWD
  Else
   ShowPWD = CUnPWD
  End If
End Property

Sub EnPWD(EnPWD_Source)
  if EnPWD_Source = "" then
   CEnPWD = 0
   Exit Sub
  else
   Randomize
   Key = Rnd * 256
   While Key = 0
    Key = Rnd * 256
   Wend
   For i=1 To Len(EnPWD_Source)
    Temp_String = Key Xor Asc(Mid(EnPWD_Source,i,1))
    Crc = Crc + Temp_String
    CEnPWD = CEnPWD + My_Hex(Temp_String)
   Next
   CEnPWD = My_Hex(Key) + StrReverse(CEnPWD) + My_Hex(Crc Mod 256)
  End if
End Sub

Sub UnPWD(UnPWD_Source)
  If Len(UnPWD_Source) 6 Or Len(UnPWD_Source) Mod 2 = 1 then
   CUnPWD = 0
   Exit Sub
  End If
  Old_Key = My_UnHex(Left(UnPWD_Source,2))
  Old_Crc = My_UnHex(Right(UnPWD_Source,2))
  Old_String = StrReverse(Mid(UnPWD_Source,3,Len(UnPWD_Source)-4))
  For i=1 To Len(Old_String) - 1 Step 2
   Temp_Value = My_UnHex(Mid(Old_String,i,2))
   Crc_Temp = Crc_Temp + Temp_Value
   Temp_String = Temp_String + Chr(Temp_Value Xor Old_Key)
  Next
  If Old_Crc > (Crc_Temp Mod 256) Then
   CUnPWD = 403
   Exit Sub
  End If
  CUnPWD = Temp_String
End Sub
End Class

%>

 

標(biāo)簽:中山 襄陽(yáng) 朔州 邯鄲 雞西 遵義 柳州 威海

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《怎樣給文件加密最安全?》,本文關(guān)鍵詞  怎樣,給,文件,加密,最,安全,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《怎樣給文件加密最安全?》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于怎樣給文件加密最安全?的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章