Giter Club home page Giter Club logo

caesar's Introduction

Caesar Cipher

Quickstart

Encrypt, decrypt, and break Caesar's cipher! Requires python3.

Run interactively like this:

    python3 caesar_encrypt.py
    python3 caesar_decrypt.py
    python3 caesar_break.py

Alternatively, provide key and text to encrypt, or just text to break, as command line option.

Description

Project to mess around with the Caesar cipher. Caesar's cipher is simple character replacement. Pick a letter (other than A) then shift all the characters such that every plaintext A is ciphertext your chosen letter, every B becomes the letter after, C the letter after that, and so on. Caesar's cipher is classic example of a very weak encryption. It is vulnerable to frequency analysis among other things. The most common letter in English is 'E'. So, in this project, we break Caesar ciphers by examining the ciphertext. Letters with frequency of 10% or greater could be 'E' in the plaintext; after identifying the possibilities, we decrypt and discover the plaintext.

NOTE that, since Caesar keyspace is so small, brute-force attacks are trivial to launch and 100% effective. We don't do that because the point of this project is to showcase frequency analysis. Besides, it's nicer this way- you don't have to look through twenty five possiblities to find the correct one!

The project has three files:

  1. caesar_encrypt.py encrypts some plaintext into a caesar ciphertext. It consists of an encrypt() function and a wrapper.
  2. caesar_decrypt.py decrypts some caesar ciphertext back into plaintext. It consists of a decrypt() function and a wrapper.
  3. caesar_break.py applies frequency analysis to some caesar ciphertext. It uses decrypt() from caesar_decrypt.py

TODOs

  • in caesar_break.py, change frequency analysis to function?
  • during decrypt(), guess at spacing to improve readability?

caesar's People

Contributors

lightski avatar

Watchers

James Cloos 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.