Input the ciphertext (Press Shift+Enter)

ciphertext = "bntrbhrrvjmrrffhzcuicqzeawybaeaadrawrrvcmtrrjhaaaeuzcnqaeqtupykuqsftfegifasbctfodrbhvnxgpaghrcxeaeugwtuedjpeatyrgwrrvfmnganngfeodywnqoeqcrvnxgpejaiomcnujrwfghvnqreazqatuepjmrrsvabtbtyrpohsvbnaaocqxrbfvfaoewybtiieuvvtueyrirgowgpepolabrltvauiyejszoztyrvenrvfbrnicjiyftrgqoaaeqbwbmzymssrfzbhrnvnzeftgbatbfwvkeueynlnbwzsmaadyrtiieuvvaieiltaegvuwufenvbhnhfhaexevcmrpacymdzrjziceerqgaadkuzersvedaatjgpevrenuefwvemiiydnzgnrvginqbvgbyoukgpeldfawtpodrqngokumsgoiluuphyrpizsvynwnsrimrlocquaawzgpsuaxtgwuikrpavrnuqcugireoieizwsgowuqssatrisjecyisbnyvahraunvdghvltixeuuqmnldbatntfakeoukbvtuewvzsgemrviagnumnuetnuebukgwmrekgpezakgpesrfabdboiumwnsjbwdqlfbsiagkuityutlehbwrfbhryfhvgrskjisnlzgblraweiiqowuqmnnurlmhnujpojajgpeaeoggohnxratjaegmdgocncguaeqpaqtfxmecoeczegeeqqnthvjisolfjqnthzfvofekbpiqezgisfofaisghvlpaqsrvlgbouaqgutkbbhrpibnefsfeinqgfamucsknqrfoegpesiifbnvgygbhrbflacnmvvvtbtyroieljewozaeqbhryryttnlbrligomrzwrvvsilyeebvohrwrmtnnuawmvsknsefazqxegeigpifijtwiagkbjeceismcglpfxlrnuvltuakbtdphrceiylcrbufdfnvyghzaowrlzxmighzashrsrawlqdvnzsniufcsnnfukozefsnigsrvleqmlalwuonnatvrvqinqpirbeadzaonbtkbjegiirlwuituiljapfuaqeyvubndkruprrvqloatxbwngacxqntlzxmtuakyqkrwynbsniufcsnnralaaynngigskvueloljmrrieomdgrpvvggokntkyibruoghveaavdvquuadralwuoremybukbaalwyrviztftwtbbvqoogosrlybuifmlshrqvtjerytbrtkrzgbtfomdfazqtupykumrrsjhzegosrirbwzseeeeyrirqtrysiagyrzeaokumrrwfabsniucmtrrzgmlyyfhbhvszfbhrsfeboshfhaejhvemnboeragbietbozieqehntnrlonnpjiyghvleoatyrirhszgaaoolgbeamzactrsnntksrfzpeeeubengokuitqievvgeofzinqaelimbuegwfftrvzsnnucisfaxraiabvgeernnuitftynbnbijraavdchkyfuuqmnyyzgeafawnzlnrxrzhbujrbhnnjumhndvimroevaqnoewbzennugpeghfhohgowntlghffmlbnxcisfaxraaadibesbfubwrflvnliagzabormgggrbodfeafbvtqnaietbozabrpeefvrtayikgteprvrxyvtjbvllasvzdficygsniurlmhnuvbsnnfjtsniucmtrrkuqsvsxbqnttfomajoeqmrsucctapewbzbvrufqsuacyoogosrlnbwzfiyyekfoonnurfpyoirbozoiewwlolzqgutwvvdnnpgpiagzaipyatrtixekuqsqiulwufevgpofedbcngazaaafwvpimracbvgnnugpejofqatueiruithkomengcratueiruithkomsgaxfbhrrvytbrhrjssoautmrfsrvllhcpswxrsjnqdrddhvdeasoqtfsrvlshsrajugwyrvnrxkzwraietkazekumrrwrfisgerqgrniesilyietaoghzpstuakjpeayfhtobkvqwugowgpejieqwwlolpwuydjrmnrikumrghvzwuatrvvsaoigpejofqanbrvimnghvfbrradvvtuexnzdrnfskohrjrqtjolylbrrrvviagjnqdrddhvdghvlpaqjlfbfvnzfpeqtyrqrorvnsfnskjqtutyrxrbfvfaoeaeqeeeelcatniifqnghvewozhvuidfeknxaetwbztuedntoagcberbodjqtutnbeiadfjalbobvvgbukvvoaeuvzeptzbvaadkjwiaaebbhrrubatbpxecmolzaoeqsrvlshsrabeatfbvevtcyklraihxiaaeuwueoifwaadzabhrmvnvtvmvjmrrpirbtlwvytosfkumrrsrjqrrlvfaaadcbbsbfsbwkfnfgnoemvfiiqpvgmrvmxbqnttfrfpyoirqnghvuwufevimrloerigeevqboghzfinqtynbwnsybetuerqdeatlemsoexnvigwrfbhrsfeboshfhaeghrggohnvimrfevzbopodrboghvrvdbfraligwrfnuylfscnrxgrktrdgyicrskumfvrjgnejdfbzsghvlbrveuymdbnclqngojcirrbvqzobmjnaeieilwnrhrqmxcetgmdghrgbhrynbclqblgaobnkumypadrbonvveglbnxewozflytospzpbueejnvdghvemtuepswuadrfcigownzmbuinvdnfkrztuakjisnrfbuaylyhvgjikuorreejqtuaynzpvnfamcbrerzaadkumnpadrbheevfbecsubennnusqvrskrxshpraltueensiadfstigtcrcpftrvzsuacyinqaubwrghrgteqolgwngoroilpoelinqtyrvajhfymsrrzraosrfbusghrgteqiegwencybbhrrralwrrvyqnrdnvbhoofxambskbntuedimrlocqjobkjnvdfodrjitgvebhnnroqbyezaicuuippaadjuwrglpnntrrkuitghvltobkvqqngorewoztynbwnshhqtredcbyrxtrxtsoibveoixjirqrfomtuejbztghrgpafacbwkvnxttafszabhrdfbztueireafnfgpiagvyaevnkumrbodnbaylvkkectrqmaqbchmbbtkymoatyreiadfjaiylebbhvnxgpeeejnqdcekrzaadkumynlcgzobpvqwugaxnqnnlcrfcrpkycclsyratnyvqjeuieqjepalfmsuekuwuthkvbwbucqjejoigpwuicrbrlietbhrdfbzostyreaedibjervvabhbuxuahrfvybaymffbshrvgpagikjwuydsrtopkvqboueifcrcrzfmigogrveqqlvberajvtynnugeozokujayljqzocpvqwuglfbsiagzaboghvvvsvdvfpefanfmvrrrykontjuintietcpzojgtyyoetnuecfnbsghvemwnsebbhvnxyccllzxmdfodhkhnskumszecyinqfvrtosfleahridzmdvakrtyftvcxeqiegwtuennzdeosrinqgfgqnnmfaotuetbitfaeqzuobvqpeefrpmatazaatghvztenvzaotueubwrbpvawfpoleaeoetncsrsyrsnrwkuitvtzfdeeywbwlvsygwsuukbvefecsqngoragwnruewbrsfbvsuenrvtsuigpeeienvdsolaltuakgpeeennaafetbvdeonbncbakfpaagzaoucbvuqnqtyrnieskbvevtnnaaymffbqhikrlaekzabhrrvnvdfhvxmpghveirzsjgzegcyrlohtzanrbnkbnhrrjbisaokgwbhmgumrsatrqngokumbncbbntuennzdeosrahrtfbsaftvcnuetyrziatyrvtjofebheevfbecsryealsvkxeptzaotbfvrtwboujwrxaxnqnftkumtvpjbnhrrwvvgrrjoctfhvpwuydebbfrecvbtuijzcsgbvnaizpclmnbrdbcsjaiqzooekuwuthkycclgfvvgftzytfhrkumrvnralphsyvvgghvfwfgffylsbfkumcbakfisvdvgwmnkvewozffepeetyrvsueebbipeugpagtyrzejajfwmrtyvvgprlakhvnxhvdrryrzfrekveoadveqsghrguoeedbbhoacyasuekuwuthkfbobpzaodbwegwfrecvbwvtyumruaeqjugiefbendfsnerlzaotueynzdfmfbbhjofqwfghvstobrfsbhrwrelrbbvfpesecgaozekuqntsfsbaadgbedrrpnvdrxkemmrlppwlqtyvaifvvegqheveahrsrvlaadnrvtbnrfbecoigeosuigpeenvkbmbmvabsuewbcnqtynbwuakjiseusoqntaxnqnftyrzfncvnvduaeqawnsebtoagveaostwhzbhtjbueghzaohnrunvdeoltpaadvimncrzpsllwylqtvsahatyibrjrnntumsbfkemefeoptavmvqtupyraltueefpefangpagtyrzejajntithknpendfspeenfgifrwzakhrsrjiyjhvemtuesnkkbfkumwnruewbroltptgoyndeoevajugacbvgjapbnffodrbhvnxpwlqaeqaostnnafnlcvvgbnyrzazodrvtyakrzsuewbcnqtynbsuennasgaeqqntiegpeziuqtebfrjwoqakaqgutkvuejikuanbwlaleehvenertralsaonstaxejsilyietbheoltptuervzlhcpsmlgacvbtyeweqgutvamdoukfpesecgdeeyzayuvszgqvraeqmxpikrlafwvytsuecbwkrdsnkkbvvepeesybclqeinvdghvembrtnrmnghvqirxtirmteuexasuetbclqskvtlfevgpebpvalobrnngostyreaedibjennurdeacrgkhngcvupfefsbhredcbyeofznrbmnuqcusyrpaqsvgwugsyrpaqowpwuesvymfgtyrlobrfcmnsoifpexnvjbhntzgqsnvvegsvlclbhvnxgwsuukbvefecsqngorjirqrfomigsvrueqtfomsgicylallztptghvemipaentwnyjtmtoatxqfnnpgpiagxbmsjrfaotuoltptyutlahrbvtingonntksoijirqcihvcucihvcuomrztuejawwnnugprbuxubhrwfbltbwrelsghvbbhrrcvohgienjohtkrvmvnlgmsfhvemaphvqqtnnuswuadzgeafacnupcojgisfhvfbobdcbwkvnxnbigwfaleeietehltyrzejajntazpgbatvnkummvduymosanbwdnnujwnqeivvgjhrgboqoerftfhvumaedrcqtgeicitgeibnfrekpwmvnxgwwnrufpeeaeqaobnrsbeetynbaieilateaetmprrjbvsgegcmdbukszozadbvgghvgzerszaboghvyqgutfsbhrlrzxpbskumwnsfatynlzgblrtryteetynvlhcpumrfecsinqhvpireivqwvrryvahraunvuzbirtlnwyvbejikuanbwwewmghvjiiftlceaedjumwnscvsenmrajughzftetsnrzefhrcmdyibrigbakfbhrhrvzoatyruwnsxywsfysyicxaeqqnftvnlosfvrbhrhrqoontjuwossyrilfoynlagazyjugllpgdvdebbnbtzpmtuijnbfvrjgjepalfmigwrfventclkahgygcpbvvebhraizbhntyrtdghvhubeecyisbajgwkregvbfeodgzavlzaoiatyranbwyrpaqairlwbocymnzuwsteerfhvduijamcxaeqpifsbvvwnsinbhrrirldvsygwoueynlaftinvgrblgxlrajnvtyikgtesatreighrfpoetgbqngeuomaedralchrclpavrralohtfsbhrhrvztueirathcbgeouoiaaoaefamaphjvlebfyvafbrvumaqoerwfuijuinqsrfqhnvvfiiqhvyltuelzjrrlcnqnghvbbhrrreuhrcrezirdjrdeeacozojngnxeeprekeysnuitjikubhrprekeysraltuejawwvtcbwkrdahatnszspeuauomeadfvvguijpprvskzisfhfcxiagyreafawncnnnujpeahvfiwyutlpetamrauphrfbaetfsauepivaeghrgpeqrfcxeqacypifprekeysxbwdaejfornczbcszevkklnidrltuewncn";

Define functions: Index of Coincidence, Slide (+l)

Index of Coincidence: input two strings

IndCoinc[InputString1_,InputString2_]:=Sum[KroneckerDelta[Extract[Characters[InputString1],{i}],Extract[Characters[InputString2],{i}]], {i, 1, Min[StringLength[InputString1],StringLength[InputString2]]}]/Min[StringLength[InputString1],StringLength[InputString2]]

Slide string forward: input string y and slide amount +l, get (y^((+l)))

SlideStringPlus[InputString_,ell_]:=StringRotateRight[InputString,ell];

Find key length: try key lengths from 3 to 12.  The first two are done for you.

IndCoinc[ciphertext,SlideStringPlus[ciphertext,3]]

N[IndCoinc[ciphertext,SlideStringPlus[ciphertext,3]]]

IndCoinc[ciphertext,SlideStringPlus[ciphertext,4]]

N[IndCoinc[ciphertext,SlideStringPlus[ciphertext,4]]]

Define functions: Simple Shift Cipher, Slice String

Shift Cipher: input string and key

ShiftCipher[InputString_, key_]:=FromCharacterCode[(Mod[ToCharacterCode[InputString]-97+key, 26]+97)]

Slice: input string, slice number (0, 1, 2, ...), period (m)

Slice[InputString_,i_,m_]:=StringJoin[Table[Extract[Characters[InputString],{1+i+m*iterate}],{iterate,0,Floor[(StringLength[InputString]-1)/m]}]]

Find differences between key numbers

Fill in your guess for the key length/period (m) and press Shift+Enter

m=

Make the slices that you need.  You need to get m slices. The first two are done for you.

Slice0=Slice[ciphertext,0,m];
Slice1=Slice[ciphertext,1,m];

Compare slices to find the difference between the numbers in the key.  For example, to find (Subscript[k, 1])-(Subscript[k, 0]) try these commands:

Data0to1=Table[{t, N[IndCoinc[ShiftCipher[Slice0, t], SlideStringPlus[Slice1,3*m]],2]},{t, 0, 25}];

TableForm[Data0to1]

ListPlot[Data0to1, PlotRange->{0,.1}]

Find the key

By hand calculation, write the key in terms of the single unknown  (Subscript[k, 0]).  Fill in your guess  below by filling in the question marks

k[k0_]:=Mod[{k0, k0+?, k0+?, ...}, 26]

Isolate the initial block of the ciphertext; this should be enough to determine the key.

InitialBlock=StringTake[ciphertext, m]

Make a table trying all values of (Subscript[k, 0]) to determine the key and crack the cipher!

TableForm[Table[{k0,FromCharacterCode[Mod[ToCharacterCode[InitialBlock]-97-k[k0],26]+97]},{k0,0,25}]]