Miller Letter Cipher

This code allows us to input a text and encode or decode it with the Miller cipher, which adds the previous ciphertext letter to the next letter in the text in a small Caesar cipher.  Note we send A --> 0 and Z --> 25

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

addletters[input1_,input2_,addsubtract_] := Module[{},
temp = Mod[(ToCharacterCode[input1][[1]] - 65) + addsubtract(ToCharacterCode[input2][[1]]-65),26]+65;
temp = FromCharacterCode[temp];
Return[temp];
];

addletters["E","G",1]
addletters["I","C",-1]
Mod[ToCharacterCode["A"][[1]]-65,26]
(*bob = "D"
addletters["B",bob]*)

tempdata

(* Last argument: 1 to encode, anything else to decode *)
millerlettercrypt[data_,firstletter_,codeordecode_] := Module[{},
If[codeordecode == 1, sign = 1, sign = -1];
tempdata = Characters[data];
(*tempcodeword = Characters[codeword];*)
tempvigeniereword = {};

codeddata = {};
currcodeletter = firstletter;

For[n = 1, n ≤ Length[tempdata], n++, 
{
(*If[sign == 1,newletter = addletters[tempdata[[n]],currcodeletter,sign],newletter = addletters[currcodeletter,tempdata[[n]],sign]];*)
newletter = addletters[tempdata[[n]],currcodeletter,sign];
codeddata = AppendTo[codeddata, newletter] ;
If[sign == 1,currcodeletter = newletter, currcodeletter = tempdata[[n]]]; 
} ];
Print[StringJoin[codeddata]];
];

millerlettercrypt["HELLO","C",1]

millerlettercrypt["HELLOCRYPTOCLASSIVECREATEDANDWRITTENTHISCODEWHILEFLYINGBACKTOTHESTATESONNORTHWESTFROMAMSTERDAMTODETROITIHOPEYOUALLHADAFUNANDPRODUCTIVEWEEKIHADANICESTAYINENGLANDTHETAXIDRIVERWHOTOOKMETOTHEBRISTOLAIRPORTHADAFAMILYMEMBERINVOLVEDINTHENORMANDYLANDINGSANYWAYIMABOUTTOGETACOPIOUSSNACKSOINEEDTOPUTMYLAPTOPAWAYFIFTYBONUSPOINTSTOANYONEWHOEMAILSMEBOOLABOOLABOOLABOOLABOOLABOOLABOOLABOOLAWHENWEROUGHUPPOOROLDHARVARDTHEYWILLHOLLERBOOLABOOIVENOWLANDEDSUCCESSFULLYINDETROITANDAMWAITINGFORMYCONNECTIONTOALBANYILLADDABITMORETEXTINCASEYOUTRYUSINGAFREQUENCYANALYSISILLENDWITHTHEFIRSTTWOLINESOFONEOFMYFAVORITEPOEMSNAMELYITWASINTRUTHANEAGERYOUTHWHOHALTEDMEONEDAYHEGAZEDINBLISSATMEANDTHISISWHATHEHADTOSAY","E",1]
millerlettercrypt["LPALZBSQFYMOZZRJRMQSJNNGKNNADZQYRKOBUBJBDRUYUBJUYDOMUHNOOQATHAHLDWWPTLZMZNEXEAEWPULZLLXPIMDGGSLZCGZQEMFNUIXBZNHHSDKKNNSMZZMPEVJMGIBJEIEIMWELLOOBJLPHAAYGTXKQBBORKRVOOLTWNVQULHOCVJXHTXQEXEIJAIATHSSARGULELLOOTTFNYWIMYZDUCPKYJEILTGZGKXLCOOBECNNADLYEWWJHDDBJVVWKEXQEKOHHJXMUICUMZZBLDRZMQUXQETNGSQBBQJXMMIIGLTYRPQERLDSGOBUMFTTGESFJFMAEQQYJBNRSGUFFGUITTUIWHHIWKVVWKYJJKYMXXYMALLMAOZZVCGTPTKYSYFZODRFWKVYFFWRRILELPNJRCNUITEIZAOCNNOCQYTXKYUFFSVZCUOQSWOGLFQBZHUXBULZHAANQQCYYGZHUAFTKWUWKXKOQJRFSLZZKLLYWEPAADGGHPIUIZDWAXQYLNNFJHVPIZXRJREKKPGKAUYLNLLYYJHZHZHSDHUXTBUBUBFKSJBUNJXIQDHZNSGTXLQCAFFAOFNGKZNRDVIIUYJHPIEEWERKBVOVVIMMSWNLZTMTPWKRRCVZCOSGTXAAYFJPPOSVDQRCKCUUNZDDQTMTBTBTPWWPWAHHKDRJJH","E",-1]

HARDER VERSION -- NO HELLOCRYPTOCLASS

millerlettercrypt["IVECREATEDANDWRITTENTHISCODEWHILEFLYINGBACKTOTHESTATESONNORTHWESTFROMAMSTERDAMTODETROITIHOPEYOUALLHADAFUNANDPRODUCTIVEWEEKIHADANICESTAYINENGLANDTHETAXIDRIVERWHOTOOKMETOTHEBRISTOLAIRPORTHADAFAMILYMEMBERINVOLVEDINTHENORMANDYLANDINGSANYWAYIMABOUTTOGETACOPIOUSSNACKSOINEEDTOPUTMYLAPTOPAWAYFIFTYBONUSPOINTSTOANYONEWHOEMAILSMEBOOLABOOLABOOLABOOLABOOLABOOLABOOLABOOLAWHENWEROUGHUPPOOROLDHARVARDTHEYWILLHOLLERBOOLABOOIVENOWLANDEDSUCCESSFULLYINDETROITANDAMWAITINGFORMYCONNECTIONTOALBANYILLADDABITMORETEXTINCASEYOUTRYUSINGAFREQUENCYANALYSISILLENDWITHTHEFIRSTTWOLINESOFONEOFMYFAVORITEPOEMSNAMELYITWASINTRUTHANEAGERYOUTHWHOHALTEDMEONEDAYHEGAZEDINBLISSATMEANDTHISISWHATHEHADTOSAY","W",1]
millerlettercrypt["EZDFWAATXAANQMDLEXBOHOWOQEHLHOWHLQBZHUABBDNGUNUYQJJCGYMZMARKRNRJCHYMYYKCVZQTTFYMPTMDRZSAHVKOMAUUFQXXAAFZMMZCRIWZTVOWRVRVZJRYYBBOWYCUNNLTGKXDOOBEXEIBBYGJAIDHYUBPIWKUGKDRKRVWNVNGUFFNETHYRYYBBGGSALJVZLMQHPCXLWRVYGTMTXKYPBBORPAANQYLRJJWUQQOWIIJXRKDRXBUUWKZHVPHZMMOYQEMZDHKDRGATFDOODWKZZVVTYGLECDREYQFTBOHZSGGTRFSWSZNRDDLWOAEFTHSSTHVGGHVJUUVJXIIJXLWWXLZKKLZNYYZNBMMIPTGCGXLFLSMBQESJXILSSJEEVYRYCAWEPAHVGRVMNBPAABPDLGKXLHSSFIMPHBDFJBTYSDOMUHKOHYMUNNADDPLLTMUHNSGXJHJXKXBDWESFYMMXYYLJRCNNQTTUCVHVMQJNKDLYAASWUICVMKEWERXXCTXNHLYAYYLLWUMUMUFQUHKGOHOHOSXFWOHAWKVDQUMAFTGKYDPNSSNBSATXMAEQIVVHLWUCVRRJREXOIBIIVZZFJAYMGZGCJXEEPIMPBFTGKNNLSWCCBFIQDEPXPHHAMQQDGZGOGOGCJJCJNUUXQEWWU","W",-1]