GithubHelp home page GithubHelp logo

punnkam / cracking-a-vigenere-cipher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from savanddarji/cracking-a-vigenere-cipher

0.0 0.0 0.0 9 KB

Recover the encryption key and plain text of the vigenere cipher text using Kerckhoff's method

Python 100.00%

cracking-a-vigenere-cipher's Introduction

Cracking-a-Vigenere-Cipher

Comments and reviews will be appreciated: [email protected] or [email protected]

Recover the encryption key and plain text of the vigenere cipher text using Kerckhoff's method.

The project is about the implementation of Kerchoff's method to crack vigenere cipher using python 2.7.12. The code results number of coincedences with corresponding shifts in descending order.

The sample result is shown as below:

Number of coincidences for 1 shift is: 67
Number of coincidences for 2 shift is: 77
Number of coincidences for 3 shift is: 75
Number of coincidences for 4 shift is: 73
Number of coincidences for 5 shift is: 151
Number of coincidences for 6 shift is: 70
Number of coincidences for 7 shift is: 85
Number of coincidences for 8 shift is: 80
Number of coincidences for 9 shift is: 65
Number of coincidences for 10 shift is: 113
Number of coincidences for 11 shift is: 76
Number of coincidences for 12 shift is: 77
Number of coincidences for 13 shift is: 77
Number of coincidences for 14 shift is: 81
Number of coincidences for 15 shift is: 152
Number of coincidences for 16 shift is: 69
Number of coincidences for 17 shift is: 69
Number of coincidences for 18 shift is: 81
Number of coincidences for 19 shift is: 79
Number of coincidences for 20 shift is: 113
Maximum number of coincidence(L): 152
Second highest number of coincidence(L1): 151
Third highest number of coincidence:(L2) 113
Fourth highest number of coincidence:(L3) 85
Fifth highest number of coincidence(L4): 81
Sixth highest number of coincidence:(L5) 80

Possible key lengths are: 15 , 5 , 10 , 7 , 14 , 8
gcf of all above shifts: 1

Take 15 as key length
The Encryption Key: CHAOSCHAOSCHAOS

Your plain Text for the key CHAOSCHAOSCHAOS is:
eoftheestateaswepassedthroughoneofthegatesonourwayhomeagainaprettyyoungwomanofgipsytypecomingintheoppositedirectionbowedandsmiled
thatsaprettygirliremarkedappreciativelyjohnsfacehardenedthatismrsraikestheonethatmisshowardexactlysaidjohnwithratherunnecessary
abruptnessithoughtofthewhitehairedoldladyinthebighouseandthatvividwickedlittlefacethathadjustsmiledintooursandavaguechillofforebodin
gcreptovermeibrusheditasidestylesisreallyagloriousoldplaceisaidtojohnhenoddedrathergloomilyyesitsafinepropertyitllbeminesomedayshoul
dbeminenowbyrightsifmyfatherhadonlymadeadecentwillandthenishouldntbesodamnedhardupasiamnowhardupareyoumydearhastingsidontmindtelling
youthatimatmywitsendformoneycouldntyourbrotherhelpyoulawrencehesgonethrougheverypennyheeverhadpublishingrottenversesinfancybindings
nowereanimpecuniouslotmymothersalwaysbeenawfullygoodtousimustsaythatisuptonowsincehermarriageofcoursehebrokeofffrowningforthefirst
timeifeltthatwithevelynhowardsomethingindefinablehadgonefromtheatmosphereherpresencehadspeltsecuritynowthatsecuritywasremovedand
theairseemedrifewithsuspicionthesinisterfaceofdrbauersteinrecurredtomeunpleasantlyavaguesuspicionofeveryoneandeverythingfilledmymind
justforamomentihadapremonitionofapproachingevilchapteriithethandthofjulyihadarrivedatstylesonthethofjulyicomenowtotheeventsofthet
handthofthatmonthfortheconvenienceofthereaderiwillrecapitulatetheincidentsofthosedaysinasexactamanneraspossibletheywereelicited
subsequentlyatthetrialbyaprocessoflongandtediouscrossexaminationsireceivedaletterfromevelynhowardacoupleofdaysafterherdeparture
tellingmeshewasworkingasanurseatthebighospitalinmiddlinghamamanufacturingtownsomefifteenmilesawayandbeggingmetoletherknowifmrsingle
thorpshouldshowanywishtobereconciledtheonlyflyintheointmentofmypeacefuldayswasmrscavendishsextraordinaryandformypartunaccountable
preferenceforthesocietyofdrbauersteinwhatshesawinthemanicannotimaginebutshewasalwaysaskinghimuptothehouseandoftenwentoffforlong
expeditionswithhimimustconfessthatiwasquiteunabletoseehis

Take 5 as key length
The Encryption Key: CHAOS

Your plain Text for the key CHAOS is:
eoftheestateaswepassedthroughoneofthegatesonourwayhomeagainaprettyyoungwomanofgipsytypecomingintheoppositedirectionbowedandsmiled
thatsaprettygirliremarkedappreciativelyjohnsfacehardenedthatismrsraikestheonethatmisshowardexactlysaidjohnwithratherunnecessary
abruptnessithoughtofthewhitehairedoldladyinthebighouseandthatvividwickedlittlefacethathadjustsmiledintooursandavaguechillofforebodin
gcreptovermeibrusheditasidestylesisreallyagloriousoldplaceisaidtojohnhenoddedrathergloomilyyesitsafinepropertyitllbeminesomedayshoul
dbeminenowbyrightsifmyfatherhadonlymadeadecentwillandthenishouldntbesodamnedhardupasiamnowhardupareyoumydearhastingsidontmindtelling
youthatimatmywitsendformoneycouldntyourbrotherhelpyoulawrencehesgonethrougheverypennyheeverhadpublishingrottenversesinfancybindings
nowereanimpecuniouslotmymothersalwaysbeenawfullygoodtousimustsaythatisuptonowsincehermarriageofcoursehebrokeofffrowningforthefirst
timeifeltthatwithevelynhowardsomethingindefinablehadgonefromtheatmosphereherpresencehadspeltsecuritynowthatsecuritywasremovedand
theairseemedrifewithsuspicionthesinisterfaceofdrbauersteinrecurredtomeunpleasantlyavaguesuspicionofeveryoneandeverythingfilledmymind
justforamomentihadapremonitionofapproachingevilchapteriithethandthofjulyihadarrivedatstylesonthethofjulyicomenowtotheeventsofthet
handthofthatmonthfortheconvenienceofthereaderiwillrecapitulatetheincidentsofthosedaysinasexactamanneraspossibletheywereelicited
subsequentlyatthetrialbyaprocessoflongandtediouscrossexaminationsireceivedaletterfromevelynhowardacoupleofdaysafterherdeparture
tellingmeshewasworkingasanurseatthebighospitalinmiddlinghamamanufacturingtownsomefifteenmilesawayandbeggingmetoletherknowifmrsingle
thorpshouldshowanywishtobereconciledtheonlyflyintheointmentofmypeacefuldayswasmrscavendishsextraordinaryandformypartunaccountable
preferenceforthesocietyofdrbauersteinwhatshesawinthemanicannotimaginebutshewasalwaysaskinghimuptothehouseandoftenwentoffforlong
expeditionswithhimimustconfessthatiwasquiteunabletoseehis


Take 10 as key length
The Encryption Key: CHAOSCHAOS

Your plain Text for the key CHAOSCHAOS is:
eoftheestateaswepassedthroughoneofthegatesonourwayhomeagainaprettyyoungwomanofgipsytypecomingintheoppositedirectionbowedandsmiled
thatsaprettygirliremarkedappreciativelyjohnsfacehardenedthatismrsraikestheonethatmisshowardexactlysaidjohnwithratherunnecessary
abruptnessithoughtofthewhitehairedoldladyinthebighouseandthatvividwickedlittlefacethathadjustsmiledintooursandavaguechillofforebodin
gcreptovermeibrusheditasidestylesisreallyagloriousoldplaceisaidtojohnhenoddedrathergloomilyyesitsafinepropertyitllbeminesomedayshoul
dbeminenowbyrightsifmyfatherhadonlymadeadecentwillandthenishouldntbesodamnedhardupasiamnowhardupareyoumydearhastingsidontmindtelling
youthatimatmywitsendformoneycouldntyourbrotherhelpyoulawrencehesgonethrougheverypennyheeverhadpublishingrottenversesinfancybindings
nowereanimpecuniouslotmymothersalwaysbeenawfullygoodtousimustsaythatisuptonowsincehermarriageofcoursehebrokeofffrowningforthefirst
timeifeltthatwithevelynhowardsomethingindefinablehadgonefromtheatmosphereherpresencehadspeltsecuritynowthatsecuritywasremovedand
theairseemedrifewithsuspicionthesinisterfaceofdrbauersteinrecurredtomeunpleasantlyavaguesuspicionofeveryoneandeverythingfilledmymind
justforamomentihadapremonitionofapproachingevilchapteriithethandthofjulyihadarrivedatstylesonthethofjulyicomenowtotheeventsofthet
handthofthatmonthfortheconvenienceofthereaderiwillrecapitulatetheincidentsofthosedaysinasexactamanneraspossibletheywereelicited
subsequentlyatthetrialbyaprocessoflongandtediouscrossexaminationsireceivedaletterfromevelynhowardacoupleofdaysafterherdeparture
tellingmeshewasworkingasanurseatthebighospitalinmiddlinghamamanufacturingtownsomefifteenmilesawayandbeggingmetoletherknowifmrsingle
thorpshouldshowanywishtobereconciledtheonlyflyintheointmentofmypeacefuldayswasmrscavendishsextraordinaryandformypartunaccountable
preferenceforthesocietyofdrbauersteinwhatshesawinthemanicannotimaginebutshewasalwaysaskinghimuptothehouseandoftenwentoffforlong
expeditionswithhimimustconfessthatiwasquiteunabletoseehis

cracking-a-vigenere-cipher's People

Contributors

savanddarji avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.