{"id":13801466,"url":"https://github.com/jacklinquan/micropython-cryptomsg","last_synced_at":"2025-03-05T07:34:27.858Z","repository":{"id":57441474,"uuid":"266942794","full_name":"jacklinquan/micropython-cryptomsg","owner":"jacklinquan","description":"A MicroPython module to encrypt and decrypt messages with AES CBC mode.","archived":false,"fork":false,"pushed_at":"2020-05-26T04:17:54.000Z","size":3,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T08:34:05.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jacklinquan.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}},"created_at":"2020-05-26T04:17:46.000Z","updated_at":"2023-07-22T11:59:47.000Z","dependencies_parsed_at":"2022-09-06T02:21:58.138Z","dependency_job_id":null,"html_url":"https://github.com/jacklinquan/micropython-cryptomsg","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/jacklinquan%2Fmicropython-cryptomsg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklinquan%2Fmicropython-cryptomsg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklinquan%2Fmicropython-cryptomsg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklinquan%2Fmicropython-cryptomsg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacklinquan","download_url":"https://codeload.github.com/jacklinquan/micropython-cryptomsg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241989527,"owners_count":20053798,"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":[],"created_at":"2024-08-04T00:01:23.096Z","updated_at":"2025-03-05T07:34:27.813Z","avatar_url":"https://github.com/jacklinquan.png","language":"Python","readme":"# micropython-cryptomsg\n[![PyPI version](https://badge.fury.io/py/micropython-cryptomsg.svg)](https://badge.fury.io/py/micropython-cryptomsg) [![Downloads](https://pepy.tech/badge/micropython-cryptomsg)](https://pepy.tech/project/micropython-cryptomsg)\n\nA MicroPython module to encrypt and decrypt messages with AES CBC mode.\n\nThis module only works under MicroPython and it is tested with MicroPython V1.12.\n\nFor a compatible CPython version, please find [Python package cryptomsg](https://github.com/jacklinquan/cryptomsg).\n\nPlease consider [![Paypal Donate](https://github.com/jacklinquan/images/blob/master/paypal_donate_button_200x80.png)](https://www.paypal.me/jacklinquan) to support me.\n\n## Installation\n``` Python\n\u003e\u003e\u003e import upip\n\u003e\u003e\u003e upip.install('micropython-cryptomsg')\n```\nAlternatively just copy cryptomsg.py to the MicroPython device.\n\n## Usage\n``` Python\n\u003e\u003e\u003e from cryptomsg import CryptoMsg\n\u003e\u003e\u003e message = 'YOUR MESSAGE'\n\u003e\u003e\u003e # Use default key and iv, not secure.\n\u003e\u003e\u003e cipher = CryptoMsg().encrypt_msg(message)\n\u003e\u003e\u003e cipher\nb\"E\\xa8\\x02\\x08\\xa3+m\\xce'1\\xc2\\x1c\\xa3\\xeb\\x06\\x05\"\n\u003e\u003e\u003e CryptoMsg().decrypt_msg(cipher)\nb'YOUR MESSAGE'\n\u003e\u003e\u003e # Only set key, and iv is the same as key.\n\u003e\u003e\u003e cipher = CryptoMsg(b'YOUR KEY').encrypt_msg(message)\n\u003e\u003e\u003e cipher\nb'o\\x8e\\xa8\\x13\\xda )\\x10zS\\xfd\\xf5\\xae\\x90\\x95\\xfb'\n\u003e\u003e\u003e CryptoMsg(b'YOUR KEY').decrypt_msg(cipher)\nb'YOUR MESSAGE'\n\u003e\u003e\u003e # Set both key and iv, strongest encryption. \n\u003e\u003e\u003e cipher = CryptoMsg(b'YOUR KEY', b'YOUR IV').encrypt_msg(message)\n\u003e\u003e\u003e cipher\nb'\\xbflr\\xf6\\xae\\xc1\\xf9W\\xfc\\xcd\u0026\\xf3R\\xd3\\x8b\\xde'\n\u003e\u003e\u003e CryptoMsg(b'YOUR KEY', b'YOUR IV').decrypt_msg(cipher)\nb'YOUR MESSAGE'\n```\n","funding_links":["https://www.paypal.me/jacklinquan"],"categories":["Libraries"],"sub_categories":["Communications"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacklinquan%2Fmicropython-cryptomsg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacklinquan%2Fmicropython-cryptomsg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacklinquan%2Fmicropython-cryptomsg/lists"}