Giter Site home page Giter Site logo

simple_substitution_cypher's Introduction

Simple_substitution_cypher

encodes and decodes a message based on a phrase

main ideea is that encryption and decryption in this case are strongly related for encrytion we build a dict using the letters from whatever key we have given taken once, followed by the rest of the letters in the alphabet take once, without those already used. However, if we were to use such a dict we could not encrypt because for any "normal" letter in the message we want to modify we need to have the corresponding letter from our key. this is why we reverse the dict we built And the transformation from uncoded word to coded word is done in place

for decryption- we already had the def to obtain the keys and values- so it is basically the same path, without swapping the dict

in the example copied from wiki it might be clearer

Plaintext alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ Ciphertext alphabet ZEBRASCDFGHIJKLMNOPQTUVWXY

so if we want to encode A->Z in whatever text we put into, but if we were to decode A->E to get something readable- this is why i said for encryption we need to reverse the dict keys become values and values become keys

simple_substitution_cypher's People

Contributors

livia-zaharia 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.