Task

Implement a   Vigenère cypher,   both encryption and decryption.

The program should handle keys and text of unequal length,
and should capitalize everything and discard non-alphabetic characters. 

(If your program handles non-alphabetic characters in another way,
make a note of it.)



Related tasks

   Caesar cipher
   Rot-13
   Substitution Cipher


fcn encipher(src,key,is_encode){
   upperCase:=["A".."Z"].pump(String);
   src=src.toUpper().inCommon(upperCase);  // only uppercase
   key=key.toUpper().inCommon(upperCase).pump(List,"toAsc");
 
   const A="A".toAsc();
   klen:=Walker.cycle(key.len());  // 0,1,2,3,..,keyLen-1,0,1,2,3, ...
   src.pump(String,'wrap(c){ i:=klen.next(); c=c.toAsc();
      (A + ( if(is_encode) c - A + key[i] - A;
      	     else	   c - key[i] + 26 ) % 26).toChar()
   });
}