{"id":21646160,"url":"https://github.com/20101301-alina-hasan/multiple-cryptographic-functionalities","last_synced_at":"2026-05-18T18:32:37.449Z","repository":{"id":264412993,"uuid":"893303358","full_name":"20101301-Alina-Hasan/Multiple-Cryptographic-Functionalities","owner":"20101301-Alina-Hasan","description":"This Python application integrates various cryptographic functionalities into a single interactive program. Users can perform operations such as encryption, decryption, hashing, digital signature generation/verification, and Message Authentication Code (MAC) generation.","archived":false,"fork":false,"pushed_at":"2024-12-11T07:14:42.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T04:43:12.504Z","etag":null,"topics":["cryptography","digital-signature-algorithm","encryption-decryption","hashing","jupyter-notebook","message-authentication-code","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/20101301-Alina-Hasan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-24T04:20:14.000Z","updated_at":"2024-12-11T07:14:46.000Z","dependencies_parsed_at":"2024-11-24T06:00:47.841Z","dependency_job_id":null,"html_url":"https://github.com/20101301-Alina-Hasan/Multiple-Cryptographic-Functionalities","commit_stats":null,"previous_names":["20101301-alina-hasan/multiple-cryptographic-functionalities"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20101301-Alina-Hasan%2FMultiple-Cryptographic-Functionalities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20101301-Alina-Hasan%2FMultiple-Cryptographic-Functionalities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20101301-Alina-Hasan%2FMultiple-Cryptographic-Functionalities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20101301-Alina-Hasan%2FMultiple-Cryptographic-Functionalities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/20101301-Alina-Hasan","download_url":"https://codeload.github.com/20101301-Alina-Hasan/Multiple-Cryptographic-Functionalities/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244510968,"owners_count":20464215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","digital-signature-algorithm","encryption-decryption","hashing","jupyter-notebook","message-authentication-code","python"],"created_at":"2024-11-25T06:37:53.416Z","updated_at":"2026-05-18T18:32:37.442Z","avatar_url":"https://github.com/20101301-Alina-Hasan.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multiple Cryptographic Functionalities\r\n\r\n## Overview\r\n\r\nThis Python application integrates various cryptographic functionalities into a single interactive program. Users can perform encryption, decryption, hashing, digital signature generation/verification, and Message Authentication Code (MAC) generation.\r\n\r\nDeveloped by **Alina Hasan**\r\n\r\n---\r\n\r\n## Features\r\n\r\n1. **AES Encryption/Decryption**  \r\n   Supports encryption and decryption using AES in ECB or CBC modes. Users can input plaintext/ciphertext, specify the AES mode, provide keys, and select the desired operation.\r\n\r\n2. **RSA Encryption/Decryption**  \r\n   Implements RSA for encrypting and decrypting messages. Users can generate RSA keys and perform encryption or decryption.\r\n\r\n3. **Hashing**  \r\n   Provides hashing functionalities using SHA1, SHA256, and MD5. Users can input data and select the hashing algorithm.\r\n\r\n4. **Digital Signature using RSA**  \r\n   Facilitates the creation and verification of digital signatures to ensure message integrity and authenticity.\r\n\r\n5. **MAC Generation**  \r\n   Supports generation of Message Authentication Codes using CMAC (Cipher Block Chaining-MAC) and HMAC (Hash-based Message Authentication Code).\r\n\r\n---\r\n\r\n## Installation\r\n\r\nBefore running the program, install the required cryptographic library:\r\n\r\n```bash\r\npip install pycryptodome\r\n```\r\n\r\n---\r\n\r\n## Usage\r\n\r\n### Running the Application\r\n\r\nRun the program in a Python environment. Upon execution, a menu will appear with the following options:\r\n\r\n1. **AES Encryption/Decryption**\r\n   \r\n   - Choose ECB or CBC mode.\r\n   - Specify whether to encrypt or decrypt.\r\n   - Input the message and key.\r\n\r\n2. **RSA Encryption/Decryption**\r\n   \r\n   - Generate RSA keys (private and public).\r\n   - Choose encryption or decryption.\r\n   - Input the required keys and message.\r\n\r\n3. **Hashing**\r\n   \r\n   - Select the hashing algorithm (SHA1, SHA256, or MD5).\r\n   - Input the message to hash.\r\n\r\n4. **Digital Signature using RSA**\r\n   \r\n   - Generate a signature or verify an existing one.\r\n   - Provide the necessary keys and message.\r\n\r\n5. **MAC Generation**\r\n   \r\n   - Choose between CMAC and HMAC.\r\n   - Input the message to generate the MAC.\r\n\r\n6. **Exit**\r\n   \r\n   - Quit the application.\r\n\r\n---\r\n\r\n## Examples\r\n\r\n### AES Encryption\r\n\r\n- Mode: CBC\r\n- Message: `HelloWorld`\r\n- Key: `mysecretkey`\r\n\r\n```plaintext\r\nEncrypted text: b'\\xab\\xcd\\xef...'\r\nDecrypted text: HelloWorld\r\n```\r\n\r\n### RSA Encryption\r\n\r\n- Generate keys:\r\n  \r\n  - Prime Numbers: `p = 17`, `q = 23`\r\n  - Public Key (e, N): `(3, 391)`\r\n  - Private Key (d): `275`\r\n\r\n- Encrypt: `M = 42`\r\n  \r\n  ```plaintext\r\n  Encrypted message: 180\r\n  ```\r\n\r\n- Decrypt: `C = 180`\r\n  \r\n  ```plaintext\r\n  Decrypted message: 42\r\n  ```\r\n\r\n### Hashing\r\n\r\n- Algorithm: SHA256\r\n- Message: `SecureHash`\r\n\r\n```plaintext\r\nHash Value: 7c2a55...e3a6f9\r\n```\r\n\r\n### Digital Signature\r\n\r\n- Message: `VerifyThis`\r\n- Signature: Generated using RSA private key.\r\n- Verification: Valid or Invalid.\r\n\r\n### MAC Generation\r\n\r\n- Message: `AuthenticateMe`\r\n- CMAC/HMAC: Generates a unique signature for the message.\r\n\r\n---\r\n\r\n## Implementation Details\r\n\r\n### Modules Used\r\n\r\n- `pycryptodome` for cryptographic functionalities.\r\n- `hashlib`, `base64`, `os`, `hmac` for supporting utilities.\r\n\r\n### Cryptographic Algorithms\r\n\r\n- **AES**: Encryption/Decryption using block ciphers.\r\n- **RSA**: Public/Private key cryptography for secure communication.\r\n- **SHA1/SHA256/MD5**: Hash functions for integrity.\r\n- **MAC**: Ensures authenticity using CMAC or HMAC.\r\n\r\n### Input Validation\r\n\r\n- Prime checking using `is_prime` function.\r\n- Coprime validation for RSA key generation.\r\n\r\n---\r\n\r\n## Future Improvements\r\n\r\n- Extend support for additional algorithms (e.g., DES, RSA-OAEP).\r\n- Add a GUI for improved user experience.\r\n- Provide more robust error handling for invalid inputs.\r\n\r\n---\r\n\r\n## License\r\n\r\nThis project is for academic purposes. Redistribution or commercial use is prohibited without permission.\r\n\r\n---\r\n\r\n## Contact\r\n\r\nFor questions or inquiries, reach out via [alina.hasan@g.bracu.ac.bd](mailto:alina.hasan@g.bracu.ac.bd)  \r\n\r\n---\r\n\r\nFeel free to ⭐ the repo if you find it useful.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F20101301-alina-hasan%2Fmultiple-cryptographic-functionalities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F20101301-alina-hasan%2Fmultiple-cryptographic-functionalities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F20101301-alina-hasan%2Fmultiple-cryptographic-functionalities/lists"}