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.

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.

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.1.tar.gz (4.4 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.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crypt_pr-0.0.1.tar.gz
  • Upload date:
  • Size: 4.4 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.1.tar.gz
Algorithm Hash digest
SHA256 6c699e955d0b936e731d58a3c95b00f3004f88e56bb127d74559440465e6360f
MD5 fb75b5b0dd4a36bf92ba578f7ac0a724
BLAKE2b-256 c6dab4079f5d732b501c9ae7948d5a4c850275ea51b21a83d02790d925b1bff8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: crypt_pr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee28d5ff7b83f32c06f9c00bb0eaf9b2f142128244f2b396c5ef66d29df6e7ca
MD5 5c4807606b8b8a83a53bb091d7ac037c
BLAKE2b-256 313297b28da16b5a192a3ad6ee83096e0fcbaaac8989ca7f58f3a1eba745d548

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