New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xor-cipher

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xor-cipher

Simple, reusable and optimized XOR ciphers in Python.

  • 5.0.1
  • PyPI
  • Socket score

Maintainers
2

xor-cipher

License Version Downloads

Documentation Check Test 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:

$ pip install xor-cipher

Alternatively, the library can be installed from source:

$ pip install git+https://github.com/xor-cipher/xor-cipher.git

Or via cloning the repository:

$ git clone https://github.com/xor-cipher/xor-cipher.git
$ cd xor-cipher
$ pip install .

uv

You can add xor-cipher as a dependency with the following command:

$ uv add xor-cipher

Examples

Simple 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"

Cyclic Cipher

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"

In-Place Cipher

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")

Documentation

You can find the documentation here.

Support

If you need support with the library, you can send an email.

Changelog

You can find the changelog here.

Security Policy

You can find the Security Policy of xor-cipher here.

Contributing

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.

License

xor-cipher is licensed under the MIT License terms. See License for details.

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc