with new rulebase, going to lead anyways, 382:

Code:

function vigenere($t,$k,optional $d)
dim $j,$r,$,$p,$o,$y
for $j = 65 to 90
$ = chr($j)+$+chr($j+32)
next
$p = "0123456789"+$
for $j = 1 to len($t)
do
$ = left($k,1)
$k = right($k,-1)+$
$y = instr($p,$)
until $y
$ = substr($t,$j,1)
$o = ($o+($=" "))*(0=instr('!?.',substr($t,$j-1,1)))
$r = instr($p,$)
if $r
$ = 62 - (ucase($t+$k)=$t+$k)*26
$ = substr($p,1+($+$r+(2*($d=0)-1)*($y-$o-2)-1) mod $,1)
endif
$vigenere = $vigenere + $
next
endfunction

_________________________
!

download KiXnet