GithubHelp home page GithubHelp logo

rs0125 / auto-caesarean-decipher Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.7 MB

A program that automatically deciphers english text enciphered in caesar cipher via language recognition (Database included with 474k english words)

License: Apache License 2.0

Python 100.00%

auto-caesarean-decipher's Introduction

Auto-Caesarean-Decipher

Auto-Caesarean-Decipher is a Python program designed to automatically decipher English text that has been enciphered using the Caesar Cipher technique. The program utilizes language recognition to identify the correct decryption key by comparing the deciphered text against a large English word database.

How it works

  1. Input Text:
  • The program prompts the user to input the enciphered paragraph as a string.
  • The input text is converted to lowercase for consistency in the decryption process.
  1. English Word Database:
  • The program reads a 479k English words text file ('words.txt'), which serves as the English word database. This database is used to determine the validity of words during decryption.
  1. Word Count in Enciphered Text:
  • The program calculates the word count in the enciphered text. This word count is later used to measure the accuracy of the language recognition process.
  1. Decryption Loop:
  • The program runs a loop from 0 to 25, corresponding to the 26 possible shifts in Caesar Cipher (26 is included to handle the no-shift scenario, i.e., plaintext).
  • For each shift value, the program performs the Caesar Cipher decryption and converts the deciphered text to lowercase.
  • The deciphered text is then split into individual words to prepare for language recognition.
  1. Language Recognition:
  • The program uses binary search to check each word in the deciphered text against the English word database.
  • If a word in the deciphered text is found in the database, it increments a counter (dcount).
  1. Decryption Success Criteria:
  • After checking all the words in the deciphered text, the program compares the value of dcount with 75% of the word count in the enciphered text.
  • If the number of recognized words (dcount) is greater than 75% of the word count in the enciphered text, the decryption process is considered successful.
  1. Final Decryption Output:
  • If the decryption is successful (i.e., the language recognition match is over 75% accurate), the program prints the final deciphered text.
  • If no successful decryption is found, the program terminates without producing any output.
  1. Word Database File Closure:
  • The program closes the 474k English words text file after the decryption process.

Resources

Database of 479k English Words

Caesar Cipher

Decipher Bot (Encryption and Decryption of text messages based on the discord API)

Planned Expansions

  • integration in decryption bot
  • usage of set search in python to optimise speed down to 10 ms per search (set of 500k)

TODO: function documentation

auto-caesarean-decipher's People

Contributors

rs0125 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.