Passwort ver-, entschlüsseln |
|
Diese kleine Script dient nur dazu einen schnellen Blick auf das Passwort zu verhindern. Das Script verschlüsselt ein Passwort. Die Ergebniszeichenkette wird dann wieder in das Passwort zurück gewandelt. ' Passwort ver-,
entschlüsselt
' Original stammt von activevb.de Option Explicit Dim sVerschluesselt, sEntschluesselt, sPasswort sPasswort = "ist geheim" Const cKey = "si_oU75&iacut;EkO19drslI" ' Verschlüsseln und ausgeben sVerschluesselt = Crypt(sPasswort, cKey, True) WScript.echo sVerschluesselt ' Wieder entschlüsseln sEntschluesselt = Crypt(sVerschluesselt, cKey, False) MsgBox "Passwort : " & sEntschluesselt & vbcrlf & "Verschlüsselt : " & sVerschluesselt, vbOK, "Passwort ver-, entschlüsseln" Private Function Crypt(Inp, Key, Mode) Dim z, i, Position, cptZahl, orgZahl, keyZahl, cptString For i = 1 To Len(Inp) Position = Position + 1 If Position > Len(Key) Then Position = 1 keyZahl = Asc(Mid(Key, Position, 1)) If Mode Then ' VerschluesselnorgZahl = Asc(Mid(Inp, i, 1)) cptZahl = orgZahl Xor keyZahl cptString = Hex(cptZahl) If Len(cptString) < 2 Then cptString = "0" & cptString z = z & cptString Else ' EntschluesselnIf i > Len(Inp) \ 2 Then Exit For cptZahl = CByte("&H" & Mid(Inp, i * 2 - 1, 2)) orgZahl = cptZahl Xor keyZahl z = z & Chr(orgZahl) End If Next Crypt = z End Function |