Giter VIP home page Giter VIP logo

the-vigenere-cipher-decryption's Introduction

The-Vigenere-Cipher-Decryption

Vigenère Cipher Decryption Using Frequency Analysis

This script decrypts a Vigenère cipher using frequency analysis. It includes functions to estimate the key length, perform frequency analysis, and decrypt the ciphertext.

Features

  • Kasiski Examination: Estimates the length of the Vigenère key.
  • Frequency Analysis: Analyzes letter frequencies to determine the most likely key.
  • Decryption: Uses the derived key to decrypt the ciphertext.

How It Works

  1. Calculate Index of Coincidence (IC):
    • The calculate_ic function computes the IC for a given text segment to help identify the key length.
  2. Kasiski Examination:
    • The kasiski_examination function calculates the IC for various assumed key lengths to identify the most probable key lengths.
  3. Frequency Analysis:
    • The frequency_analysis function analyzes the frequency of each letter in segments of the ciphertext to determine the most likely shift for each segment.
  4. Decrypt Vigenère Cipher:
    • The decrypt_vigenere function uses the derived key to decrypt the entire ciphertext.

Usage

  1. Set the Ciphertext: Replace the ciphertext variable with your Vigenère encrypted message.

  2. Estimate Key Length:

    • The script uses Kasiski examination to estimate the key length and prints the top 5 key length estimates.
  3. Decrypt the Ciphertext:

    • The script performs frequency analysis for each estimated key length, derives the key, and decrypts the ciphertext.

the-vigenere-cipher-decryption's People

Contributors

horahagh16 avatar

Watchers

 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.