
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
xor-cipher
Advanced tools
xor-cipherSimple, 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.
Python 3.9 or above is required.
pipInstalling the library with pip is quite simple:
$ pip install xor-cipher
Alternatively, the library can be installed from source:
$ pip install git+https://github.com/GDPSApp/xor-cipher-python.git
Or via cloning the repository:
$ git clone https://github.com/GDPSApp/xor-cipher-python.git
$ cd xor-cipher-python
$ pip install .
uvYou can add xor-cipher as a dependency with the following command:
$ uv add xor-cipher
Use the xor function to perform the simple XOR cipher:
>>> from xor_cipher import xor
>>> xor(b"Hello, world!", 0x42)
b"\n'..-nb5-0.&c"
Use the cyclic_xor function to perform the cyclic XOR variation:
>>> from xor_cipher import cyclic_xor
>>> cyclic_xor(b"Hello, world!", b"BLOB")
b"\n)#.-`o5->#&c"
There are functions to perform the XOR cipher in-place, on bytearray instances:
>>> from xor_cipher import xor_in_place
>>> data = bytearray(b"Hello, world!")
>>> xor_in_place(data, 0x42)
>>> data
bytearray(b"\n'..-nb5-0.&c")
You can find the documentation here.
If you need support with the library, you can send an email.
You can find the changelog here.
You can find the Security Policy of xor-cipher here.
If you are interested in contributing to xor-cipher, make sure to take a look at the
Contributing Guide, as well as the Code of Conduct.
xor-cipher is licensed under the MIT License terms. See License for details.
FAQs
Simple, reusable and optimized XOR ciphers in Python.
We found that xor-cipher demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.