# `xor-cipher`
[![License][License Badge]][License]
[![Version][Version Badge]][Package]
[![Downloads][Downloads Badge]][Package]
[![Documentation][Documentation Badge]][Documentation]
[![Check][Check Badge]][Actions]
[![Test][Test Badge]][Actions]
[![Coverage][Coverage Badge]][Coverage]
> *Simple, reusable and optimized XOR ciphers in Python.*
`xor-cipher` is a fast implementation of the XOR cipher written using Rust.
Our tests show that it can be `1000x` faster than pure Python implementations.
It has been optimized to breeze through datasets of any size.
## Installing
**Python 3.8 or above is required.**
### `pip`
Installing the library with `pip` is quite simple:
```console
$ pip install xor-cipher
```
Alternatively, the library can be installed from source:
```console
$ pip install git+https://github.com/xor-cipher/xor-cipher.git
```
Or via cloning the repository:
```console
$ git clone https://github.com/xor-cipher/xor-cipher.git
$ cd xor-cipher
$ pip install .
```
### `poetry`
You can add `xor-cipher` as a dependency with the following command:
```console
$ poetry add xor-cipher
```
Or by directly specifying it in the configuration like so:
```toml
[tool.poetry.dependencies]
xor-cipher = "^5.0.0"
```
Alternatively, you can add it directly from the source:
```toml
[tool.poetry.dependencies.xor-cipher]
git = "https://github.com/xor-cipher/xor-cipher.git"
```
## Examples
### Simple Cipher
Use the `xor` function to perform the simple XOR cipher:
```python
>>> from xor_cipher import xor
>>> xor(b"Hello, world!", 0x42)
b"\n'..-nb5-0.&c"
```
### Cyclic Cipher
Use the `cyclic_xor` function to perform the cyclic XOR variation:
```python
>>> from xor_cipher import cyclic_xor
>>> cyclic_xor(b"Hello, world!", b"BLOB")
b"\n)#.-`o5->#&c"
```
### In-Place Cipher
There are functions to perform the XOR cipher in-place, on `bytearray` instances:
```python
>>> from xor_cipher import xor_in_place
>>> data = bytearray(b"Hello, world!")
>>> xor_in_place(data, 0x42)
>>> data
bytearray(b"\n'..-nb5-0.&c")
```
## Documentation
You can find the documentation [here][Documentation].
## Support
If you need support with the library, you can send an [email][Email].
## Changelog
You can find the changelog [here][Changelog].
## Security Policy
You can find the Security Policy of `xor-cipher` [here][Security].
## Contributing
If you are interested in contributing to `xor-cipher`, make sure to take a look at the
[Contributing Guide][Contributing Guide], as well as the [Code of Conduct][Code of Conduct].
## License
`xor-cipher` is licensed under the MIT License terms. See [License][License] for details.
[Email]: mailto:support@xor-cipher.org
[Actions]: https://github.com/xor-cipher/xor-cipher/actions
[Changelog]: https://github.com/xor-cipher/xor-cipher/blob/main/CHANGELOG.md
[Code of Conduct]: https://github.com/xor-cipher/xor-cipher/blob/main/CODE_OF_CONDUCT.md
[Contributing Guide]: https://github.com/xor-cipher/xor-cipher/blob/main/CONTRIBUTING.md
[Security]: https://github.com/xor-cipher/xor-cipher/blob/main/SECURITY.md
[License]: https://github.com/xor-cipher/xor-cipher/blob/main/LICENSE
[Package]: https://pypi.org/project/xor-cipher
[Coverage]: https://codecov.io/gh/xor-cipher/xor-cipher
[Documentation]: https://docs.xor-cipher.org/
[License Badge]: https://img.shields.io/pypi/l/xor-cipher
[Version Badge]: https://img.shields.io/pypi/v/xor-cipher
[Downloads Badge]: https://img.shields.io/pypi/dm/xor-cipher
[Documentation Badge]: https://github.com/xor-cipher/xor-cipher/workflows/docs/badge.svg
[Check Badge]: https://github.com/xor-cipher/xor-cipher/workflows/check/badge.svg
[Test Badge]: https://github.com/xor-cipher/xor-cipher/workflows/test/badge.svg
[Coverage Badge]: https://codecov.io/gh/xor-cipher/xor-cipher/branch/main/graph/badge.svg
Raw data
{
"_id": null,
"home_page": "https://xor-cipher.org/",
"name": "xor-cipher",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "python, xor, cipher",
"author": "nekitdev",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/bd/ad/58689707dd8e7eb44c1280670fd7923894206f0b6df0672f6163a401a92e/xor_cipher-5.0.0.tar.gz",
"platform": null,
"description": "# `xor-cipher`\n\n[![License][License Badge]][License]\n[![Version][Version Badge]][Package]\n[![Downloads][Downloads Badge]][Package]\n\n[![Documentation][Documentation Badge]][Documentation]\n[![Check][Check Badge]][Actions]\n[![Test][Test Badge]][Actions]\n[![Coverage][Coverage Badge]][Coverage]\n\n> *Simple, reusable and optimized XOR ciphers in Python.*\n\n`xor-cipher` is a fast implementation of the XOR cipher written using Rust.\nOur tests show that it can be `1000x` faster than pure Python implementations.\nIt has been optimized to breeze through datasets of any size.\n\n## Installing\n\n**Python 3.8 or above is required.**\n\n### `pip`\n\nInstalling the library with `pip` is quite simple:\n\n```console\n$ pip install xor-cipher\n```\n\nAlternatively, the library can be installed from source:\n\n```console\n$ pip install git+https://github.com/xor-cipher/xor-cipher.git\n```\n\nOr via cloning the repository:\n\n```console\n$ git clone https://github.com/xor-cipher/xor-cipher.git\n$ cd xor-cipher\n$ pip install .\n```\n\n### `poetry`\n\nYou can add `xor-cipher` as a dependency with the following command:\n\n```console\n$ poetry add xor-cipher\n```\n\nOr by directly specifying it in the configuration like so:\n\n```toml\n[tool.poetry.dependencies]\nxor-cipher = \"^5.0.0\"\n```\n\nAlternatively, you can add it directly from the source:\n\n```toml\n[tool.poetry.dependencies.xor-cipher]\ngit = \"https://github.com/xor-cipher/xor-cipher.git\"\n```\n\n## Examples\n\n### Simple Cipher\n\nUse the `xor` function to perform the simple XOR cipher:\n\n```python\n>>> from xor_cipher import xor\n>>> xor(b\"Hello, world!\", 0x42)\nb\"\\n'..-nb5-0.&c\"\n```\n\n### Cyclic Cipher\n\nUse the `cyclic_xor` function to perform the cyclic XOR variation:\n\n```python\n>>> from xor_cipher import cyclic_xor\n>>> cyclic_xor(b\"Hello, world!\", b\"BLOB\")\nb\"\\n)#.-`o5->#&c\"\n```\n\n### In-Place Cipher\n\nThere are functions to perform the XOR cipher in-place, on `bytearray` instances:\n\n```python\n>>> from xor_cipher import xor_in_place\n>>> data = bytearray(b\"Hello, world!\")\n>>> xor_in_place(data, 0x42)\n>>> data\nbytearray(b\"\\n'..-nb5-0.&c\")\n```\n\n## Documentation\n\nYou can find the documentation [here][Documentation].\n\n## Support\n\nIf you need support with the library, you can send an [email][Email].\n\n## Changelog\n\nYou can find the changelog [here][Changelog].\n\n## Security Policy\n\nYou can find the Security Policy of `xor-cipher` [here][Security].\n\n## Contributing\n\nIf you are interested in contributing to `xor-cipher`, make sure to take a look at the\n[Contributing Guide][Contributing Guide], as well as the [Code of Conduct][Code of Conduct].\n\n## License\n\n`xor-cipher` is licensed under the MIT License terms. See [License][License] for details.\n\n[Email]: mailto:support@xor-cipher.org\n\n[Actions]: https://github.com/xor-cipher/xor-cipher/actions\n\n[Changelog]: https://github.com/xor-cipher/xor-cipher/blob/main/CHANGELOG.md\n[Code of Conduct]: https://github.com/xor-cipher/xor-cipher/blob/main/CODE_OF_CONDUCT.md\n[Contributing Guide]: https://github.com/xor-cipher/xor-cipher/blob/main/CONTRIBUTING.md\n[Security]: https://github.com/xor-cipher/xor-cipher/blob/main/SECURITY.md\n\n[License]: https://github.com/xor-cipher/xor-cipher/blob/main/LICENSE\n\n[Package]: https://pypi.org/project/xor-cipher\n[Coverage]: https://codecov.io/gh/xor-cipher/xor-cipher\n[Documentation]: https://docs.xor-cipher.org/\n\n[License Badge]: https://img.shields.io/pypi/l/xor-cipher\n[Version Badge]: https://img.shields.io/pypi/v/xor-cipher\n[Downloads Badge]: https://img.shields.io/pypi/dm/xor-cipher\n\n[Documentation Badge]: https://github.com/xor-cipher/xor-cipher/workflows/docs/badge.svg\n[Check Badge]: https://github.com/xor-cipher/xor-cipher/workflows/check/badge.svg\n[Test Badge]: https://github.com/xor-cipher/xor-cipher/workflows/test/badge.svg\n[Coverage Badge]: https://codecov.io/gh/xor-cipher/xor-cipher/branch/main/graph/badge.svg\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple, reusable and optimized XOR ciphers in Python.",
"version": "5.0.0",
"project_urls": {
"Documentation": "https://docs.xor-cipher.org/",
"Homepage": "https://xor-cipher.org/",
"Issues": "https://github.com/xor-cipher/xor-cipher/issues",
"Repository": "https://github.com/xor-cipher/xor-cipher"
},
"split_keywords": [
"python",
" xor",
" cipher"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3346c1f24b9a353389eeb6633b5f9b90e503b33ad00846709922abeb3a911280",
"md5": "c49a5b08c0720a0eca5c407f76fc9304",
"sha256": "6dd140aae00bd564c98542e27ae7c3289e082b87c77a8ec9fb406b4b54a0a060"
},
"downloads": -1,
"filename": "xor_cipher-5.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c49a5b08c0720a0eca5c407f76fc9304",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5390,
"upload_time": "2024-06-26T08:52:27",
"upload_time_iso_8601": "2024-06-26T08:52:27.130564Z",
"url": "https://files.pythonhosted.org/packages/33/46/c1f24b9a353389eeb6633b5f9b90e503b33ad00846709922abeb3a911280/xor_cipher-5.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bdad58689707dd8e7eb44c1280670fd7923894206f0b6df0672f6163a401a92e",
"md5": "d22a7a5b977624b305f7882875f00204",
"sha256": "134aecd1d1d5074a5f4169f4caad402198116340e40c0ddf25026e281c9fa6d6"
},
"downloads": -1,
"filename": "xor_cipher-5.0.0.tar.gz",
"has_sig": false,
"md5_digest": "d22a7a5b977624b305f7882875f00204",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4597,
"upload_time": "2024-06-26T08:52:28",
"upload_time_iso_8601": "2024-06-26T08:52:28.512503Z",
"url": "https://files.pythonhosted.org/packages/bd/ad/58689707dd8e7eb44c1280670fd7923894206f0b6df0672f6163a401a92e/xor_cipher-5.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-26 08:52:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xor-cipher",
"github_project": "xor-cipher",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xor-cipher"
}