Code Monkey home page Code Monkey logo

vigenere's Introduction

Vigenere

Encryption, decryption and cryptanalysis of the Vigenère cipher.

Table of Contents

General Information

The program encrypts, decrypts and breaks the Vigenère cipher. The program encrypts the text by shifting the letters by the number specified by the key (as in the Caesar cipher). Decryption involves reversing the encryption algorithm. The most interesting for me was the process of breaking the ciphertext. I used frequency analysis to guess the length and content of the key. The algorithm counts the frequency of the model text (the result of counting letters in The Master and Margarita by Mikhail Bulgakov is shown in the image below).

Frequency schema

Then the program compares the result of counting the ciphertext, extending the length of the searched key. For the wrong key, the histogram differences are large. When the histograms are almost the same, the key has been found and we can decrypt the text.

Technologies Used

  • C++ 14

Features

  • Encrypting the text
  • Decrypting the ciphertext
  • Breaking the ciphertext

Setup

Encrypting:

Program loads text from files:

  • original text: ../texts/encryption/text.txt
  • key: ../texts/encryption/key.txt Program loads text to file:
  • result: ../texts/encryption/encryption_result.txt

Decrypting:

Program loads text from files:

  • original text: ../texts/decrypting/ciphertext.txt
  • key: ../texts/decrypting/key.txt Program loads text to file:
  • result: ../texts/decrypting/descrypting_result.txt

Cryptanalysis:

Program loads text from files:

  • original text: ../texts/cryptanalysis/ciphertext.txt Program loads text to file:
  • result: ../texts/cryptanalysis/cryptanalysis_result.txt

You may change the contents of these files to encryption/decryption/break your own text.

Project Status

Project is complete

Contact

Created by @jwiekiera - feel free to contact me!

vigenere's People

Contributors

jwiekiera avatar

Stargazers

 avatar  avatar

Watchers

 avatar

vigenere's Issues

Question

Hey could you explain the code to me?

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.