Giter VIP home page Giter VIP logo

adventures-in-cryptanalysis's Introduction

Decipher

Background

This problem was presented to me as a code challenge for a company I was applying to. This submission got me to the next round, where I promptly disqualified myself by having trouble efficiently computing Conway's Game Of Life.

The problem statement follows. My solution can be found in christopher.py. My thought process and results can be found in thought-process.md. The prompt follows:

=====

Goal

The goal of this problem is to write a program that decrypts a set of short messages (roughly the length of Tweets) that have been encrypted with a simple substitution cipher.

Input Data

Along with this documentation file, you have been given two data files.

"encoded-en.txt" is a set of short messages (e.g. Tweets) in English, where each has been encrypted using a simple substitution cipher. Such a cipher works by replacing all occurrences of a character with a different (randomly selected, but consistent) character. The substitution is not case sensitive.

For example:

Original message: Hello world. Encrypted message: Lkccz mzfca.

Cipher:

encrypted decrypted
d a
e k
h l
l c
o z
r f
w m

For this problem white space and punctuation are not substituted.

"corpus-en.txt" is a corpus of English text consisting of the contents of a number of books.

Your Program

Your program should be runnable from the command line and output at least two things:

(1) The decryption cipher (i.e. the inverse mapping of encoded character back to original), in a single text file with the format:

encrypted decrypted
... ...

for each character. No header row, thus there should be 26 rows (one for each English letter).

(2) The original Tweets decrypted based on this decryption cipher. This should be in a single text file, following the same formatting as the encrypted messages provided.

adventures-in-cryptanalysis's People

Watchers

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