{ "info": { "author": "Christophe VG", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.7", "Topic :: Software Development" ], "description": "# Simple RSA\n\n> A straightforward API to perform basic RSA-based operations.\n\n[![Latest Version on PyPI](https://img.shields.io/pypi/v/simple-rsa.svg)](https://pypi.python.org/pypi/simple-rsa/)\n[![Supported Implementations](https://img.shields.io/pypi/pyversions/simple-rsa.svg)](https://pypi.python.org/pypi/simple-rsa/)\n[![Build Status](https://secure.travis-ci.org/christophevg/py-simple-rsa.svg?branch=master)](http://travis-ci.org/christophevg/py-simple-rsa)\n[![Coverage Status](https://coveralls.io/repos/github/christophevg/py-simple-rsa/badge.svg?branch=master)](https://coveralls.io/github/christophevg/py-simple-rsa?branch=master)\n[![Built with PyPi Template](https://img.shields.io/badge/PyPi_Template-v0.0.6-blue.svg)](https://github.com/christophevg/pypi-template)\n\n## Rationale\n\nAny cryptographic library exposes all possibilities, and it should. But sometimes you just want a simple `sign` and `validate` API. That is what this wrapper module around the Cryptography module is. Nothing more, nothing less.\n\n## Getting Started\n\nThe module basically exposes the following functions:\n\n- `generate_key_pair()` returning a tuple of private and public keys\n- `encode(key)` returning an encoded key\n- `decode(pem)` returning a key\n- `sign(payload, key)` returning a signature\n- `validate(payload, signature, key)` returning True or an Exception\n\n```bash\n$ python\nPython 2.7.15 (default, Dec 27 2018, 11:55:59) \n[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import simple_rsa as rsa\n>>> private, public = rsa.generate_key_pair()\n>>> rsa.encode(public)\n'-----BEGIN PUBLIC KEY-----\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5C15SFjpTCrdqB+0zFyu\\nC9KJkNT1byzQPyATtLze/PNWjfqYL0RjvL4cmvmBWLeTQvnDx9SQfnQT02+4Q8Ov\\nOaRTPqghEJctAh7KHwZfQzH29miC1WxXtGFcMFoAj17WPyMaOO3EcHqb4ttnAAPD\\nt6B415HtGZo4oH6xY7QMj4eRceTv4++zACNHvqArO3bFFiNTBC8vCOpIg3xsYV4w\\n7lQZs2lwGlzXPFJUeZglvsWTPJ54E1KabtkC/wSRFZBYtml8ZvzFfNDTOhcDyBR9\\nVTV4K7iIGXG0A9C7mmj3hgALS3qSP5EK6fi51ufg98WokCLFcTSD/EphUlixazPo\\nOQIDAQAB\\n-----END PUBLIC KEY-----\\n'\n>>> payload = b\"something important\"\n>>> signature = rsa.sign(payload, private)\n>>> assert rsa.validate(payload, signature, public)\n>>> another_payload = b\"something else\"\n>>> another_signature = rsa.sign(another_payload, private)\n>>> assert rsa.validate(payload, another_signature, public)\nTraceback (most recent call last):\n File \"\", line 1, in \n File \"simple_rsa/__init__.py\", line 74, in validate\n hashes.SHA256()\n File \"/usr/local/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/rsa.py\", line 477, in verify\n self._backend, padding, algorithm, self, signature, data\n File \"/usr/local/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/rsa.py\", line 272, in _rsa_sig_verify\n raise InvalidSignature\ncryptography.exceptions.InvalidSignature\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/christophevg/py-simple-rsa", "keywords": "RSA signing", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "simple-rsa", "package_url": "https://pypi.org/project/simple-rsa/", "platform": "", "project_url": "https://pypi.org/project/simple-rsa/", "project_urls": { "Homepage": "https://github.com/christophevg/py-simple-rsa" }, "release_url": "https://pypi.org/project/simple-rsa/1.0.0/", "requires_dist": [ "cryptography" ], "requires_python": "", "summary": "A straightforward API to perform basic RSA-based operations..", "version": "1.0.0" }, "last_serial": 4956036, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "91cf48dd1f856294c531fd47aa402a57", "sha256": "27b9c8de5fc2308f3f48ee61f28a132ae5d4e56cfddb78cb383293ccf5d7d7d9" }, "downloads": -1, "filename": "simple_rsa-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "91cf48dd1f856294c531fd47aa402a57", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4392, "upload_time": "2019-03-18T21:49:14", "url": "https://files.pythonhosted.org/packages/a9/95/7070c9b0bd69cb5242b0e7a8c535b89eb8b0801b60474bb9130981143a23/simple_rsa-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e4ff061ae69f89087006d8410b6ad724", "sha256": "ffb04e82a30bedbd2da262beec2d8e0de3ad72f71af50ae46bdb650b01403eb8" }, "downloads": -1, "filename": "simple-rsa-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e4ff061ae69f89087006d8410b6ad724", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4106, "upload_time": "2019-03-18T21:49:16", "url": "https://files.pythonhosted.org/packages/65/a9/1cb1d582fa98727450316160bc7812a0d8b47562b27fdf90a925cc7f0651/simple-rsa-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "91cf48dd1f856294c531fd47aa402a57", "sha256": "27b9c8de5fc2308f3f48ee61f28a132ae5d4e56cfddb78cb383293ccf5d7d7d9" }, "downloads": -1, "filename": "simple_rsa-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "91cf48dd1f856294c531fd47aa402a57", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4392, "upload_time": "2019-03-18T21:49:14", "url": "https://files.pythonhosted.org/packages/a9/95/7070c9b0bd69cb5242b0e7a8c535b89eb8b0801b60474bb9130981143a23/simple_rsa-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e4ff061ae69f89087006d8410b6ad724", "sha256": "ffb04e82a30bedbd2da262beec2d8e0de3ad72f71af50ae46bdb650b01403eb8" }, "downloads": -1, "filename": "simple-rsa-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e4ff061ae69f89087006d8410b6ad724", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4106, "upload_time": "2019-03-18T21:49:16", "url": "https://files.pythonhosted.org/packages/65/a9/1cb1d582fa98727450316160bc7812a0d8b47562b27fdf90a925cc7f0651/simple-rsa-1.0.0.tar.gz" } ] }