MonoCipher


NameMonoCipher JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/rakeshkanna-rk/MonoCipher
SummaryA package for monoalphabetic ciphers (message encryption and decryption).
upload_time2024-03-23 18:29:12
maintainerNone
docs_urlNone
authorRakesh Kanna
requires_python>=3.6
licenseMIT
keywords encryption cryptography security
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![MonoCipher](https://raw.githubusercontent.com/rakeshkanna-rk/MonoCipher/main/MonoCipher.png)

# 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](https://en.wikipedia.org/wiki/Initialization_vector)**  
3. **Salt Cryption with advance method of encryption and decryption with Initialization Vector (IV), Cipher Text, Password and salt. [more on salt](https://en.wikipedia.org/wiki/Salt_(cryptography)#:~:text=In%20cryptography%2C%20a%20salt%20is,needed%20for%20a%20successful%20attack.)**  

### The core module used in the project is [pycryptodome](https://pypi.org/project/pycryptodome/)

### To Use This Module
```terminal
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](https://en.wikipedia.org/wiki/Initialization_vector)**  
- **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](https://en.wikipedia.org/wiki/Salt_(cryptography)#:~:text=In%20cryptography%2C%20a%20salt%20is,needed%20for%20a%20successful%20attack.)**  
- **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.  
  
```python
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.
  
```python
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.
  
```python
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).
  
```python
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.
  
```python
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.
  
```python
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.

```python
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.

```python
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.

```python
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.

```python
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.

```python
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.

```python
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](LICENSE)  

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rakeshkanna-rk/MonoCipher",
    "name": "MonoCipher",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "encryption, cryptography, security",
    "author": "Rakesh Kanna",
    "author_email": "rakeshkanna0108@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/58/6e/8db3b52f6098379d4ecbb60c351ef0c6b7b9811e58fde78838d6cda2d601/MonoCipher-0.1.3.tar.gz",
    "platform": null,
    "description": "![MonoCipher](https://raw.githubusercontent.com/rakeshkanna-rk/MonoCipher/main/MonoCipher.png)\r\n\r\n# MonoCipher\r\n**MonoCipher is python programmed package which allow users to encrypt and decrypt messages in three different levels**  \r\n1. **Simple Cryption with Shift number**  \r\n2. **Byte Cryption with an advance method of encryption and decryption with Initialization Vector (IV) and Cipher Text. [more on IV](https://en.wikipedia.org/wiki/Initialization_vector)**  \r\n3. **Salt Cryption with advance method of encryption and decryption with Initialization Vector (IV), Cipher Text, Password and salt. [more on salt](https://en.wikipedia.org/wiki/Salt_(cryptography)#:~:text=In%20cryptography%2C%20a%20salt%20is,needed%20for%20a%20successful%20attack.)**  \r\n\r\n### The core module used in the project is [pycryptodome](https://pypi.org/project/pycryptodome/)\r\n\r\n### To Use This Module\r\n```terminal\r\npip install MonoCipher\r\n```\r\n## Features\r\n  \r\n### Simple Encryption\r\n- **This function encrypts decrypts message using shift method**  \r\n- **This function takes an input of message and shift number | `shift_encrypt(message, shift)`**  \r\n**For Decrypting the message the function takes as same | `shift_encrypt(message, shift)`**\r\n  \r\n### Byte Encryption  \r\n- **This encryption works in an advance method of encryption and decryption with Initialization Vector (IV) and Cipher Text. [more on IV](https://en.wikipedia.org/wiki/Initialization_vector)**  \r\n- **This function takes an input of Message and Password and returns VI and Cipher Text | `byte_encrypt(message, password)`**  \r\n- **For Decrypting the message the function takes VI, Cipher Text, and Password | `byte_decrypt(iv, ciphertext, password)`**  \r\n  \r\n### Salt Encryption  \r\n- **This encryption works in an advance method of encryption and decryption with Initialization Vector (IV), Cipher Text, Password and salt. [more on salt](https://en.wikipedia.org/wiki/Salt_(cryptography)#:~:text=In%20cryptography%2C%20a%20salt%20is,needed%20for%20a%20successful%20attack.)**  \r\n- **This function takes an input of Message and Password and returns Salt, VI and Cipher Text | `salt_encrypt(message, password)`**  \r\n**For Decrypting the message the function takes Salt, VI, Cipher Text, and Password | `salt_decrypt(salt, iv, ciphertext, password)`**  \r\n- **On this process the encrypt function generates a 256-bit key | `generate_key(password, salt)`**  \r\n  \r\n---\r\n  \r\nCertainly! Here's the updated usage section for the README.md file:\r\n\r\n## Usage  \r\n\r\n### Simple Encryption Module:  \r\n  \r\n#### shift_encrypt:  \r\nEncrypts a message using a simple Caesar cipher with a specified shift value.  \r\n  \r\n```python\r\nfrom MonoCipher.SimpleEncryption import shift_encrypt\r\n\r\nmessage = \"Hello, World!\"\r\nshift = 3\r\n\r\nencrypted_message = shift_encrypt(message, shift)\r\nprint(\"Encrypted message:\", encrypted_message)\r\n```\r\n  \r\n#### shift_decrypt:  \r\nDecrypts a message encrypted with a Caesar cipher using the same shift value.\r\n  \r\n```python\r\nfrom MonoCipher.SimpleEncryption import shift_decrypt\r\n\r\nencrypted_message = \"Khoor, Zruog!\"\r\nshift = 3\r\n\r\ndecrypted_message = shift_decrypt(encrypted_message, shift)\r\nprint(\"Decrypted message:\", decrypted_message)\r\n```\r\n  \r\n### Byte Encryption Module:  \r\n  \r\n#### byte_encrypt:  \r\nEncrypts a message using AES encryption in CBC mode with a provided key.\r\n  \r\n```python\r\nfrom MonoCipher.ByteEncryption import byte_encrypt\r\n\r\nmessage = \"Hello, World!\"\r\npassword = \"MySecretPassword\"\r\n\r\niv, ciphertext = byte_encrypt(message, password)\r\nprint(\"IV:\", iv)\r\nprint(\"Ciphertext:\", ciphertext)\r\n```\r\n  \r\n#### byte_decrypt:  \r\nDecrypts a message encrypted with AES encryption using the same key and initialization vector (IV).\r\n  \r\n```python\r\nfrom MonoCipher.ByteEncryption import byte_decrypt\r\n  \r\niv = \"some_base64_encoded_iv\"\r\nciphertext = \"some_base64_encoded_ciphertext\"\r\npassword = \"MySecretPassword\"\r\n\r\ndecrypted_message = byte_decrypt(iv, ciphertext, password)\r\nprint(\"Decrypted message:\", decrypted_message)\r\n```\r\n  \r\n### Salt Encryption Module:  \r\n  \r\n#### salt_encrypt:  \r\nEncrypts a message using AES encryption in CBC mode with a provided password and a random salt.\r\n  \r\n```python\r\nfrom MonoCipher.SaltEncryption import salt_encrypt\r\n\r\nmessage = \"Hello, World!\"\r\npassword = \"MySecretPassword\"\r\n\r\nsalt, iv, ciphertext = salt_encrypt(message, password)\r\nprint(\"Salt:\", salt)\r\nprint(\"IV:\", iv)\r\nprint(\"Ciphertext:\", ciphertext)\r\n```\r\n  \r\n#### salt_decrypt:  \r\nDecrypts a message encrypted with AES encryption using the same password and salt.\r\n  \r\n```python\r\nfrom MonoCipher.SaltEncryption import salt_decrypt\r\n\r\nsalt = \"some_base64_encoded_salt\"\r\niv = \"some_base64_encoded_iv\"\r\nciphertext = \"some_base64_encoded_ciphertext\"\r\npassword = \"MySecretPassword\"\r\n\r\ndecrypted_message = salt_decrypt(salt, iv, ciphertext, password)\r\nprint(\"Decrypted message:\", decrypted_message)\r\n```\r\n\r\n### HMAC Encryption Module:\r\n\r\n#### hmac_encrypt:\r\nEncrypts a message using HMAC authentication.\r\n\r\n```python\r\nfrom MonoCipher.HmacEncryption import hmac_encrypt\r\n\r\nmessage = \"Hello, World!\"\r\npassword = \"MySecretPassword\"\r\n\r\nsalt, nonce, ciphertext, tag = hmac_encrypt(message, password)\r\nprint(\"Salt:\", salt)\r\nprint(\"Nonce:\", nonce)\r\nprint(\"Ciphertext:\", ciphertext)\r\nprint(\"Tag:\", tag)\r\n```\r\n\r\n#### hmac_decrypt:\r\nDecrypts a message encrypted with HMAC authentication using the same parameters.\r\n\r\n```python\r\nfrom MonoCipher.HmacEncryption import hmac_decrypt\r\n\r\nsalt = \"some_base64_encoded_salt\"\r\nnonce = \"some_base64_encoded_nonce\"\r\nciphertext = \"some_base64_encoded_ciphertext\"\r\ntag = \"some_base64_encoded_tag\"\r\npassword = \"MySecretPassword\"\r\n\r\ndecrypted_message = hmac_decrypt(salt, nonce, ciphertext, tag, password)\r\nprint(\"Decrypted message:\", decrypted_message)\r\n```\r\n\r\n### Nonce Encryption Module:\r\n\r\n#### nonce_encrypt:\r\nEncrypts a message using a nonce for authentication.\r\n\r\n```python\r\nfrom MonoCipher.NonceEncryption import nonce_encrypt\r\n\r\nmessage = \"Hello, World!\"\r\npassword = \"MySecretPassword\"\r\n\r\nsalt, nonce, ciphertext, tag = nonce_encrypt(message, password)\r\nprint(\"Salt:\", salt)\r\nprint(\"Nonce:\", nonce)\r\nprint(\"Ciphertext:\", ciphertext)\r\nprint(\"Tag:\", tag)\r\n```\r\n\r\n#### nonce_decrypt:\r\nDecrypts a message encrypted with a nonce for authentication using the same parameters.\r\n\r\n```python\r\nfrom MonoCipher.NonceEncryption import nonce_decrypt\r\n\r\nsalt = \"some_base64_encoded_salt\"\r\nnonce = \"some_base64_encoded_nonce\"\r\nciphertext = \"some_base64_encoded_ciphertext\"\r\ntag = \"some_base64_encoded_tag\"\r\npassword = \"MySecretPassword\"\r\n\r\ndecrypted_message = nonce_decrypt(salt, nonce, ciphertext, tag, password)\r\nprint(\"Decrypted message:\", decrypted_message)\r\n```\r\n\r\n### MAC Encryption Module:\r\n\r\n#### mac_encrypt:\r\nEncrypts a message using AES-GCM with a provided password.\r\n\r\n```python\r\nfrom MonoCipher.MacEncryption import mac_encrypt\r\n\r\nmessage = \"Hello, World!\"\r\npassword = \"MySecretPassword\"\r\n\r\nsalt, nonce, ciphertext, tag = mac_encrypt(message, password)\r\nprint(\"Salt:\", salt)\r\nprint(\"Nonce:\", nonce)\r\nprint(\"Ciphertext:\", ciphertext)\r\nprint(\"Tag:\", tag)\r\n```\r\n\r\n#### mac_decrypt:\r\nDecrypts a message encrypted with AES-GCM using the same parameters.\r\n\r\n```python\r\nfrom MonoCipher.MacEncryption import mac_decrypt\r\n\r\nsalt = \"some_base64_encoded_salt\"\r\nnonce = \"some_base64_encoded_nonce\"\r\nciphertext = \"some_base64_encoded_ciphertext\"\r\ntag = \"some_base64_encoded_tag\"\r\npassword = \"MySecretPassword\"\r\n\r\ndecrypted_message = mac_decrypt(salt, nonce, ciphertext, tag, password)\r\nprint(\"Decrypted message:\", decrypted_message)\r\n```\r\n\r\n  \r\nThese 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.\r\n    \r\n---\r\n  \r\n### Contributions Welcome\r\n  \r\nWe 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.\r\n  \r\n### Contact  \r\n**Author : Rakesh Kanna**  \r\n**E-Mail : rakeshkanna0108@gmail.com**  \r\n**Version : v0.1.3**  \r\n**Repository : https://github.com/rakeshkanna-rk/MonoCipher**\r\n**PyPI : https://pypi.org/project/MonoCipher/**  \r\n    \r\n### Project Under [MIT LICENSE](LICENSE)  \r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package for monoalphabetic ciphers (message encryption and decryption).",
    "version": "0.1.3",
    "project_urls": {
        "GitHub": "https://github.com/rakeshkanna-rk/MonoCipher/",
        "Homepage": "https://github.com/rakeshkanna-rk/MonoCipher",
        "PyPI": "https://pypi.org/project/MonoCipher/"
    },
    "split_keywords": [
        "encryption",
        " cryptography",
        " security"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d681cbef0641db078c707c2c15fabe41fa47f36c41d6a27ff001f57347f2f72d",
                "md5": "9bcc3db4c6a933c2fc460554d0b74817",
                "sha256": "26360b26ff9bd4e4ad04114bcd92c4685ff177450e0ca99f5845c87ceab45124"
            },
            "downloads": -1,
            "filename": "MonoCipher-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9bcc3db4c6a933c2fc460554d0b74817",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9913,
            "upload_time": "2024-03-23T18:29:05",
            "upload_time_iso_8601": "2024-03-23T18:29:05.919986Z",
            "url": "https://files.pythonhosted.org/packages/d6/81/cbef0641db078c707c2c15fabe41fa47f36c41d6a27ff001f57347f2f72d/MonoCipher-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "586e8db3b52f6098379d4ecbb60c351ef0c6b7b9811e58fde78838d6cda2d601",
                "md5": "306acba8981a97abeb2a3369ab5eef46",
                "sha256": "37d9ea66681f2bee516c67e58378f852b75185b32403b0cd8561baabf50d7c8b"
            },
            "downloads": -1,
            "filename": "MonoCipher-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "306acba8981a97abeb2a3369ab5eef46",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8267,
            "upload_time": "2024-03-23T18:29:12",
            "upload_time_iso_8601": "2024-03-23T18:29:12.147029Z",
            "url": "https://files.pythonhosted.org/packages/58/6e/8db3b52f6098379d4ecbb60c351ef0c6b7b9811e58fde78838d6cda2d601/MonoCipher-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-23 18:29:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rakeshkanna-rk",
    "github_project": "MonoCipher",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "monocipher"
}
        
Elapsed time: 0.21728s