{"id":21803787,"url":"https://github.com/smaranjitghose/pyconfidentiality","last_synced_at":"2025-09-03T02:19:07.915Z","repository":{"id":119390112,"uuid":"279162367","full_name":"smaranjitghose/pyconfidentiality","owner":"smaranjitghose","description":"Adding secrecy to your emails with RSA","archived":false,"fork":false,"pushed_at":"2020-08-01T22:11:24.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T04:12:38.502Z","etag":null,"topics":["cryptography","email-sender","python","rsa","smtp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smaranjitghose.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":"2020-07-12T23:02:23.000Z","updated_at":"2020-08-01T22:11:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"616c9229-12ff-41e3-94be-ae3e43935b1f","html_url":"https://github.com/smaranjitghose/pyconfidentiality","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaranjitghose%2Fpyconfidentiality","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaranjitghose%2Fpyconfidentiality/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaranjitghose%2Fpyconfidentiality/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smaranjitghose%2Fpyconfidentiality/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smaranjitghose","download_url":"https://codeload.github.com/smaranjitghose/pyconfidentiality/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244753951,"owners_count":20504624,"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","email-sender","python","rsa","smtp"],"created_at":"2024-11-27T11:51:06.996Z","updated_at":"2025-03-21T07:24:24.936Z","avatar_url":"https://github.com/smaranjitghose.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cb\u003ePyConfidentiality\u003c/b\u003e\u003c/h1\u003e\n\n![RSA](https://img.shields.io/badge/rsa-encrypted-brightgreen)\n![Open Source](https://img.shields.io/badge/open-source-red)\n[![License](https://img.shields.io/badge/License-MIT-blue)](https://github.com/smaranjitghose/pycondidentiality/blob/master/LICENSE)\n\nAdding secrecy to your emails with RSA!\n\n\u003cp align=\"center\"\u003e\u003cimg width=50% src=\"https://media.giphy.com/media/3oKIPqZPlKW5otXIS4/giphy.gif\"\u003e\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\u003cb\u003eInstallation\u003c/b\u003e\u003c/h3\u003e\n\n```python\npip install pyconfidentiality\n```\n\n\u003ch3 align=\"center\"\u003e\u003cb\u003eUsage\u003c/b\u003e\u003c/h3\u003e\n\n## 1. Generate the Public and Private Keys\n\n```python\nfrom pyconfidentiality import generate_keypair\n\nbit_length = int(input(\"Enter bit length: \"))\n\npublic_key, private_key = generate_keypair(2**bit_length)\n```\n\n## 2. Generate Cipher Text\n\n```python\nfrom pyconfidentiality import encrypt_message\nplain_text = input(\"Enter a message: \")\ncipher_text, cipher_obj = encrypt_message(plain_text, public_key)\nprint(\"Encrypted message: {}\".format(cipher_text))\n```\n\n## 3. Send the message\n\n- Note we are intially using GMAIL for this\n- Make sure your Google Account has [Allow Less Secure App Access](https://myaccount.google.com/lesssecureapps) enabled\n- It is always recommeded to store the credentials of your GMAIL account using environment variables in your system\n\n```python\nfrom pyconfidentiality import send_message\nyour_email = os.environ.get('EMAIL_ID') \nyour_password = os.environ.get('EMAIL_PASSWORD') \nreceiver_email = input(\"Enter Reciever Email\") \nsubject = input(\"Enter subject of the Email\") \n\nsend_message(your_email,your_password,reciever_email,subject,cipher_text)\n```\n\n## 4. Get back our plain text\n\n```python\nfrom pyconfidentiality import decrypt_message\nprint(\"Decrypted message: {}\".format(decrypt(cipher_obj, private_key)))\n```\n\n\u003ch2 align= \"center\"\u003e\u003cb\u003e Project Maintainers\u003c/b\u003e\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=20% src=\"https://avatars2.githubusercontent.com/u/46641503?v=4\"\u003e\u0026ensp;\u0026ensp;\u0026ensp;\n\u003cimg width=20% src=\"https://avatars2.githubusercontent.com/u/40017559?v=4\"\u003e\n\u003c/p\u003e\n\n\u003ca href=\"https://github.com/smaranjitghose\"\u003e\n\u003ch4 align=\"center\"\u003e\u003cb\u003eSmaranjit Ghose\u003c/b\u003e\u003c/a\u003e\u0026ensp;\u0026ensp;\u0026ensp;\n\u003ca href=\"https://github.com/anushbhatia\"\u003e\u003cb\u003eAnush Bhatia\u003c/b\u003e\u003c/h4\u003e\u003c/a\u003e\n\n\n\u003ca href=\"./Code_of_conduct.md\"\u003e\u003ch2 align= \"center\"\u003e\u003cb\u003e Code of Conduct\u003c/b\u003e\u003c/h2\u003e\u003c/a\u003e \n\u003cp align=\"center\"\u003e\u003cimg width=35% src=\"https://media.giphy.com/media/qHRwTyhWIj4UU/200w_d.gif\"\u003e\u003c/p\u003e\n\n\u003ca href=\"./License.md\"\u003e\u003ch2 align= \"center\"\u003e\u003cb\u003e License\u003c/b\u003e\u003c/h2\u003e\u003c/a\u003e \n\u003cp align=\"center\"\u003e\u003cimg width=35% src=\"https://media.giphy.com/media/xUPGcJGy8I928yIlAQ/giphy.gif\"\u003e\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmaranjitghose%2Fpyconfidentiality","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmaranjitghose%2Fpyconfidentiality","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmaranjitghose%2Fpyconfidentiality/lists"}