post-quantum-crypto-toolkit


Namepost-quantum-crypto-toolkit JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/G4G4N/post-quantum-crypto-toolkit
SummaryA Python toolkit for post-quantum cryptographic algorithms
upload_time2024-08-22 22:08:18
maintainerNone
docs_urlNone
authorGagan Yalamuri
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ```markdown
# pqct

**PQCT** is a Python toolkit for post-quantum cryptography, implementing lattice-based cryptographic algorithms inspired by Kyber and Dilithium. This toolkit provides a simple and accessible interface for performing encryption, decryption, digital signatures, and verification, suitable for exploring post-quantum cryptographic methods.

## Features

- **Public-key Encryption**: Lattice-based encryption scheme inspired by Kyber.
- **Digital Signatures**: Lattice-based signature scheme inspired by Dilithium.
- **Benchmarking**: Measure the performance of encryption, decryption, signing, and verification operations.
- **Unit Testing**: Ensure the correctness of cryptographic operations with built-in tests.

## Installation

You can install `pqct` using pip. To install from the Python Package Index (PyPI):

```bash
pip install pqct
```

To install directly from the GitHub repository:

```bash
pip install git+https://github.com/G4G4N/pqct.git
```

## Usage

### Importing the Toolkit

First, import the `PostQuantumCryptoToolkit` from the `pqct` package.

```python
from pqct import PostQuantumCryptoToolkit
```

### Encryption and Decryption

To use the Kyber-inspired encryption scheme:

```python
import numpy as np
from pqct import PostQuantumCryptoToolkit

# Initialize the toolkit
toolkit = PostQuantumCryptoToolkit()

# Define plaintext (e.g., a list of integers)
plaintext = np.random.randint(0, 3329, 256)

# Generate keypair
public_key, private_key = toolkit.supported_algorithms['kyber'].generate_keypair()

# Encrypt the plaintext
ciphertext = toolkit.encrypt('kyber', plaintext)

# Decrypt the ciphertext
decrypted_plaintext = toolkit.decrypt('kyber', ciphertext, private_key)

# Verify decryption correctness
assert np.array_equal(decrypted_plaintext, plaintext), "Decryption failed"
```

### Digital Signatures

To use the Dilithium-inspired digital signature scheme:

```python
from pqct import PostQuantumCryptoToolkit

# Initialize the toolkit
toolkit = PostQuantumCryptoToolkit()

# Define message (e.g., a byte string)
message = b"Test message"

# Generate keypair
public_key, private_key = toolkit.supported_algorithms['dilithium'].generate_keypair()

# Sign the message
signature = toolkit.sign('dilithium', message)

# Verify the signature
is_valid = toolkit.verify('dilithium', message, signature, public_key)

# Verify signature correctness
assert is_valid, "Signature verification failed"
```

## Running Tests

The `pqct` package includes unit tests to verify the functionality of the cryptographic algorithms. You can run these tests using Python's built-in unittest framework.

```bash
python -m unittest discover pqct/tests
```

## Benchmarks

The package includes a benchmarking script to measure the performance of the cryptographic operations. Run the benchmarks with:

```bash
python benchmarks.py
```

## Project Structure

Here's a brief overview of the project structure:

- `pqct/` – Core directory containing the implementation files.
  - `__init__.py` – Initializes the `pqct` package.
  - `algorithms.py` – Contains the implementation of Kyber and Dilithium algorithms.
  - `toolkit.py` – Provides the interface to the cryptographic algorithms.
  - `tests.py` – Includes unit tests for verifying algorithm functionality.
- `benchmarks.py` – Script for benchmarking the cryptographic operations.
- `requirements.txt` – Lists the dependencies required by the project.
- `setup.py` – Setup configuration for packaging and distribution.
- `README.md` – Documentation for the project.

## Contributing

Contributions to `pqct` are welcome! If you have any suggestions, bug reports, or would like to contribute code, please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or fix.
3. Make your changes and commit them with descriptive messages.
4. Push your branch to your forked repository.
5. Open a pull request describing your changes.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

For more information, please refer to the [documentation](https://github.com/yourusername/pqct) or contact the project maintainer.

```




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/G4G4N/post-quantum-crypto-toolkit",
    "name": "post-quantum-crypto-toolkit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Gagan Yalamuri",
    "author_email": "gagan.y@nyu.com",
    "download_url": "https://files.pythonhosted.org/packages/65/2b/6a61cb88a12d1745496966baa03c05782ef9e0b65c9f5e0daafc15874cb9/post-quantum-crypto-toolkit-0.1.0.tar.gz",
    "platform": null,
    "description": "```markdown\n# pqct\n\n**PQCT** is a Python toolkit for post-quantum cryptography, implementing lattice-based cryptographic algorithms inspired by Kyber and Dilithium. This toolkit provides a simple and accessible interface for performing encryption, decryption, digital signatures, and verification, suitable for exploring post-quantum cryptographic methods.\n\n## Features\n\n- **Public-key Encryption**: Lattice-based encryption scheme inspired by Kyber.\n- **Digital Signatures**: Lattice-based signature scheme inspired by Dilithium.\n- **Benchmarking**: Measure the performance of encryption, decryption, signing, and verification operations.\n- **Unit Testing**: Ensure the correctness of cryptographic operations with built-in tests.\n\n## Installation\n\nYou can install `pqct` using pip. To install from the Python Package Index (PyPI):\n\n```bash\npip install pqct\n```\n\nTo install directly from the GitHub repository:\n\n```bash\npip install git+https://github.com/G4G4N/pqct.git\n```\n\n## Usage\n\n### Importing the Toolkit\n\nFirst, import the `PostQuantumCryptoToolkit` from the `pqct` package.\n\n```python\nfrom pqct import PostQuantumCryptoToolkit\n```\n\n### Encryption and Decryption\n\nTo use the Kyber-inspired encryption scheme:\n\n```python\nimport numpy as np\nfrom pqct import PostQuantumCryptoToolkit\n\n# Initialize the toolkit\ntoolkit = PostQuantumCryptoToolkit()\n\n# Define plaintext (e.g., a list of integers)\nplaintext = np.random.randint(0, 3329, 256)\n\n# Generate keypair\npublic_key, private_key = toolkit.supported_algorithms['kyber'].generate_keypair()\n\n# Encrypt the plaintext\nciphertext = toolkit.encrypt('kyber', plaintext)\n\n# Decrypt the ciphertext\ndecrypted_plaintext = toolkit.decrypt('kyber', ciphertext, private_key)\n\n# Verify decryption correctness\nassert np.array_equal(decrypted_plaintext, plaintext), \"Decryption failed\"\n```\n\n### Digital Signatures\n\nTo use the Dilithium-inspired digital signature scheme:\n\n```python\nfrom pqct import PostQuantumCryptoToolkit\n\n# Initialize the toolkit\ntoolkit = PostQuantumCryptoToolkit()\n\n# Define message (e.g., a byte string)\nmessage = b\"Test message\"\n\n# Generate keypair\npublic_key, private_key = toolkit.supported_algorithms['dilithium'].generate_keypair()\n\n# Sign the message\nsignature = toolkit.sign('dilithium', message)\n\n# Verify the signature\nis_valid = toolkit.verify('dilithium', message, signature, public_key)\n\n# Verify signature correctness\nassert is_valid, \"Signature verification failed\"\n```\n\n## Running Tests\n\nThe `pqct` package includes unit tests to verify the functionality of the cryptographic algorithms. You can run these tests using Python's built-in unittest framework.\n\n```bash\npython -m unittest discover pqct/tests\n```\n\n## Benchmarks\n\nThe package includes a benchmarking script to measure the performance of the cryptographic operations. Run the benchmarks with:\n\n```bash\npython benchmarks.py\n```\n\n## Project Structure\n\nHere's a brief overview of the project structure:\n\n- `pqct/` \u2013 Core directory containing the implementation files.\n  - `__init__.py` \u2013 Initializes the `pqct` package.\n  - `algorithms.py` \u2013 Contains the implementation of Kyber and Dilithium algorithms.\n  - `toolkit.py` \u2013 Provides the interface to the cryptographic algorithms.\n  - `tests.py` \u2013 Includes unit tests for verifying algorithm functionality.\n- `benchmarks.py` \u2013 Script for benchmarking the cryptographic operations.\n- `requirements.txt` \u2013 Lists the dependencies required by the project.\n- `setup.py` \u2013 Setup configuration for packaging and distribution.\n- `README.md` \u2013 Documentation for the project.\n\n## Contributing\n\nContributions to `pqct` are welcome! If you have any suggestions, bug reports, or would like to contribute code, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch for your feature or fix.\n3. Make your changes and commit them with descriptive messages.\n4. Push your branch to your forked repository.\n5. Open a pull request describing your changes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\nFor more information, please refer to the [documentation](https://github.com/yourusername/pqct) or contact the project maintainer.\n\n```\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python toolkit for post-quantum cryptographic algorithms",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/G4G4N/post-quantum-crypto-toolkit"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef0849c38ba074a933937e2bcfbf3c7c417490bb4bc803fde8e3a7b8f4a5c9f4",
                "md5": "2f9c7407fb7efa0134d16213a9f8a4cb",
                "sha256": "afc16db93d36b1b7bf9e05c6abc75b22f00a48ddd728055e310adfb7d25aa837"
            },
            "downloads": -1,
            "filename": "post_quantum_crypto_toolkit-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f9c7407fb7efa0134d16213a9f8a4cb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5818,
            "upload_time": "2024-08-22T22:08:16",
            "upload_time_iso_8601": "2024-08-22T22:08:16.673039Z",
            "url": "https://files.pythonhosted.org/packages/ef/08/49c38ba074a933937e2bcfbf3c7c417490bb4bc803fde8e3a7b8f4a5c9f4/post_quantum_crypto_toolkit-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "652b6a61cb88a12d1745496966baa03c05782ef9e0b65c9f5e0daafc15874cb9",
                "md5": "ff1367cbc4397e7ee60c054d00910a08",
                "sha256": "6d6aba5b34f80229172cf50bb13dc960bdb73b5b7cd1463d384efbd20fc98bcf"
            },
            "downloads": -1,
            "filename": "post-quantum-crypto-toolkit-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ff1367cbc4397e7ee60c054d00910a08",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4815,
            "upload_time": "2024-08-22T22:08:18",
            "upload_time_iso_8601": "2024-08-22T22:08:18.195055Z",
            "url": "https://files.pythonhosted.org/packages/65/2b/6a61cb88a12d1745496966baa03c05782ef9e0b65c9f5e0daafc15874cb9/post-quantum-crypto-toolkit-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 22:08:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "G4G4N",
    "github_project": "post-quantum-crypto-toolkit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "post-quantum-crypto-toolkit"
}
        
Elapsed time: 0.57114s