Giter VIP home page Giter VIP logo

encdecpy's Introduction

PyPI - Version PyPI - Version

encdecpy

Python package to encode and decode strings using ciphers.

Installation

$ pip install encdecpy

Usage

The package provides the following ciphers to encode and decode strings -

  1. Affine Cipher
  2. Atbash Cipher
  3. Autokey Cipher
  4. Baconian Cipher
  5. Base64 Cipher
  6. Beaufort Cipher
  7. Caesar Cipher
  8. Columnar Transposition Cipher
  9. Polybius Square Cipher
  10. Rail Fence Cipher
  11. ROT13 Cipher
  12. Running Key Cipher
  13. Simple Substitution Cipher
  14. Vignere Cipher

Affine Cipher

from encdecpy import affine
  • affine.encode(string, a, b) - Returns the encoded string.
  • affine.decode(string, a, b) - Returns the decoded string.

a and b are integers between 0 and 25. a should be relatively prime to 26 and lie between 0 to 25 (both inclusive).

Atbash Cipher

from encdecpy import atbash
  • atbash.encode(string) - Returns the encoded string.
  • atbash.decode(string) - Returns the decoded string.

Autokey Cipher

from encdecpy import autokey
  • autokey.encode(string, key) - Returns the encoded string.
  • autokey.decode(string, key) - Returns the decoded string.

key is a string.

Baconian Cipher

from encdecpy import baconian
  • baconian.encode(string) - Returns the encoded string.
  • baconian.decode(string) - Returns the decoded string.

Base64 Cipher

from encdecpy import base64
  • base64.encode(string) - Returns the encoded string.
  • base64.decode(string) - Returns the decoded string.

Beaufort Cipher

from encdecpy import beaufort
  • beaufort.encode(string, key) - Returns the encoded string.
  • beaufort.decode(string, key) - Returns the decoded string.

key is a string.

Caesar Cipher

from encdecpy import caesar
  • caesar.encode(string, key) - Returns the encoded string.
  • caesar.decode(string, key) - Returns the decoded string.

key is a whole number.

Columnar Transposition Cipher

from encdecpy import columnartransposition
  • columnartransposition.encode(string, key) - Returns the encoded string.
  • columnartransposition.decode(string, key) - Returns the decoded string.

key is a string and should contain unique characters between A-Z.

Polybius Square Cipher

from encdecpy import polybiussquare
  • polybiussquare.encode(string, key) - Returns the encoded string.
  • polybiussquare.decode(string, key) - Returns the decoded string.

key is a string and should contain unique characters between a-z with one alphabet missing. Length of key should be 25. An example key - phqgiumeaylnofdxkrcvstzwb.

Rail Fence Cipher

from encdecpy import railfence
  • railfence.encode(string, key) - Returns the encoded string.
  • railfence.decode(string, key) - Returns the decoded string.

key is a positive number denoting the number of rails.

ROT13 Cipher

from encdecpy import rot13
  • rot13.encode(string) - Returns the encoded string.
  • rot13.decode(string) - Returns the decoded string.

Running Key Cipher

from encdecpy import runningkey
  • runningkey.encode(string, key) - Returns the encoded string.
  • runningkey.decode(string, key) - Returns the decoded string.

key is a large string, usually a paragraph taken from a book.

Simple Substitution Cipher

from encdecpy import simplesubstitution
  • simplesubstitution.encode(string, key) - Returns the encoded string.
  • simplesubstitution.decode(string, key) - Returns the decoded string.
  • simplesubstitution.generate_random_key() - Returns a randomly generated key.

key is a string containing a permutation of the alphabets (a-z), with no other characters. String should contain only unique characters.

Vignere Cipher

from encdecpy import vignere
  • vignere.encode(string, key) - Returns the encoded string.
  • vignere.decode(string, key) - Returns the decoded string.

key is a string, usually a single word.

encdecpy's People

Contributors

ironvenom avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kalebu

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.