{"id":17717277,"url":"https://github.com/bwesterb/py-seccure","last_synced_at":"2025-08-20T14:31:58.059Z","repository":{"id":7957757,"uuid":"9354616","full_name":"bwesterb/py-seccure","owner":"bwesterb","description":"SECCURE compatible Elliptic Curve cryptography in Python","archived":false,"fork":false,"pushed_at":"2020-02-04T19:17:41.000Z","size":134,"stargazers_count":93,"open_issues_count":0,"forks_count":25,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-09-14T21:24:35.910Z","etag":null,"topics":["cryptography","ecc","python","seccure"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bwesterb.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","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":"2013-04-10T19:55:17.000Z","updated_at":"2024-08-12T15:30:25.000Z","dependencies_parsed_at":"2022-09-13T13:50:34.543Z","dependency_job_id":null,"html_url":"https://github.com/bwesterb/py-seccure","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fpy-seccure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fpy-seccure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fpy-seccure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fpy-seccure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwesterb","download_url":"https://codeload.github.com/bwesterb/py-seccure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230056283,"owners_count":18165900,"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","ecc","python","seccure"],"created_at":"2024-10-25T14:19:39.340Z","updated_at":"2024-12-19T12:10:33.824Z","avatar_url":"https://github.com/bwesterb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"py-seccure\n==========\n\nSimple Elliptic Curve Cryptography for Python compatible with the\nexcellent `SECCURE`_ command\nline utility (version 0.5). It's licensed under LGPLv3. See LICENSE.\n\n**Do not use ``py-seccure`` when its operation can be timed by an\nattacker.** See `timing attack`_.\n\nUsage\n-----\n\nPublic key from private\n~~~~~~~~~~~~~~~~~~~~~~~\n\nTo get the public key from the private, you can use the original\ncommandline utility:\n\n::\n\n    $ seccure-key\n    Assuming curve p160.\n    Enter private key: my private key\n    The public key is: 8W;\u003ei^H0qi|J\u0026$coR5MFpR*Vn\n\nIn Python:\n\n.. code:: python\n\n    \u003e\u003e\u003e import seccure\n    \u003e\u003e\u003e str(seccure.passphrase_to_pubkey(b'my private key'))\n    '8W;\u003ei^H0qi|J\u0026$coR5MFpR*Vn'\n\nEncrypting a string\n~~~~~~~~~~~~~~~~~~~\n\nTo encrypt for a public key, one would use the original commandline\nutility as follows.\n\n::\n\n    $ seccure-encrypt -o private.msg '8W;\u003ei^H0qi|J\u0026$coR5MFpR*Vn'  \n    Assuming MAC length of 80 bits.\n    Go ahead and type your message ...\n    This is a very very secret message!\n    ^D\n\nIn Python:\n\n.. code:: python\n\n    \u003e\u003e\u003e ciphertext = seccure.encrypt(b'This is a very secret message\\n', b'8W;\u003ei^H0qi|J\u0026$coR5MFpR*Vn')\n    \u003e\u003e\u003e ciphertext\n    '\\x00\\x146\\x17\\xe9\\xc1\\x1a\\x7fkX\\xec\\xa0n,h\\xb4\\xd0\\x98\\xeaO[\\xf8\\xfa\\x85\\xaa\\xb37!\\xf0j\\x0e\\xd4\\xd0\\x8b\\xfe}\\x8a\\xd2+\\xf2\\xceu\\x07\\x90K2E\\x12\\x1d\\xf1\\xd8\\x8f\\xc6\\x91\\t\u003cw\\x99\\x1b9\\x98'\n\nThere is a shorthand to encrypt a file:\n\n.. code:: python\n\n    \u003e\u003e\u003e seccure.encrypt_file('/path/to/file',  '/path/to/file.enc', '8W;\u003ei^H0qi|J\u0026$coR5MFpR*Vn')\n\nDecrypting\n~~~~~~~~~~\n\nTo decrypt the message with the original utility:\n\n::\n\n    $ seccure-decrypt -i private.msg\n    Assuming MAC length of 80 bits.\n    Assuming curve p160.\n    Enter private key: my private key\n    This is a very very secret message!\n    Integrity check successful, message unforged!\n\nIn Python:\n\n.. code:: python\n\n    \u003e\u003e\u003e seccure.decrypt(ciphertext, b'my private key')\n    'This is a very secret message\\n'\n\nAnd to decrypt a file:\n\n.. code:: python\n\n    \u003e\u003e\u003e seccure.decrypt_file('/path/to/file.enc',  '/path/to/file', b'my private key')\n\nCreating a signature\n~~~~~~~~~~~~~~~~~~~~\n\nTo create a signature:\n\n::\n\n    $ seccure-sign\n    Assuming curve p160.\n    Enter private key: my private key\n    Go ahead and type your message ...\n    This message will be signed\n    ^D\n    Signature: $HPI?t(I*1vAYsl$|%21WXND=6Br*[\u003ek(OR9B!GOwHqL0s+3Uq\n\nIn Python:\n\n.. code:: python\n\n    \u003e\u003e\u003e seccure.sign(b'This message will be signed\\n', b'my private key')\n    '$HPI?t(I*1vAYsl$|%21WXND=6Br*[\u003ek(OR9B!GOwHqL0s+3Uq'\n\nVerifying a signature\n~~~~~~~~~~~~~~~~~~~~~\n\nTo verify a signature:\n\n::\n\n    $ seccure-verify '8W;\u003ei^H0qi|J\u0026$coR5MFpR*Vn' '$HPI?t(I*1vAYsl$|%21WXND=6Br*[\u003ek(OR9B!GOwHqL0s+3Uq'  \n    Go ahead and type your message ...\n    This message will be signed\n    ^D\n    Signature successfully verified!\n\nIn Python:\n\n.. code:: python\n\n    \u003e\u003e\u003e seccure.verify(b'This message will be signed\\n', b'$HPI?t(I*1vAYsl$|%21WXND=6Br*[\u003ek(OR9B!GOwHqL0s+3Uq', b'8W;\u003ei^H0qi|J\u0026$coR5MFpR*Vn')\n    True\n\nInstallation\n------------\n\nOn Debian Wheezy\n~~~~~~~~~~~~~~~~\n\n::\n\n    $ apt-get install libgmp3-dev build-essential python-dev python-pip libmpfr-dev libmpc-dev\n    $ pip install seccure\n\nOn Ubuntu\n~~~~~~~~~\n\n::\n\n    $ apt-get install libgmp-dev build-essential python-dev python-pip libmpfr-dev libmpc-dev\n    $ pip install seccure\n\nOn Mac with MacPorts\n~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    $ port install py27-gmpy2\n    $ pip install seccure\n\nPlease contribute!\n------------------\n\nTo help out, you could:\n\n1. Test and report any bugs or other difficulties.\n2. Implement missing features, such as ``seccure-dh``,\n   ``seccure-veridec`` and ``seccure-signcrypt``.\n3. Package py-seccure (or the original SECCURE itself) for your\n   platform.\n4. Write more unit tests.\n\n.. image:: https://travis-ci.org/bwesterb/py-seccure.png\n   :target: https://travis-ci.org/py-seccure/py-seccure\n\n.. _SECCURE: http://point-at-infinity.org/seccure/\n.. _timing attack: http://en.wikipedia.org/wiki/Timing_attack\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwesterb%2Fpy-seccure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwesterb%2Fpy-seccure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwesterb%2Fpy-seccure/lists"}