ASP常用函数收藏乱七八糟未整理版(31)
Dim bytKey(31)
Dim bytIn()
Dim bytOut()
Dim bytTemp(31)
Dim lCount
Dim lLength
Dim lEncodedLength
Dim bytLen(3)
Dim lPosition
If Not IsInitialized(bytMessage) Then
Exit Function
End If
If Not IsInitialized(bytPassword) Then
Exit Function
End If
For lCount = 0 To UBound(bytPassword)
bytKey(lCount) = bytPassword(lCount)
If lCount = 31 Then
Exit For
End If
Next
gentables
gkey 8, 8, bytKey
lLength = UBound(bytMessage) + 1
lEncodedLength = lLength + 4
If lEncodedLength Mod 32 <> 0 Then
lEncodedLength = lEncodedLength + 32 - (lEncodedLength Mod 32)
End If
ReDim bytIn(lEncodedLength - 1)
ReDim bytOut(lEncodedLength - 1)
Unpack lLength, bytIn
CopyBytesASP bytIn, 4, bytMessage, 0, lLength
For lCount = 0 To lEncodedLength - 1 Step 32
CopyBytesASP bytTemp, 0, bytIn, lCount, 32
Encrypt bytTemp
CopyBytesASP bytOut, lCount, bytTemp, 0, 32
Next
EncryptData = bytOut
End Function
Public Function DecryptData(bytIn, bytPassword)
Dim bytMessage()
Dim bytKey(31)
Dim bytOut()
Dim bytTemp(31)
Dim lCount
Dim lLength
Dim lEncodedLength
内容版权声明:除非注明,否则皆为本站原创文章。