From 0aa97df223aab1a521795f1af5a115b9ac9e3ad3 Mon Sep 17 00:00:00 2001 From: "mikgaw@st.amu.edu.pl" Date: Sun, 18 Feb 2024 20:47:15 +0100 Subject: [PATCH] readt --- .idea/.gitignore | 3 + .idea/cesar-cipher-cracker.iml | 8 + .idea/inspectionProfiles/Project_Default.xml | 22 + .../inspectionProfiles/profiles_settings.xml | 6 + .idea/misc.xml | 7 + .idea/modules.xml | 8 + 1250_eng_words.txt | 1250 + README.md | 39 + __pycache__/data.cpython-39.pyc | Bin 0 -> 2210 bytes data.py | 74 + input_cesar.txt | 20 + input_plaintext.txt | 65 + main.py | 178 + words_eng.txt | 370105 +++++++++++++++ 14 files changed, 371785 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/cesar-cipher-cracker.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 1250_eng_words.txt create mode 100644 README.md create mode 100644 __pycache__/data.cpython-39.pyc create mode 100644 data.py create mode 100644 input_cesar.txt create mode 100644 input_plaintext.txt create mode 100644 main.py create mode 100644 words_eng.txt diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/cesar-cipher-cracker.iml b/.idea/cesar-cipher-cracker.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/cesar-cipher-cracker.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..73b39fc --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..812ab5a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3304724 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/1250_eng_words.txt b/1250_eng_words.txt new file mode 100644 index 0000000..fe6c158 --- /dev/null +++ b/1250_eng_words.txt @@ -0,0 +1,1250 @@ +rob +tap +flu +bag +few +way +oil +inn +ego +cup +ice +try +sea +fat +arm +van +ant +ask +beg +pig +cry +gun +end +fax +sin +mix +leg +egg +tie +bus +pop +lip +bad +fan +win +sun +use +bay +low +eye +net +sip +vat +law +add +hot +mug +boy +joy +jaw +bay +dog +tin +egg +bag +bus +lip +gap +fan +mix +boy +fox +lay +aid +lot +cup +rub +act +top +key +dip +ash +rob +buy +shy +sin +run +see +map +gem +lie +log +sun +pit +beg +car +art +pan +man +mug +win +oil +old +gun +gas +eye +law +ear +due +dry +joke +fist +tail +ring +edge +bean +sock +gown +mine +leaf +camp +oven +cast +pill +lead +snub +rent +bark +door +team +want +diet +draw +gift +duck +soil +time +deal +fast +rare +last +tidy +flex +self +glue +case +moon +fade +text +sigh +dead +sand +skin +stop +jury +norm +find +pray +need +note +ally +mind +pass +jump +bang +Mars +bird +baby +snap +neck +arch +pony +trip +rank +gene +land +pity +food +bush +pure +sink +line +wild +shop +veil +orgy +herb +nest +tray +desk +test +fate +lace +star +mill +turn +raid +pain +coin +pray +save +dorm +mole +coal +rest +meet +stun +half +pull +blue +forum +salad +grief +honor +worry +court +cycle +story +budge +equal +wrong +funny +paint +stamp +elect +enter +cabin +queue +smile +cheap +guilt +basis +union +slime +radio +refer +crowd +angel +swing +dirty +heavy +burst +steam +paper +virus +train +gloom +water +dairy +judge +panic +claim +hobby +cruel +throw +learn +shape +smash +video +touch +slice +mouse +entry +forge +board +worry +relax +mayor +tribe +wrong +theft +touch +salon +spill +spite +obese +stall +slant +range +enemy +rugby +berry +blade +ridge +snack +refer +stake +shout +skate +feign +patch +burst +haunt +crash +movie +brick +valid +agent +check +flood +stick +adopt +habit +witch +thick +grant +elbow +guest +irony +spine +morale +snatch +active +wander +tumour +twitch +sector +Europe +market +winner +cotton +hunter +pepper +native +extent +driver +aspect +pledge +suburb +flower +affect +cancel +buffet +unlike +infect +deport +instal +cellar +behave +accept +sketch +season +length +remark +glance +throat +afford +misery +crouch +ethnic +favour +camera +shadow +refuse +memory +palace +minute +action +system +family +suntan +expand +unfair +mosaic +cotton +voyage +escape +banana +affect +forest +kettle +freeze +factor +trance +flight +banner +middle +vessel +ethnic +avenue +regret +vacuum +jungle +throat +senior +margin +quaint +access +column +detail +porter +island +viable +listen +harbor +credit +poison +useful +injury +manual +center +profit +pocket +finish +broken +flavor +degree +family +breeze +accent +temple +muscle +mosque +tumble +letter +endure +threat +symbol +studio +define +sleeve +barrel +embryo +collar +career +bitter +freeze +attack +random +praise +killer +reader +second +mirror +infect +writer +jacket +locate +basket +common +museum +reason +forest +differ +school +borrow +admire +cereal +tablet +heaven +sticky +prince +export +advice +scrape +census +credit +meadow +rabbit +refuse +bargain +pottery +pumpkin +capital +measure +referee +request +wedding +minimum +advance +undress +privacy +express +veteran +maximum +problem +density +evening +crevice +soldier +support +alcohol +banquet +fixture +persist +routine +lighter +equinox +convict +comment +applied +discuss +portion +deposit +benefit +trolley +glimpse +laborer +compete +balance +reality +trouble +related +current +recover +missile +deficit +elegant +wriggle +posture +summary +wording +absence +physics +shelter +edition +penalty +pension +digress +symptom +freight +freedom +inflate +uniform +provide +failure +forward +current +realism +teacher +deliver +manager +liberty +produce +licence +trustee +program +predict +hallway +bargain +pumpkin +silence +leaflet +maximum +loyalty +related +horizon +thought +support +grimace +perfume +variant +pudding +session +enhance +splurge +apology +assault +pattern +fitness +package +suggest +revival +seminar +current +brother +harmful +husband +cruelty +protect +glasses +advance +welfare +wording +approve +precede +comment +verdict +mixture +density +realize +popular +initial +crevice +speaker +decline +percent +project +fashion +absence +curtain +confuse +compact +bathtub +analyst +licence +student +scatter +pattern +contain +similar +terrace +balance +regular +rubbish +digital +battery +deserve +storage +clarify +fantasy +council +summary +painter +payment +service +horizon +pyramid +sulphur +retired +suggest +journal +exclude +package +arrange +bedroom +tribute +compose +athlete +tension +abandon +promise +evening +chapter +pattern +anxiety +convert +regular +retiree +pursuit +perfect +execute +collect +improve +college +lecture +despise +predict +swallow +glacier +partner +terrify +cabinet +pudding +skilled +thirsty +display +program +achieve +portion +accurate +detector +progress +mutation +particle +appetite +wardrobe +concrete +customer +distinct +judicial +diameter +dedicate +civilian +coincide +exchange +contract +courtesy +argument +restrict +greeting +generate +joystick +opposite +syndrome +surround +unlikely +reckless +affinity +aquarium +monopoly +stubborn +category +folklore +familiar +standard +rotation +variable +birthday +calendar +crossing +business +sunshine +decrease +prestige +flexible +displace +twilight +champion +identity +reliance +misplace +governor +collapse +constant +industry +abundant +magazine +dramatic +physical +tolerant +baseball +superior +elephant +fragment +minimize +referral +practice +innocent +campaign +scramble +location +terminal +division +decisive +function +specimen +rational +delivery +faithful +ministry +rhetoric +analysis +ambition +pleasure +customer +feedback +shortage +twilight +hesitate +ideology +decrease +dedicate +farewell +implicit +identity +facility +appendix +medieval +exposure +appendix +dominate +reporter +affinity +fragment +estimate +exchange +judgment +critical +dedicate +argument +advocate +positive +industry +observer +prospect +rhetoric +discount +withdraw +ideology +threaten +contract +evaluate +disaster +folklore +physical +standard +marriage +approval +aviation +tolerate +hospital +proclaim +variable +pleasure +misplace +grateful +skeleton +opponent +division +mushroom +quantity +disagree +audience +carriage +platform +analysis +exercise +medieval +facility +disclose +mountain +surround +industry +forestry +incident +director +pressure +minimize +umbrella +exercise +constant +proposal +conceive +teenager +bathroom +classify +analysis +forecast +monopoly +birthday +feedback +business +discreet +reliable +resident +mistreat +organize +nominate +criminal +addition +approach +necklace +broccoli +movement +obstacle +disorder +appetite +ministry +romantic +strength +dressing +decrease +congress +location +invasion +workshop +reckless +fraction +wardrobe +detective +criticism +authority +hilarious +prosecute +frequency +direction +isolation +colleague +wisecrack +sanctuary +intensify +available +knowledge +machinery +influence +publisher +franchise +inspector +construct +candidate +reference +defendant +copyright +beautiful +rebellion +treatment +secretary +consensus +butterfly +accompany +catalogue +reservoir +speculate +dangerous +education +suffering +mechanism +essential +transport +cigarette +foreigner +depressed +captivate +precision +offensive +vegetable +socialist +publicity +precedent +liability +fisherman +sacrifice +landowner +beginning +earthflax +suffering +favourite +reduction +guerrilla +apparatus +invisible +candidate +cigarette +breakdown +situation +machinery +admission +empirical +selection +guarantee +guideline +agreement +committee +executive +violation +injection +salvation +reservoir +criticism +depressed +overwhelm +tradition +allowance +miserable +eliminate +departure +communist +economist +premature +sensation +accompany +offensive +crosswalk +objective +advertise +precedent +authorise +construct +pneumonia +determine +favorable +franchise +craftsman +exclusive +influence +represent +chocolate +qualified +character +breakfast +direction +economics +foreigner +housewife +beginning +sensitive +explosion +communist +miserable +advantage +frequency +blackmail +infection +unanimous +transport +discovery +attention +permanent +plaintiff +agreement +nightmare +disappear +allowance +committee +migration +practical +recognize +expansion +performer +reservoir +recording +empirical +sanctuary +tradition +sculpture +promotion +treatment +quotation +introduce +telephone +overwhelm +craftsman +relevance +pneumonia +statement +execution +hilarious +effective +operation +intention +president +formation +eliminate +departure +nightmare +economics +earthflax +magnitude +guideline +unanimous +parachute +housewife +notorious +cathedral +biography +permanent +salvation +authority +orchestra +admission +speculate +treatment +depressed +cultivate +sanctuary +expansion +allowance +challenge +highlight +sensation +undertake +apparatus +essential +landowner +publisher +selection +injection +disappear +rehearsal +artificial +definition +dictionary +difference +projection +transition +systematic +settlement +convulsion +appreciate +corruption +difficulty +articulate +disappoint +possession +initiative +remunerate +attraction +correction +assignment +particular +exaggerate +compromise +overcharge +wilderness +excitement +instrument +attractive +accessible +distortion +first-hand +unpleasant +accountant +brilliance +innovation +discipline +helicopter +researcher +photograph +reasonable +production +literature +illustrate +population +conference +protection +government +girlfriend +generation +incredible +fastidious +discourage +assignment +redundancy +domination +brainstorm +prevalence +resolution +reputation +philosophy +production +dictionary +photograph +conviction +opposition +protection +attractive +microphone +illustrate +chauvinist +projection +negligence +television +gregarious +chimpanzee +indication +hypothesis +multimedia +excitement +acceptable +perception +compromise +memorandum +background +girlfriend +experiment +disappoint +appearance +allocation +mastermind +initiative +generation +substitute +correspond +accessible +atmosphere +regulation +articulate +relaxation +psychology +convulsion +excitement +production +disappoint +separation +population +democratic +unpleasant +earthquake +concession +repetition +discipline +understand +brilliance +connection +television +negligence +obligation +wilderness +inhabitant +competence +reflection +initiative +accountant +expression +attachment +regulation +tournament +attractive +commission +researcher +restaurant +leadership +appreciate +allocation +insistence +plagiarize +preference +difficulty +reluctance +censorship +instrument +constraint +compromise +mainstream +disability +literature +federation +absorption +perception +redundancy +goalkeeper +earthquake +systematic +integrated +decoration +confidence +indication +conference +compliance +engagement +competence +vegetation +inhabitant +wilderness +relinquish +correction +corruption +assumption +motorcycle +plagiarize +conscience +unpleasant +productive +particular +concession +chimpanzee +initiative +photograph +difference +accountant +commission +distortion +opposition +chauvinist +basketball +houseplant +nomination +remunerate +profession +mainstream +possession +accessible +allocation +artificial +deficiency +mechanical +occupation +microphone +experience \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3656a73 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# cesar-cipher-crakcer + +Program łamie szyfr cezara używając analizy częstotliwości wystepowania znaków w języku. + +==== + +The program shows success rates in cracking cesar ciphers + +Example of long plaintext in Polish: Cześć, oto przykładowy tekst po Polsku ze znakami interpunkcyjnymi;,/$!? i kropkami.. + +Encrypted text with key 5: fbizgśźśuwbąńódhśaąźińyźuśuśoyńżbibrdńdpmmrźiwużrńfąnrąpmmńwśuńdpm + +Result of ciphertext-only attack: cześćotoprzykładowytekstpopolskuzeznakamiinterpunkcyjnymiikropkami + +==== + +Example of long plaintext in English: Once upon a time I decrypt some texts. + +Encrypted text with key 9: xwlndyxwjcrvnrmnlahycbxvncngcb + +Result of ciphertext-only attack: onceuponatimeidecryptsometexts + +==== + +Now I will check how short of a word can be decrypted using this frequency analyzer. + +100 3-letters long English words. Decryption succes rate: 13% + +100 4-letters long English words. Decryption succes rate: 27% + +100 5-letters long English words. Decryption succes rate: 23% + +150 6-letters long English words. Decryption succes rate: 49% + +200 7-letters long English words. Decryption succes rate: 45% + +200 8-letters long English words. Decryption succes rate: 52% + +200 9-letters long English words. Decryption succes rate: 63% \ No newline at end of file diff --git a/__pycache__/data.cpython-39.pyc b/__pycache__/data.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d95d8a3a1bcd4a20818fc562fec710be0c15cf61 GIT binary patch literal 2210 zcmb_bO-x)>6u#%pn;(Yxf$2#3DKJoqjI{`*&=!IBYH4X*7`2+l$rv)udA%UR%y4J0 zh2Ta?OxzHc)h^o97}=0C-Bi<+wF?tn7#B@$T-X>j1{0$OO-xKY_q};I#$=MF+?V&A zd+yKq?)~mLnQ%DBsP%sTA#V8@`%XF4t&1F!{!#)MLxzAFdQe9%`p}O7tivGIV+g|- z!6-IhBgSwK#_=(1!oApxE!cXsHN~(E_hCDBU?(Q93%kkg#~wU@z4$oxVG^IfgZLyK z!hU=T2PoW<-50>N2 zCb#Y8UX!08e{-tQP@;!lHz%gn0=UBrHj|D1l2TN_b7e8xrOuT#~RL;dKei{6!V_t1kCizZl#W zWsMH#h(T9(ME%;R$Q(5J2TGJ1JEHz(RAm0cs3=F*vX4ARFW_iE@;EYw+!r8K9GStD z(C4mcGAmdA+$HUFkFjM`o}$jINEmYie&a5tH*u7sDTg#-awTbcogzCKv1ud|!b6F( zs1ba&CgNm7cxT{kp-NOx{Z&?65m7Y|Q&6YCtDr?elY)8zJJ!9oL_`hvb_OmBo%-8~ z=z@JJ_Aw-N0MIu)p6Ij~>#RQOY>bAaHHcO(y2WE-`MkooYV_N zD{t4g)PX>7WIbM~o ucIK+2m4UJO0xssP301kJcL+3i=