ciao a tutti...
ho trovato nel forum questo script (mi pare fatto da baol) per criptare una stringa...
il fatto è che funziona ma mi tira fuori carateri troppo strani che mi potrebbero creare problemi nell'inserimento del DB...
si puo modificare in modo che tiri fuori una sequenza di numeri e lettere?
vi posto il codice:
codice:<%Function Crypt(Value,Hash) Dim i,Ch,Result,XorValue If Hash = "" or IsNull(Hash) then Hash = session.SessionID Result = "" Hash = cStr(Hash) XorValue = 255 for i=1 to Len(Hash):XorValue = XorValue Xor Asc(Mid(Hash,i,1)):next for i=1 to Len(Value) Result = chr(asc(mid(Value,i,1)) Xor XorValue)& Result next Crypt = Result end function Function Decrypt(Value,Hash) Decrypt = Crypt(Value,Hash) end function Testo = "Testo da Criptare" Hash = "axbxcx" StringaCriptata = Crypt(Testo,Hash) Response.Write(StringaCriptata & " ") 'Per decriptare la stringa dovrai conoscere l'hash Response.Write(Decrypt(StringaCriptata,Hash)) %>

Rispondi quotando