Beruflich Dokumente
Kultur Dokumente
17.10.2012
Patrick Rockenschaub
Original
eituih, rinsfy ltgivtl mwb livu sf mrim cgiet, kteixut rt ril ifmsescimtl mrim, sf mrt fimxhig ebxhut ba tntfmu, uxer wbxgl kt mrt ebflxem ba nthesfytmbhsq, gtintu mrt ihdv xflth chtmtfut ba hisusfy htehxsmu ifl einighv: rt cgietu khxmxu, i vbxfy dif, sf ebddifl ba mrtut abhetu; rt ysntu rsd sfumhxemsbfu mrim mrt einighv urbxgl hifyt iu tqmtfusntgv iu cbuuskgt sf igg lshtemsbfu; mrim rt wbxgl tqthm rsdutga fbm mb kt ikutfm ahbd mrt eidc gbfyth mrif mrhtt livu. rinsfy ihhifytl mrtut dimmthu, rt dihertu mb nstffi kv iu gbfy zbxhftvu iu rt eif, wrtf rsu bwf ubglsthu lsl fbm tqctem rsd. asflsfy mrtht i ahtur kblv ba einighv, wrser rt ril utfm bf mb mrim cgiet utnthig livu ktabht, dihersfy sfetuuifmgv fsyrm ifl liv, rt ilnifetl hicslgv mrhbxyr mrt mthhsmbhv ba mrt itlxs sfmb mrim ba mrt gsfybftu, sf wrser mwb gtysbfu wtht wsfmthsfy, mrim, sa ifv cgif iaatemsfy rsu bwf uiatmv urbxgl rint kttf bhyifsotl kv mrt itlxs, rt dsyrm ltatim sm kv mrt hicslsmv ba rsu dbntdtfmu. wrtf rt ihhsntl mrtht, rt utflu sfabhdimsbf mb mrt htum ba mrt gtysbfu, ifl yimrthu igg rsu ihdv sfmb bft cgiet ktabht sfmtggsytfet ba rsu ihhsnig ebxgl kt iffbxfetl mb mrt ihnthfs. nthesfytmbhsq, bf rtihsfy mrsu eshexdumifet, gtilu kiej rsu ihdv sfmb mrt ebxfmhv ba mrt ksmxhsytu; ifl iamth dihersfy ahbd sm mb ythybnsi, i mbwf ba mrt kbss, wrbd eituih ril utmmgtl mrtht iamth ltatimsfy mrtd sf mrt rtgntmsif wih, ifl ril htflthtl mhskxmihv mb mrt itlxs, rt ltmthdsftl mb immiej sm.
Histogram Text
Introduction to Security
17.10.2012
Patrick Rockenschaub
[p: 0.0%, o: 6.849315068493151E-4%, z: 6.849315068493151E-4%, j: 0.0013698630136986301%, q: 0.003424657534246575%, c: 0.00821917808219178%, w: 0.010273972602739725%, k: 0.012328767123287671%, n: 0.014383561643835616%, d: 0.01643835616438356%, v: 0.01780821917808219%, x: 0.01780821917808219%, a: 0.01986301369863014%, y: 0.02054794520547945%, g: 0.026027397260273973%, e: 0.028767123287671233%, l: 0.03424657534246575%, u: 0.04315068493150685%, b: 0.04863013698630137%, h: 0.05136986301369863%, r: 0.05684931506849315%, s: 0.05821917808219178%, f: 0.06095890410958904%, i: 0.07260273972602739%, m: 0.07534246575342465%, t: 0.1047945205479452%]
Manual changes
The first word, laeras, looks very similar to caesar. As a result of the knowledge that the whole text is from ceasar I exchange l with c and s with r: l <--> c s <--> r
caesar, nayiou delafed tbh dafs io tnat vlace, pecawse ne nad aoticivated tnat, io tne oatwral chwrse hm eyeots, swcn bhwld pe tne chodwct hm yerciouethrik, leayes tne argf woder vreteose hm raisiou recrwits aod cayalrf: ne vlaces prwtws, a fhwou gao, io chggaod hm tnese mhrces; ne uiyes nig iostrwctihos tnat tne cayalrf snhwld raoue as ekteosiyelf as vhssiple io all directihos; tnat ne bhwld ekert nigselm oht th pe apseot mrhg tne cagv lhouer tnao tnree dafs. nayiou arraoued tnese gatters, ne garcnes th yieooa pf as lhou xhwroefs as ne cao, bneo nis hbo shldiers did oht ekvect nig. miodiou tnere a mresn phdf hm cayalrf, bnicn ne nad seot ho th tnat vlace seyeral dafs pemhre, garcniou iocessaotlf oiunt aod daf, ne adyaoced ravidlf tnrhwun tne territhrf hm tne aedwi ioth tnat hm tne liouhoes, io bnicn tbh leuihos bere bioteriou, tnat, im aof vlao ammectiou nis hbo sametf snhwld naye peeo hruaoiqed pf tne aedwi, ne giunt demeat it pf tne raviditf hm nis ghyegeots. bneo ne arriyed tnere, ne seods iomhrgatiho th tne rest hm tne leuihos, aod uatners all nis argf ioth hoe vlace pemhre iotelliueoce hm nis arriyal chwld pe aoohwoced th tne aryeroi. yerciouethrik, ho neariou tnis circwgstaoce, leads pacj nis argf ioth tne chwotrf hm tne pitwriues; aod amter garcniou mrhg it th ueruhyia, a thbo hm tne phii, bnhg caesar nad
Introduction to Security
17.10.2012
Patrick Rockenschaub
settled tnere amter demeatiou tneg io tne nelyetiao bar, aod nad reodered tripwtarf th tne aedwi, ne detergioed th attacj it.
Pecawse reminds me strongly of because, so the next thing I try is exchanging p with b and w with u: p <--> b w <--> u
caesar, nayiow delafed tph dafs io tnat vlace, because ne nad aoticivated tnat, io tne oatural churse hm eyeots, sucn phuld be tne choduct hm yerciowethrik, leayes tne argf uoder vreteose hm raisiow recruits aod cayalrf: ne vlaces brutus, a fhuow gao, io chggaod hm tnese mhrces; ne wiyes nig iostructihos tnat tne cayalrf snhuld raowe as ekteosiyelf as vhssible io all directihos; tnat ne phuld ekert nigselm oht th be abseot mrhg tne cagv lhower tnao tnree dafs. nayiow arraowed tnese gatters, ne garcnes th yieooa bf as lhow xhuroefs as ne cao, pneo nis hpo shldiers did oht ekvect nig. miodiow tnere a mresn bhdf hm cayalrf, pnicn ne nad seot ho th tnat vlace seyeral dafs bemhre, garcniow iocessaotlf oiwnt aod daf, ne adyaoced ravidlf tnrhuwn tne territhrf hm tne aedui ioth tnat hm tne liowhoes, io pnicn tph lewihos pere pioteriow, tnat, im aof vlao ammectiow nis hpo sametf snhuld naye beeo hrwaoiqed bf tne aedui, ne giwnt demeat it bf tne raviditf hm nis ghyegeots. pneo ne arriyed tnere, ne seods iomhrgatiho th tne rest hm tne lewihos, aod watners all nis argf ioth hoe vlace bemhre iotelliweoce hm nis arriyal chuld be aoohuoced th tne aryeroi. yerciowethrik, ho neariow tnis circugstaoce, leads bacj nis argf ioth tne chuotrf hm tne bituriwes; aod amter garcniow mrhg it th werwhyia, a thpo hm tne bhii, pnhg caesar nad settled tnere amter demeatiow tneg io tne nelyetiao par, aod nad reodered tributarf th tne aedui, ne detergioed th attacj it.
aoticivated looks like anticipated, so the next step is to exchange o with n and v with p: o <--> n v <--> p
caesar, hayinw delafed tvo dafs in that place, because he had anticipated that, in the natural course om eyents, such vould be the conduct om yercinwetorik, leayes the argf under pretense om raisinw recruits and cayalrf: he places brutus, a founw gan, in coggand om these morces; he wiyes hig instructions that the cayalrf should ranwe as ektensiyelf as possible in all directions; that he vould ekert higselm not to be absent mrog the cagp lonwer than three dafs. hayinw arranwed these gatters, he garches to yienna bf as lonw xournefs as he can, vhen his ovn soldiers did not ekpect hig. mindinw there a mresh bodf om cayalrf, vhich he had sent on to that place seyeral dafs bemore, garchinw incessantlf niwht and daf, he adyanced rapidlf throuwh the territorf om the aedui into that om the linwones, in vhich tvo lewions vere vinterinw, that, im anf plan ammectinw his ovn sametf should haye been orwaniqed bf the aedui, he giwht demeat it bf the rapiditf om his goyegents. vhen he arriyed there, he sends inmorgation to the rest om the lewions, and wathers all his argf into one place bemore intelliwence om his arriyal could be announced to the aryerni.
Introduction to Security
17.10.2012
Patrick Rockenschaub
yercinwetorik, on hearinw this circugstance, leads bacj his argf into the countrf om the bituriwes; and amter garchinw mrog it to werwoyia, a tovn om the boii, vhog caesar had settled there amter demeatinw theg in the helyetian var, and had rendered tributarf to the aedui, he detergined to attacj it.
delafed tyo dafs means very likely delayed two days: y <--> w f <--> y
caesar, having delayed two days in that place, because he had anticipated that, in the natural course om events, such would be the conduct om vercingetorik, leaves the arfy under pretense om raising recruits and cavalry: he places brutus, a young fan, in coffand om these morces; he gives hif instructions that the cavalry should range as ektensively as possible in all directions; that he would ekert hifselm not to be absent mrof the cafp longer than three days. having arranged these fatters, he farches to vienna by as long xourneys as he can, when his own soldiers did not ekpect hif. minding there a mresh body om cavalry, which he had sent on to that place several days bemore, farching incessantly night and day, he advanced rapidly through the territory om the aedui into that om the lingones, in which two legions were wintering, that, im any plan ammecting his own samety should have been organiqed by the aedui, he fight demeat it by the rapidity om his fovefents. when he arrived there, he sends inmorfation to the rest om the legions, and gathers all his arfy into one place bemore intelligence om his arrival could be announced to the arverni. vercingetorik, on hearing this circufstance, leads bacj his arfy into the country om the bituriges; and amter farching mrof it to gergovia, a town om the boii, whof caesar had settled there amter demeating thef in the helvetian war, and had rendered tributary to the aedui, he deterfined to attacj it.
om sounds like of and supported by the words hifselm and fatters, I exchanged f and m f <--> m
caesar, having delayed two days in that place, because he had anticipated that, in the natural course of events, such would be the conduct of vercingetorik, leaves the army under pretense of raising recruits and cavalry: he places brutus, a young man, in command of these forces; he gives him instructions that the cavalry should range as ektensively as possible in all directions; that he would ekert himself not to be absent from the camp longer than three days. having arranged these matters, he marches to vienna by as long xourneys as he can, when his own soldiers did not ekpect him. finding there a fresh body of cavalry, which he had sent on to that place several days before, marching incessantly night and day, he advanced rapidly through the territory of the aedui into that of the lingones, in which two legions were wintering, that, if any plan affecting his own safety should have been organiqed by the aedui, he might defeat it by the rapidity of his movements. when he arrived there, he sends information to the rest of the legions, and gathers all his army into one place before intelligence of his arrival could be announced to the arverni. vercingetorik, on hearing this circumstance, leads bacj his army into the country of the bituriges; and after marching from it to gergovia, a town of the boii, whom caesar had
Introduction to Security
17.10.2012
Patrick Rockenschaub
settled there after defeating them in the helvetian war, and had rendered tributary to the aedui, he determined to attacj it.
Asterix and Obelix has thaught children for ages that proper names end with x, so the implication that vercingetorik means vercingetorix is close to hand. xourneys on the other hand is probably journeys which leads to following exchanges: k <--> x k <--> j
caesar, having delayed two days in that place, because he had anticipated that, in the natural course of events, such would be the conduct of vercingetorix, leaves the army under pretense of raising recruits and cavalry: he places brutus, a young man, in command of these forces; he gives him instructions that the cavalry should range as extensively as possible in all directions; that he would exert himself not to be absent from the camp longer than three days. having arranged these matters, he marches to vienna by as long journeys as he can, when his own soldiers did not expect him. finding there a fresh body of cavalry, which he had sent on to that place several days before, marching incessantly night and day, he advanced rapidly through the territory of the aedui into that of the lingones, in which two legions were wintering, that, if any plan affecting his own safety should have been organiqed by the aedui, he might defeat it by the rapidity of his movements. when he arrived there, he sends information to the rest of the legions, and gathers all his army into one place before intelligence of his arrival could be announced to the arverni. vercingetorix, on hearing this circumstance, leads back his army into the country of the bituriges; and after marching from it to gergovia, a town of the boii, whom caesar had settled there after defeating them in the helvetian war, and had rendered tributary to the aedui, he determined to attack it.
The decryption is nearly done, only one remaining doesnt fit into the text properly: organiqed: q <--> z
Decrypted text
caesar, having delayed two days in that place, because he had anticipated that, in the natural course of events, such would be the conduct of vercingetorix, leaves the army under pretense of raising recruits and cavalry: he places brutus, a young man, in command of these forces; he gives him instructions that the cavalry should range as extensively as possible in all directions; that he would exert himself not to be absent from the camp longer than three days. having arranged these matters, he marches to vienna by as long journeys as he can, when his own soldiers did not expect him. finding there a fresh body of cavalry, which he had sent on to that place several days before, marching incessantly night and day, he advanced rapidly through the territory of the aedui into that of the lingones, in which two legions were wintering, that, if any plan affecting his own safety should have been organized by the aedui, he might defeat it by the rapidity of his movements. when he arrived there, he sends information to the rest of the legions, and gathers all his army into one place before intelligence of his arrival could be announced to the arverni. vercingetorix, on hearing this circumstance, leads back his army into the country of the bituriges; and after marching from it to gergovia, a town of the boii, whom caesar had settled there after defeating them in the helvetian war, and had rendered tributary to the aedui, he determined to attack it.
Key
a -> i b -> k c -> e
Introduction to Security d -> l e -> t f -> a g -> y h -> r i -> s j -> z k -> j l -> g m -> d n -> f o -> b p -> c q -> p r -> h s -> u t -> m u -> x v -> n w -> w x -> q y -> v z -> o
17.10.2012
Patrick Rockenschaub
Introduction to Security
this.applyHistogramm();
17.10.2012
Patrick Rockenschaub
System.out.println(this.enLangHist); System.out.println(this.cipherHist); Scanner in = new Scanner(System.in); String cmd1 = "", cmd2 = ""; String history = ""; // Exchange two characters until the cipher is decoded while(!cmd1.equals("exit")){ System.out.println(this.deciphText); System.out.print("Character A: "); cmd1 = in.nextLine(); if(cmd1.equals("exit")){ break; } System.out.print("Character B: "); cmd2 = in.nextLine(); exchangeCharacter(cmd1.charAt(0), cmd2.charAt(0)); history += cmd1.charAt(0) + " <--> " + cmd2.charAt(0) + "\n"; } // print out history of changes System.out.println(); System.out.println(history); } /* * Simply exchange two character in the cipher text */ private void exchangeCharacter(char a, char b){ String newDeciphe = ""; char c; for(int i = 0; i < this.deciphText.length(); i++){ c = this.deciphText.charAt(i); if(c == a){ newDeciphe += b; }else if(c == b){ newDeciphe += a; }else{ newDeciphe += c; } } this.deciphText = newDeciphe; } /* * Exchange letters initially according to their sorted order * in the histogram. This way, letters will be in the right place * more likely, simplifying the process of manual decoding. */ private void applyHistogramm(){ char c; int p; String newDeciphe = ""; for(int i = 0; i < this.deciphText.length(); i++){ c = this.deciphText.charAt(i);
Introduction to Security
17.10.2012
Patrick Rockenschaub
p = this.cipherHist.indexOf(new Occurrence(c, 0.0)); if(p == -1){ newDeciphe += c; }else{ newDeciphe += this.enLangHist.get(p).character; } } this.deciphText = newDeciphe; } /* * Count the character occurrences in the cipher text and * build two histograms, one representing the average usage * of the alphabet in the English language and the other * the specific occurrences in this text. The histograms * are sorted according to the relative occurrences. (Data * for English language: http://en.wikipedia.org/wiki/Letter_frequency) */ private void initializeHistogramms(String cipher){ this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new this.enLangHist.add(new Occurrence('a', Occurrence('b', Occurrence('c', Occurrence('d', Occurrence('e', Occurrence('f', Occurrence('g', Occurrence('h', Occurrence('i', Occurrence('j', Occurrence('k', Occurrence('l', Occurrence('m', Occurrence('n', Occurrence('o', Occurrence('p', Occurrence('q', Occurrence('r', Occurrence('s', Occurrence('t', Occurrence('u', Occurrence('v', Occurrence('w', Occurrence('x', Occurrence('y', Occurrence('z', 0.08167)); 0.01492)); 0.02782)); 0.04253)); 0.12702)); 0.02228)); 0.02015)); 0.06094)); 0.06966)); 0.00153)); 0.00772)); 0.04025)); 0.02406)); 0.06749)); 0.07507)); 0.01929)); 0.00095)); 0.05987)); 0.06327)); 0.09056)); 0.02758)); 0.00978)); 0.02360)); 0.00150)); 0.01974)); 0.00074));
// Cipher-Hist int total = cipher.length(); for(char c = 'a'; c <='z'; c++){ int count = 0; for (int i=0; i < cipher.length(); i++){ if (cipher.charAt(i) == c){ count++; } } this.cipherHist.add(new Occurrence(c, (double) count/total)); }
Introduction to Security
17.10.2012
Patrick Rockenschaub
// Sort the characters to be able to exchange them before trying // to solve the cipher manually Collections.sort(this.enLangHist); Collections.sort(this.cipherHist); } /* * Represents a character and its relative frequency */ class Occurrence implements Comparable<Occurrence>{ public Character character; public Double percentage; public Occurrence(char character, double percentage){ this.character = character; this.percentage = percentage; } public int compareTo(Occurrence other){ return this.percentage.compareTo(other.percentage); } public String toString(){ return this.character + ": " + this.percentage.toString() + "%"; } @Override public boolean equals(Object other){ Occurrence o = (Occurrence)other; return this.character == o.character; } } }