{"id":19198476,"url":"https://github.com/virgilsecurity/virgil-crypto-python","last_synced_at":"2025-05-09T01:18:41.145Z","repository":{"id":90250374,"uuid":"72107292","full_name":"VirgilSecurity/virgil-crypto-python","owner":"VirgilSecurity","description":"Virgil Python Crypto Library is a high-level cryptographic library that allows you to perform all necessary operations for secure storing and transferring data and everything required to become HIPAA and GDPR compliant.","archived":false,"fork":false,"pushed_at":"2020-05-08T10:56:07.000Z","size":6962,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-20T10:41:43.274Z","etag":null,"topics":["crypto","cryptography","e2ee","encryption","end-to-end-encryption","gdpr","hipaa"],"latest_commit_sha":null,"homepage":"https://developer.virgilsecurity.com/docs/how-to#cryptography","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VirgilSecurity.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":"2016-10-27T12:44:47.000Z","updated_at":"2023-10-02T18:31:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"2501058a-35d5-49bc-8173-8ea159e65be8","html_url":"https://github.com/VirgilSecurity/virgil-crypto-python","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-crypto-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-crypto-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-crypto-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-crypto-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VirgilSecurity","download_url":"https://codeload.github.com/VirgilSecurity/virgil-crypto-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171379,"owners_count":21865317,"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":["crypto","cryptography","e2ee","encryption","end-to-end-encryption","gdpr","hipaa"],"created_at":"2024-11-09T12:22:13.622Z","updated_at":"2025-05-09T01:18:41.123Z","avatar_url":"https://github.com/VirgilSecurity.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virgil Crypto Library Python\n\n[![Travis (.com)](https://img.shields.io/travis/com/VirgilSecurity/virgil-crypto-python/master.svg)](https://travis-ci.com/VirgilSecurity/virgil-crypto-python) [![PyPI](https://img.shields.io/pypi/v/virgil-crypto.svg)](https://pypi.python.org/pypi/virgil-crypto) [![PyPI](https://img.shields.io/pypi/wheel/virgil-crypto.svg)](https://pypi.python.org/pypi/virgil-crypto) [![PyPI](https://img.shields.io/pypi/pyversions/virgil-crypto.svg)](https://pypi.python.org/pypi/virgil-crypto)\n\n[Introduction](#introduction) | [Library purposes](#library-purposes) | [Installation](#installation) | [Usage examples](#usage-examples) | [Docs](#docs) | [License](#license) | [Contacts](#support)\n\n## Introduction\n\nVirgil Crypto Library Python is a wrapper over [Virgil Crypto Library C](https://github.com/VirgilSecurity/virgil-crypto-c). It provides a bunch of custom hybrid algorithms that combine different crypto algorithms to solve common complex cryptographic problems in an easy way. That eliminates the requirement for developers to have strong cryptographic skills in order to add a security layer to their applications.\n\n## Library purposes\n* Asymmetric Key Generation\n* Encryption/Decryption of data and streams\n* Generation/Verification of digital signatures\n* Double Ratchet algorithm support\n* **Post-quantum algorithms support**: [Round5](https://round5.org/) (encryption) and [Falcon](https://falcon-sign.info/) (signature) \n* Crypto for using [Virgil Core SDK](https://github.com/VirgilSecurity/virgil-sdk-python)\n\n## Installation\n\n### Installing prerequisites\n\nInstall latest pip distribution: download [get-pip.py](https://bootstrap.pypa.io/get-pip.py) and run it using the python interpreter.\n\n### Installing from wheel binary packages\n\nWe provide binary packages for all the supported platforms.\nUse pip to install the wheel binary packages:\n\n```bash\npip install virgil-crypto\n```\n\n## Usage examples\n\n### Generate a key pair\n\nGenerate a private key using the default algorithm (EC_X25519):\n\n```python\nfrom virgil_crypto import VirgilCrypto\n\ncrypto = VirgilCrypto()\nkey_pair = crypto.generate_key_pair()\n```\n\n### Generate and verify a signature\n\nGenerate signature and sign data with a private key:\n\n```python\nfrom virgil_crypto import VirgilCrypto\n\ncrypto = VirgilCrypto()\nkey_pair = crypto.generate_key_pair()\nsender_private_key = key_pair.private_key\n\nmessage_to_sign = \"Hello, Bob!\"\ndata_to_sign = message_to_sign.encode()\n\nsignature = crypto.generate_signature(data_to_sign, sender_private_key)\n```\n\nVerify a signature with a public key:\n\n```python\nfrom virgil_crypto import VirgilCrypto\n\ncrypto = VirgilCrypto()\n\nverified = crypto.verify_signature(data_to_sign, signature, sender_public_key)\n```\n\n### Encrypt and decrypt data\n\nEncrypt data with a public key:\n\n```python\nfrom virgil_crypto import VirgilCrypto\n\ncrypto = VirgilCrypto()\n\nmessage_to_encrypt = \"Hello, Bob!\"\ndata_to_encrypt = message_to_encrypt.encode()\n\nreciver_list = [reciver_public_key]\nencrypted_data = crypto.encrypt(data_to_encrypt, *reciver_list)\n```\n\nDecrypt the encrypted data with a private key:\n\n```python\nfrom virgil_crypto import VirgilCrypto\n\ncrypto = VirgilCrypto()\n\ndecrypted_data = crypto.decrypt(encrypted_data, reciver_private_key)\ndecrypted_message = bytes(decrypted_data).decode()\n```\n\n### Import and export keys\n\nExport keys:\n\n```\ncrypto = VirgilCrypto()\n\n# generate a Key Pair\nkey_pair = crypto.generate_keys()\n\n# export a Private key\nprivate_key_data = crypto.export_private_key(key_pair.private_key, \"[YOUR_PASSWORD]\")\nbase64.b64encode(private_key_data)\n\n# export a Public key\npublic_key_data = crypto.export_public_key(key_pair.public_key, \"[YOUR_PASSWORD]\")\nbase64.b64encode(public_key_data)\n```\n\nImport keys:\n\n```\ncrypto = VirgilCrypto()\nprivate_key_str = \"MIGhMF0GCSqGSIb3DQEFDTBQMC8GCSqGSIb3DQEFDDAiBBBtfBoM7VfmWPlvyHuGWvMSAgIZ6zAKBggqhkiG9w0CCjAdBglghkgBZQMEASoEECwaKJKWFNn3OMVoUXEcmqcEQMZ+WWkmPqzwzJXGFrgS/+bEbr2DvreVgEUiLKrggmXL9ZKugPKG0VhNY0omnCNXDzkXi5dCFp25RLqbbSYsCyw=\"\nprivate_key_data = base64.b64decode(private_key_str)\n\n# import a Private key\ncrypto.import_private_key(private_key_data, \"[YOUR_PASSWORD]\")\n\n//-----------------------------------------------------\n\ncrypto = VirgilCrypto()\npublic_key_str = \"MCowBQYDK2VwAyEA9IVUzsQENtRVzhzraTiEZZy7YLq5LDQOXGQG/q0t0kE=\"\npublic_key_data = base64.b64decode(public_key_str)\n\n# import a Public key\ncrypto.import_public_key(public_key_data)\n```\n\n## Docs\n- [API Reference](http://virgilsecurity.github.io/virgil-crypto-python/)\n- [Crypto Core Library](https://github.com/VirgilSecurity/virgil-crypto)\n- [Developer Documentation](https://developer.virgilsecurity.com/docs/)\n\n## License\nThis library is released under the [3-clause BSD License](LICENSE).\n\n## Support\nOur developer support team is here to help you. Find out more information on our [Help Center](https://help.virgilsecurity.com/).\n\nYou can find us on [Twitter](https://twitter.com/VirgilSecurity) or send us email support@VirgilSecurity.com.\n\nAlso, get extra help from our support team on [Slack](https://virgilsecurity.com/join-community).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirgilsecurity%2Fvirgil-crypto-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirgilsecurity%2Fvirgil-crypto-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirgilsecurity%2Fvirgil-crypto-python/lists"}