Coder Social home page Coder Social logo

coolstormaction / encrypterish Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 50 KB

An encryption and decryption program written with Python. For more info about the shuffling process. See README.md

License: MIT License

Python 100.00%
decryption encrypting encryption encryption-decryption python encrypting-patterns decrypting encryption-decryption-algorithms encryption-decryption-detecting

encrypterish's Introduction

Encrypterish

Encrypterish is encrypting (and decrypting) program which encrypts a given string input and provides an encrypted output. It also supports decrypting a given encrypted string input (it has to encrypted from Encrypterish btw).

How does Encrypterish actually encrypt (or shuffle) a given string input?

In the codebase, we have two base classes,

  • Encryption
  • Decryption

Let's talk about :class:Encryption first

The Encrypt class takes a string input (original string) and then shuffles and gives the output.

Behind the scenes, the shuffle method which actually shuffles it iterates over the word.
While iterating it replaces each letter to the 3rd letter respective to it.

What about numbers?

As for numbers, the shuffle functions replaces them with their assigned symbol in keyboard. If you look at the keyboard, you will find that every number has a assigned punctuation symbol which can be accessed using the Shift key. The process for shuffling punctuations is just the opposite, it replaces the symbol with it's assigned number on the keyboard.

What about letters like xyz which cannot be replaced to the third letter?

As for these letters, the shuffle method replaces them with abc respectively.

  • Example
    x is replaced with a
    y is replaced with b
    z is replaced with c

Let's talk about :class:Decryption now

This class is the exact opposite of the Encrypt class. After being shuffled from the Encrypt class, this class decrypts the string to it's original state.

The hardwork in this class is all done by the decrypt method.
This method iterates over the word and replaces the letter to the letter 3 places before it.

  • Example
    d is replaced with a
    e is replaced with b
    ...and so on

What for numbers?

As for numbers, they are replaced with their corresponding symbol in the keyboard.
And punctuations are replaced with their corresponding number in the keyboard

  • Example
    ! is replaced 1
    @ is replaced with 2
    1 is replaced with !
    2 is replaced with @
    ..so as we can clearly see, this class is the exact opposite of the Encrypt class.

Example of how to use in your codebase

  • Clone the repository (git clone https://github.com/Coolstormaction/Encrypterish)
  • Rename the new folder from Encrypterish to encrypterish
  • Move the folder to your codebase (as pip package is not available yet)
  • Follow the below steps
from encrypterish.encryption import Encryption
from encrypterish.decryption import Decryption

# Encrypting a string
encrypt = Encryption("example")
encrypted_string = encrypt.shuffle()

# Decrypting a string 
decrypt = Decryption(encrypted_string)
decrypted_string = decrypt.decrypt()

print(encrypted_string, decrypted_string)

# More code ...

That's it!

If you notice bugs or want to share feedback, contact me through any of the below mediums

Any questions and feedback are heartily welcome ๐Ÿ˜„.
More improvements on the shuffling process and pip package for encrypterish are going to be rolled on in the next few updates!

encrypterish's People

Contributors

coolstormaction avatar

Stargazers

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