Code Monkey home page Code Monkey logo

vigenere-cipher's Introduction

๐Ÿงฉ๐Ÿ”’ - Vigenere Cipher

This Python script implements the Vigenere cipher for encrypting and decrypting text based on a provided keyword.

Usage

  1. Clone the Repository:

    https://github.com/d4v1-sudo/vigenere-cipher.git
    cd vigenere-cipher
  2. Run the Script:

    python3 vigenere_cipher.py
  3. Follow the Prompts:

    • Enter the text to be processed.
    • Enter the keyword for encryption or decryption.
    • Choose to encrypt or decrypt by typing 'e' or 'd' accordingly.

Script Description

The Python script consists of two functions:

generateKey(string, key)

This function generates a key of the same length as the input string by repeating the provided keyword. If the lengths are already equal, the key is returned as is.

vigenere(string, key, mode)

This function performs the Vigenere cipher operation on the input string using the provided key and specified mode ('e' for encryption or 'd' for decryption).

  • Encryption (mode == "e"): Encrypts the input text using the Vigenere cipher.
  • Decryption (mode == "d"): Decrypts the input text using the Vigenere cipher.

Example

Text to process: HelloWorld
Keyword: KEY
Encrypt or decrypt? (Type 'e' or 'd'): e
Ciphertext: RiJvsPvyG

Note

  • Make sure to only enter alphabetic characters in the input text.
  • The keyword should consist of alphabetic characters only.

Feel free to use and modify the script for your cryptographic needs. If you encounter any issues or have suggestions for improvements, please let us know.

vigenere-cipher's People

Contributors

d4v1-sudo 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.