Skip to main content
Quarantined

This project has been quarantined by PyPI admins. It cannot be installed or modified until a security review is complete.

xor_bytes and crc32 are implemented in C against the CPython Stable ABI (abi3), so a single wheel (cp38-abi3) works on CPython 3.8 and newer; pure-Python fallbacks are used automatically when the extension is unavailable (e.g. on PyPy). Everything else is pure Python.

Installation

pip install basic-crypt

Usage

import basic_crypt as bc

bc.xor_bytes(b"attack at dawn", b"key")            # b'\x1b\x00\x15\x06j...'
bc.xor_bytes(bc.xor_bytes(b"secret", b"k"), b"k")  # b'secret'
bc.crc32(b"123456789")                             # 3421780262 (0xCBF43926)

bc.rot13("Hello, World!")                          # 'Uryyb, Jbeyq!'
bc.atbash("Hello")                                 # 'Svool'
bc.affine_encrypt("AFFINE", 5, 8)                  # 'IHHWVC'
bc.affine_decrypt("IHHWVC", 5, 8)                  # 'AFFINE'
bc.railfence_encrypt("WEAREDISCOVEREDFLEEATONCE", 3)
bc.railfence_decrypt("WECRLTEERDSOEEFEAOCAIVDEN", 3)
bc.rc4(b"Plaintext", b"Key").hex()                 # 'bbf316e8d940af0ad3'

basic_crypt.native_available() reports whether the compiled _native extension is in use.

API reference

Function Description
xor_bytes(data, key) Repeating-key XOR over any bytes-like objects
crc32(data) zlib-compatible CRC-32 checksum (IEEE 802.3) as int
rot13(text) ROT13 substitution on letters
atbash(text) Atbash (A↔Z) substitution on letters
affine_encrypt(text, a, b) Affine cipher; requires gcd(a, 26) == 1
affine_decrypt(text, a, b) Inverse of affine_encrypt
railfence_encrypt(text, rails) Rail fence transposition
railfence_decrypt(text, rails) Inverse of railfence_encrypt
rc4(data, key) RC4 stream cipher (symmetric)
native_available() True if the compiled abi3 extension is in use

License

MIT — see LICENSE.

Metadata

Release files for basic-crypt 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for basic-crypt 1.5.2
File Size Uploaded Provenance Actions
basic_crypt-1.5.2.tar.gz 7.7 kB Without provenance Details for basic_crypt-1.5.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for basic-crypt 1.5.2
File Interpreter ABI Platform Actions
basic_crypt-1.5.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for basic_crypt-1.5.2-py3-none-win_amd64.whl
basic_crypt-1.5.2-py3-none-manylinux1_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details for basic_crypt-1.5.2-py3-none-manylinux1_x86_64.whl

Total release size: 178.0 kB

Release files / basic_crypt-1.5.2.tar.gz

Download URL basic_crypt-1.5.2.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
88c3fe090899c5cd20dff5572b616df30f2749900683801279cf126bd890e123
BLAKE2b-256 checksum
How to use checksums
5a799a9c79997a7ab2a762ed31ceb3374debc104ff6322ca9dd451a3205f5e14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / basic_crypt-1.5.2-py3-none-win_amd64.whl

Download URL basic_crypt-1.5.2-py3-none-win_amd64.whl
Size 131.2 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
5a529caaf5daa4be09251d66dea82960f7ce1da0d2368c90e47311461032fd92
BLAKE2b-256 checksum
How to use checksums
1ef971a0b9e0b921819912b8c133c866ee60fe57304fcaebbbd6a56b9b8f7f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / basic_crypt-1.5.2-py3-none-manylinux1_x86_64.whl

Download URL basic_crypt-1.5.2-py3-none-manylinux1_x86_64.whl
Size 39.1 kB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
11b4d0b03dba22faddd32c7a4a3e9fd7322661ef1ecb4e1620ba55714f075822
BLAKE2b-256 checksum
How to use checksums
0fcee7964d07720c9255494d816852e21b6ae8f40a552258e0c5e82ed7950a6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for basic-crypt 1.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page