sPlain = "0000000000000000"
g_CryptThis = sPlain
Const g_KeyLocation = "/code.txt"
Dim g_Key
g_Key = mid(ReadKeyFromFile(g_KeyLocation),1,Len(g_CryptThis))
Function ReadKeyFromFile(strFileName)
Dim keyFile, fso, f
set fso = Server.CreateObject("Scripting.FileSystemObject")
set f = fso.GetFile(strFileName)
set ts = f.OpenAsTextStream(1, -2)
Do While not ts.AtEndOfStream
keyFile = keyFile & ts.ReadLine
Loop
ReadKeyFromFile = keyFile
End Function
sPassword = g_Key
MyEncrypt(sPlain, sPassword)
Public Function MyEncrypt(sPlain, sPassword)
Dim bytIn()
Dim bytPassword()
Dim lLength
Dim lCount
Dim sTemp
lLength = Len(sPlain)
ReDim bytIn(lLength-1)
For lCount = 1 To lLength
bytIn(lCount-1)=CByte(AscB(Mid(sPlain,lCount,1)))
Next
lLength = Len(sPassword)
ReDim bytPassword(lLength-1)
For lCount = 1 To lLength
bytPassword(lCount-1)=CByte(AscB(Mid(sPassword,lCount,1)))
Next
bytOut = EncryptData(bytIn, bytPassword)
sTemp = ""
For lCount = 0 To UBound(bytOut)
sTemp = sTemp & Right("0" & Hex(bytOut(lCount)), 2)
Next
MyEncrypt = sTemp
End Function
// fichier code.txt
Supprimé pour raison de sécurité
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question