{"id":15910789,"url":"https://github.com/gianlucatruda/nis-encrypted-messaging","last_synced_at":"2025-04-03T01:42:06.221Z","repository":{"id":67059275,"uuid":"161468191","full_name":"gianlucatruda/nis-encrypted-messaging","owner":"gianlucatruda","description":"A demonstration of security principles for peer-to-peer communications of sensitive content.","archived":false,"fork":false,"pushed_at":"2018-12-12T10:07:57.000Z","size":1991,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T15:47:51.743Z","etag":null,"topics":["aes-encryption","cryptography","messaging","python3","rsa-cryptography","security"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gianlucatruda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-12-12T09:59:08.000Z","updated_at":"2019-07-10T19:38:16.000Z","dependencies_parsed_at":"2023-02-21T10:01:02.724Z","dependency_job_id":null,"html_url":"https://github.com/gianlucatruda/nis-encrypted-messaging","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"4916d9af0690c98c96d77c98377b691e5f28d9ac"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianlucatruda%2Fnis-encrypted-messaging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianlucatruda%2Fnis-encrypted-messaging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianlucatruda%2Fnis-encrypted-messaging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianlucatruda%2Fnis-encrypted-messaging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gianlucatruda","download_url":"https://codeload.github.com/gianlucatruda/nis-encrypted-messaging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246922240,"owners_count":20855343,"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":["aes-encryption","cryptography","messaging","python3","rsa-cryptography","security"],"created_at":"2024-10-06T15:21:31.235Z","updated_at":"2025-04-03T01:42:06.203Z","avatar_url":"https://github.com/gianlucatruda.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secure Messaging with Symmetric and Asymmetric Encryption\n\nA demonstration of security principles for peer-to-peer communications of sensitive content. Read the [full whitepaper](https://github.com/gianlucatruda/nis-encrypted-messaging/raw/master/whitepaper.pdf).\n\n## Environment\n\n* Python 3.6\n* [pycrypto](https://pypi.org/project/pycrypto/)\n\n## Overview\n\n### Networking module\n\nThe networking module ```network_interface.py``` performs all network communication between the client and the server. \n\n### Cryptographic modules\nThree modules implement the required cryptographic methods. \n\n\n* ```crypto_asymmetric.py``` - Provides encryption and decryption methods implementing RSA.\n* ```crypto_symmetric.py``` - Provides encryption and decryption methods implementing AES. \n* ```crypto_tools.py``` - Provides utility support and helper functions to the other two crypto modules, including digital signatures and verification.\n\n## Task 1 - Asymmetric Cryptography\n\n_\"You are required to code and report on an application that can distribute symmetric keys using asymmetric cryptography.\"_\n\nOverall, each peer will have two sets of public-private key pairs. The first set is for typical RSA encryption. The second is creating and verifying digital signatures.\n\nThe client and server establish a connection, receive each other's public keys and then commence secure communication using RSA encryption. They use this to distribute a shared, 256-bit AES session key (used in Task 2). \n\n* RSA-2048 (for actually sending the message)\n* Digital signing (for source authentication)\n* Padding of message (to prevent 'short message' attack)\n\n## Task 2 - Symmetric Cryptography\n\n_\"You are required to code and report on an application that can encrypt a message with only a symmetric key.\"_\n\nOnce the shared session key is distributed (in Task 1), encrypted communication takes place using AES encryption. \n\n* AES-256 (for the encryption/decryption)\n* SHA-256 (for checksumming)\n* Authenticity is implicit due to session key signing performed in Task 1 \n\n\n## Installation\n \nAfter downloading and unzipping the project files, ensure that Python 3.6 is installed. On Linux, this can be done by executing:\n\n```bash\nsudo apt-get install python3.6\n``` \n\nNext, install the PyCrypto dependency. This is most easily done using pip package manager:\n\n```bash\npython3.6 -m pip install pycrypto\n```\n\nAlternatively, it can be manually downloaded [here](https://pypi.org/project/pycrypto/#files).\n\n\n## Usage\n\n**Task 1** and **Task 2** are demonstrated sequentially in a single pair of programs.\n\nThe demo requires two terminal windows to be open, and is best experienced when both terminals are visible at the same time. \n\nStart the **server** application in one of the two terminals by running:\n\n```bash\npython3.6 network_server.py\n```\n\nIf this starts correctly, you should see ``` Listening to localhost on port 1302 ``` as the server waits for a connection.\n\nIn the other terminal, run the **client** by executing:\n\n```bash\npython3.6 network_client.py\n```\n\nWhen this runs, the client and server should connect and communication should be displayed. \n\nFor demonstration purposes, a plethora of debug statements are printed to the terminal which show and describe each stage in the process of communication. In practice, this would be hidden from the end-users.\n\n## Contributors\n\n* [Gianluca Truda](https://github.com/gianlucatruda)\n* [Luke Neville](https://github.com/Nevter)\n* [Zak Toyer](https://github.com/zed925)\n* [Robbie Barnhoorn](https://github.com/RobbieBarnhoorn)\n\n## Disclaimer\n\nThis software is for demonstration purposes only and should not be used in production code, as security is not guaranteed. The creators accept no liability whatsoever.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianlucatruda%2Fnis-encrypted-messaging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgianlucatruda%2Fnis-encrypted-messaging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianlucatruda%2Fnis-encrypted-messaging/lists"}