Skip to main content

some methods about classical code

Project description

Encryption Algorithms Module

This directory contains implementations of several classic encryption algorithms. Below is a brief description of each file:

File Descriptions

__init__.py

  • This file marks the current directory as a Python package.

caesar.py

  • Implements the Caesar Cipher encryption algorithm.
  • Caesar Cipher is a simple substitution cipher that encrypts text by shifting letters in the alphabet by a fixed number of steps.
  • Functions: Caesar_encode(plaintext: str, key: int) -> str: Encrypts the given plaintext using the specified key. plaintext: The input string to be encrypted. key: The number of positions to shift each letter.
  • Caesar_decode(ciphertext: str) -> dict: Attempts to decrypt the ciphertext by trying all possible keys. ciphertext: The encrypted string to be decrypted.

Playfair.py

  • Implements the Playfair Cipher encryption algorithm.
  • Playfair Cipher is an encryption method based on a letter matrix, commonly used to encrypt text.
  • Functions: Playfair_encode(Keyword: str, Plaintext: str) -> str: Encrypts the plaintext using the Playfair cipher. Keyword: The encryption key used to generate the matrix. Plaintext: The input string to be encrypted.
  • Playfair_decode(Keyword: str, ciphertext: str) -> str: Decrypts the ciphertext using the Playfair cipher. Keyword: The encryption key used to generate the matrix. ciphertext : The encrypted string to be decrypted

Vigenere.py

  • Implements the Vigenère Cipher encryption algorithm.
  • Vigenère Cipher is a polyalphabetic substitution cipher that uses a key to determine the shift for each letter.
  • functions: Vigenere_encode(Plaintext: str, m: int, keyword: str) -> str: Encrypts the plaintext using the Vigenère cipher. Plaintext: The input string to be encrypted. m: The length of the keyword. keyword: The encryption key.
  • Vigenere_decode(ciphertext: str,m: int, keyword: str) -> str : Decrypts the ciphertext using the Vigenere cipher. ciphertext : The encrypted string to be decrypted. m: The length of the keyword. keyword: The encryption key.

Usage

  1. Import the modules:

    from crYpt import caesar, Playfair, Vigenere
    
  2. Call the corresponding functions to encrypt or decrypt.

Notes

  • Ensure that the input text and key meet the requirements of each algorithm.
  • For detailed usage instructions, refer to the comments in each file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crypt_pr-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crypt_pr-0.0.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file crypt_pr-0.0.2.tar.gz.

File metadata

  • Download URL: crypt_pr-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for crypt_pr-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3e91fcc3f0669545b067b97036a88f646c6fc674938e20696ed7aaf1f7436775
MD5 acd568be1745738d0458ed40c2e16e03
BLAKE2b-256 8ce27c0086e96c9ccbb41802515bc1f5761d570b5f3b3215532d12233cb8bef3

See more details on using hashes here.

File details

Details for the file crypt_pr-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: crypt_pr-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for crypt_pr-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aaf45d623affaa549f0c1c43aab167914efdaa572f939376665e81d33c7c0651
MD5 9214f207c518da8dd34db755ad1f0102
BLAKE2b-256 eb373394a20f3de7014322755201d4c1612a85bc4aad61ee92b792388fe492db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page