Vigeniere Cipher

This code allows us to input a text and encode or decode it with the Vigniere cipher

shifter[input_,shift_] := Module[{},
temp = Mod[(ToCharacterCode[input][[1]] - 65) + shift,26]+65;
temp = FromCharacterCode[temp];
Return[temp];
];

(* Last argument: 1 to encode, anything else to decode *)
vigenierecrypt[data_,codeword_,codeordecode_] := Module[{},
If[codeordecode == 1, sign = 1, sign = -1];
tempdata = Characters[data];
tempcodeword = Characters[codeword];
tempvigeniereword = {};
For[m = 1, m ≤ 2 +Length[tempdata] / Length[tempcodeword], m++,
For[k = 1, k ≤ Length[tempcodeword], k++,
{
tempvigeniereword = AppendTo[tempvigeniereword, tempcodeword[[k]]];
}]];
(*Print[StringJoin[tempvigeniereword]];*)
codeddata = {};
For[n = 1, n ≤ Length[tempdata], n++, codeddata = AppendTo[codeddata, shifter[tempdata[[n]],Mod[ToCharacterCode[tempvigeniereword[[n]]][[1]]-65,26]*sign    ]    ] ; 
  ];
Print[StringJoin[codeddata]];
];

vigenierecrypt["THEREISNOPOSSIBILITYOFTHINKINGOFANYTHINGATALLINTHEWORLD","MORALS",1]
vigenierecrypt["FVVRPAEBFPZKEWSIWAFMFFEZUBBIYYATRNJLTWEGLLMZCIYLTSNOCDP","MORALS",-1]

vigenierecrypt["HELLOCRYPTOCLASSTENBONUSPOINTSTOANYONEWHOEMAILSMEGOREDSOX","KAYLAMILLER",1];
vigenierecrypt["HELLOCRYTPOCLASSTHEKEYWORDFORTHEFIRSTMESSAGEISKAYLAMILLER","C",1]

vigenierecrypt["REJWOOZJAXFMLYDSFMYMSEESNZIZBDESRXYMYEIPZPQRSLQXESWCPHJYX","KAYLAMILLER",-1];
vigenierecrypt["JGNNQETAVRQENCUUVJGMGAYQTFHQTVJGHKTUVOGUUCIGKUMCANCOKNNGT","C",-1]