ROT-13
Zielsetzung
Einfache "Verschlüsselung" von Text mit dem ROT13-Algorithmus:
A<->M, B<->N, ... .
Realisierung
Eine VBScript-Funktion könnte z.B. so aussehen:
function rot13(text)
r=""
for i=1 to len(text)
x=asc(mid(text,i,1))
if x>=65 and x<=90 then x=x+13:if x>90 then x=x-26
if x>=97 and x<=122 then x=x+13:if x>122 then x=x-26
r=r+chr(x)
next
rot13=r
end function
Dieser Aufruf der Funktion gibt Hallo Welt!
zurück:
msgbox rot13("Unyyb Jryg!")
|