Verschlüsselung nach de Vignère

'Z' )||($txt[$t] < 'A')){ $verschl .=" "; } else { $shift=ord($txt[$t])+ord($schl[$i])-ord('A'); if ($shift > ord('Z')){ $shift=$shift-ord('Z')+ord('A')-1; }; $verschl .= chr($shift); $i++; if ($i >= strlen($schl)){ $i=0; } } } if (strlen($schl) == 0){ echo "bitte Schlüssel eingeben (nur Buchstaben)"; $txt=""; } else { echo "Schlüssel: $schl

Eingegebener Text:" .htmlentities($txt)."
Verschlüsselt:$verschl
Entschlüsselt:"; } $i=0; for ($t = 0; $t < strlen($txt); $t++) { if (( $txt[$t] > 'Z' )||($txt[$t] < 'A') ){ echo " "; } else { $shift=ord($txt[$t])-ord($schl[$i])+ord('A'); if ($shift < ord('A')){ $shift=$shift+ord('Z')-ord('A')+1; }; echo chr($shift); $i++; if ($i >= strlen($schl)){ $i=0; } } } echo "

Schlüssel:

Text:

";