Skip to main content

MonoCipher

MonoCipher

MonoCipher is python programmed package which allow users to encrypt and decrypt messages in three different levels

  1. Simple Cryption with Shift number
  2. Byte Cryption with an advance method of encryption and decryption with Initialization Vector (IV) and Cipher Text. more on IV
  3. Salt Cryption with advance method of encryption and decryption with Initialization Vector (IV), Cipher Text, Password and salt. more on salt

The core module used in the project is pycryptodome

To Use This Module

pip install MonoCipher

Features

Simple Encryption

  • This function encrypts decrypts message using shift method
  • This function takes an input of message and shift number | shift_encrypt(message, shift)
    For Decrypting the message the function takes as same | shift_encrypt(message, shift)

Byte Encryption

  • This encryption works in an advance method of encryption and decryption with Initialization Vector (IV) and Cipher Text. more on IV
  • This function takes an input of Message and Password and returns VI and Cipher Text | byte_encrypt(message, password)
  • For Decrypting the message the function takes VI, Cipher Text, and Password | byte_decrypt(iv, ciphertext, password)

Salt Encryption

  • This encryption works in an advance method of encryption and decryption with Initialization Vector (IV), Cipher Text, Password and salt. more on salt
  • This function takes an input of Message and Password and returns Salt, VI and Cipher Text | salt_encrypt(message, password)
    For Decrypting the message the function takes Salt, VI, Cipher Text, and Password | salt_decrypt(salt, iv, ciphertext, password)
  • On this process the encrypt function generates a 256-bit key | generate_key(password, salt)

Certainly! Here's the updated usage section for the README.md file:

Usage

Simple Encryption Module:

shift_encrypt:

Encrypts a message using a simple Caesar cipher with a specified shift value.

from MonoCipher.SimpleEncryption import shift_encrypt

message = "Hello, World!"
shift = 3

encrypted_message = shift_encrypt(message, shift)
print("Encrypted message:", encrypted_message)

shift_decrypt:

Decrypts a message encrypted with a Caesar cipher using the same shift value.

from MonoCipher.SimpleEncryption import shift_decrypt

encrypted_message = "Khoor, Zruog!"
shift = 3

decrypted_message = shift_decrypt(encrypted_message, shift)
print("Decrypted message:", decrypted_message)

Byte Encryption Module:

byte_encrypt:

Encrypts a message using AES encryption in CBC mode with a provided key.

from MonoCipher.ByteEncryption import byte_encrypt

message = "Hello, World!"
password = "MySecretPassword"

iv, ciphertext = byte_encrypt(message, password)
print("IV:", iv)
print("Ciphertext:", ciphertext)

byte_decrypt:

Decrypts a message encrypted with AES encryption using the same key and initialization vector (IV).

from MonoCipher.ByteEncryption import byte_decrypt
  
iv = "some_base64_encoded_iv"
ciphertext = "some_base64_encoded_ciphertext"
password = "MySecretPassword"

decrypted_message = byte_decrypt(iv, ciphertext, password)
print("Decrypted message:", decrypted_message)

Salt Encryption Module:

salt_encrypt:

Encrypts a message using AES encryption in CBC mode with a provided password and a random salt.

from MonoCipher.SaltEncryption import salt_encrypt

message = "Hello, World!"
password = "MySecretPassword"

salt, iv, ciphertext = salt_encrypt(message, password)
print("Salt:", salt)
print("IV:", iv)
print("Ciphertext:", ciphertext)

salt_decrypt:

Decrypts a message encrypted with AES encryption using the same password and salt.

from MonoCipher.SaltEncryption import salt_decrypt

salt = "some_base64_encoded_salt"
iv = "some_base64_encoded_iv"
ciphertext = "some_base64_encoded_ciphertext"
password = "MySecretPassword"

decrypted_message = salt_decrypt(salt, iv, ciphertext, password)
print("Decrypted message:", decrypted_message)

HMAC Encryption Module:

hmac_encrypt:

Encrypts a message using HMAC authentication.

from MonoCipher.HmacEncryption import hmac_encrypt

message = "Hello, World!"
password = "MySecretPassword"

salt, nonce, ciphertext, tag = hmac_encrypt(message, password)
print("Salt:", salt)
print("Nonce:", nonce)
print("Ciphertext:", ciphertext)
print("Tag:", tag)

hmac_decrypt:

Decrypts a message encrypted with HMAC authentication using the same parameters.

from MonoCipher.HmacEncryption import hmac_decrypt

salt = "some_base64_encoded_salt"
nonce = "some_base64_encoded_nonce"
ciphertext = "some_base64_encoded_ciphertext"
tag = "some_base64_encoded_tag"
password = "MySecretPassword"

decrypted_message = hmac_decrypt(salt, nonce, ciphertext, tag, password)
print("Decrypted message:", decrypted_message)

Nonce Encryption Module:

nonce_encrypt:

Encrypts a message using a nonce for authentication.

from MonoCipher.NonceEncryption import nonce_encrypt

message = "Hello, World!"
password = "MySecretPassword"

salt, nonce, ciphertext, tag = nonce_encrypt(message, password)
print("Salt:", salt)
print("Nonce:", nonce)
print("Ciphertext:", ciphertext)
print("Tag:", tag)

nonce_decrypt:

Decrypts a message encrypted with a nonce for authentication using the same parameters.

from MonoCipher.NonceEncryption import nonce_decrypt

salt = "some_base64_encoded_salt"
nonce = "some_base64_encoded_nonce"
ciphertext = "some_base64_encoded_ciphertext"
tag = "some_base64_encoded_tag"
password = "MySecretPassword"

decrypted_message = nonce_decrypt(salt, nonce, ciphertext, tag, password)
print("Decrypted message:", decrypted_message)

MAC Encryption Module:

mac_encrypt:

Encrypts a message using AES-GCM with a provided password.

from MonoCipher.MacEncryption import mac_encrypt

message = "Hello, World!"
password = "MySecretPassword"

salt, nonce, ciphertext, tag = mac_encrypt(message, password)
print("Salt:", salt)
print("Nonce:", nonce)
print("Ciphertext:", ciphertext)
print("Tag:", tag)

mac_decrypt:

Decrypts a message encrypted with AES-GCM using the same parameters.

from MonoCipher.MacEncryption import mac_decrypt

salt = "some_base64_encoded_salt"
nonce = "some_base64_encoded_nonce"
ciphertext = "some_base64_encoded_ciphertext"
tag = "some_base64_encoded_tag"
password = "MySecretPassword"

decrypted_message = mac_decrypt(salt, nonce, ciphertext, tag, password)
print("Decrypted message:", decrypted_message)

These are the usages for each of the six functions provided by the encryption modules. You can customize the input values such as the message, shift value, password, IV, and ciphertext according to your requirements.


Contributions Welcome

We welcome contributions from the community to enhance and improve our encryption project. Whether you're interested in adding new features, fixing bugs, improving documentation, or suggesting ideas, your contributions are highly appreciated.

Contact

Author : Rakesh Kanna
E-Mail : rakeshkanna0108@gmail.com
Version : v0.1.3
Repository : https://github.com/rakeshkanna-rk/MonoCipher PyPI : https://pypi.org/project/MonoCipher/

Project Under MIT LICENSE

Metadata

Release files for MonoCipher 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MonoCipher 0.1.3
File Size Uploaded
MonoCipher-0.1.3.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MonoCipher 0.1.3
File Interpreter ABI Platform
MonoCipher-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / MonoCipher-0.1.3.tar.gz

Download URL MonoCipher-0.1.3.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
37d9ea66681f2bee516c67e58378f852b75185b32403b0cd8561baabf50d7c8b
BLAKE2b-256 checksum
How to use checksums
586e8db3b52f6098379d4ecbb60c351ef0c6b7b9811e58fde78838d6cda2d601
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release files / MonoCipher-0.1.3-py3-none-any.whl

Download URL MonoCipher-0.1.3-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26360b26ff9bd4e4ad04114bcd92c4685ff177450e0ca99f5845c87ceab45124
BLAKE2b-256 checksum
How to use checksums
d681cbef0641db078c707c2c15fabe41fa47f36c41d6a27ff001f57347f2f72d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page