Skip to main content

A small and insanely fast ARCFOUR (RC4) cipher implementation of Python

Project description

Test Test Coverage Maintainability Documentation Status

A small and insanely fast ARCFOUR (RC4) cipher implementation of Python.

  • Strongly focused on performance; entire source code is written in C.

  • Thread-safety; you can improve further performance with multi-threading.

  • Easily installable; single file with no dependency, pre-built wheels provided.

Benchmark

Below is benchmark metrics against 3 major RC4 implementations.

Benchmark

The whole benchmark code is in ./benchmark.py.

Install

Install from PyPI

pip install arc4

Or clone the repo and do install

git clone https://github.com/manicmaniac/arc4.git
cd arc4
python setup.py install

Usage

>>> from arc4 import ARC4
>>> arc4 = ARC4(b'key')
>>> cipher = arc4.encrypt(b'some plain text to encrypt')

Because RC4 is a stream cipher, you must initialize RC4 object in the beginning of each operations.

>>> arc4 = ARC4(b'key')
>>> arc4.decrypt(cipher)
b'some plain text to encrypt'

Documents

Here is the API reference.

https://arc4.readthedocs.io/en/latest/

Testing

python -m unittest discover

License

This software is under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arc4-0.5.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

arc4-0.5.0-pp311-pypy311_pp73-win_amd64.whl (10.2 kB view details)

Uploaded PyPyWindows x86-64

arc4-0.5.0-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (8.4 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

arc4-0.5.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl (6.9 kB view details)

Uploaded PyPymacOS 11.0+ ARM64

arc4-0.5.0-pp310-pypy310_pp73-win_amd64.whl (10.1 kB view details)

Uploaded PyPyWindows x86-64

arc4-0.5.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl (6.9 kB view details)

Uploaded PyPymacOS 11.0+ ARM64

arc4-0.5.0-cp313-cp313-win_amd64.whl (10.1 kB view details)

Uploaded CPython 3.13Windows x86-64

arc4-0.5.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

arc4-0.5.0-cp313-cp313-macosx_10_13_universal2.whl (10.1 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

arc4-0.5.0-cp312-cp312-win_amd64.whl (10.1 kB view details)

Uploaded CPython 3.12Windows x86-64

arc4-0.5.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

arc4-0.5.0-cp312-cp312-macosx_10_13_universal2.whl (10.1 kB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

arc4-0.5.0-cp311-cp311-win_amd64.whl (10.0 kB view details)

Uploaded CPython 3.11Windows x86-64

arc4-0.5.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (17.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

arc4-0.5.0-cp311-cp311-macosx_10_9_universal2.whl (9.1 kB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

arc4-0.5.0-cp310-cp310-win_amd64.whl (10.0 kB view details)

Uploaded CPython 3.10Windows x86-64

arc4-0.5.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (16.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

arc4-0.5.0-cp310-cp310-macosx_10_9_universal2.whl (9.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

arc4-0.5.0-cp39-cp39-win_amd64.whl (10.3 kB view details)

Uploaded CPython 3.9Windows x86-64

arc4-0.5.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (16.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

arc4-0.5.0-cp39-cp39-macosx_10_9_universal2.whl (9.1 kB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file arc4-0.5.0.tar.gz.

File metadata

  • Download URL: arc4-0.5.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for arc4-0.5.0.tar.gz
Algorithm Hash digest
SHA256 259d4e505766639b7245d7199f3b4e72134d7adf20196820ffd3015954d85955
MD5 298f8720a419c491e2f65109fdb84425
BLAKE2b-256 b6f0881da69973abadac6848d27a0bf070b107ed5547ddbd1b092c30ab4c8b7c

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 0c47bb37a5b80abcb7043d6b206068e4fbc90d27564aa667b2e7d90b2e7ff2cc
MD5 d767299518d02d010b0ba9beb49a378c
BLAKE2b-256 17ad93ff0cb1be94d16357bdaf65fbe1f9c3dc33eb980a08af2c349bef71a43d

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 02435fe04cf147aff25a9be5380b16d6084f2469f51620b5fa3af936a6988c51
MD5 f62d91441cf346bffe593c1916e3ab0b
BLAKE2b-256 a68012056b7138febb2e6c1294801ed7d072908ace2df58e0feed9347e3d9df4

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ccbed58bff2ce25b45535173221091b86162727caca66f4e383221f8b306113a
MD5 40429c2f99b65d5f02588a1ac181fdad
BLAKE2b-256 1df6642e3b07a2db870354cfaad91535205455f09a03f4eeee82f72a37634662

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-pp310-pypy310_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 e3f9144cad18c4cdf8d02de1068504c045b29461c511963e4a495ffb61af1148
MD5 c585159c1513531d435a9e5350395972
BLAKE2b-256 bf080bf1fe83abaf7c877490ef2b550f503cb865a80bab6c2f868e07843a17bd

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc0f6c9827d5f36a838cefbb3705ce1c6850df456d0e5b81c24733f857f3901d
MD5 95a545d572a4600e4ae873823103c896
BLAKE2b-256 ece314bd4e0a24dc0f18f2236e40706899784d92059268c8039d32544ff9969a

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: arc4-0.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for arc4-0.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6fb7f6a7b16bc6fc3ed1eefaaa201810edec0e7dc08683970b2be0699b401e39
MD5 c67b7488406bf4aa61d549d8e412387a
BLAKE2b-256 dff7f7a9473114eead7cdb1419eaab156ad767218be748a47922117cfa1167c1

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 b8bcb09611b9e16a3f9d78b747c135386b59803a3fdecf4e7ff03eb3949e671b
MD5 218a126ea7f8bacbcd20aebbe8234e54
BLAKE2b-256 dd6e782c46bfc80ca5afd2fc29d5d611a1db9172759aa7d0e538517d6c8a96b3

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 ac5e9c3a589825afd31a10b6edd49bc8fe83ca88b4dc82dea6e977304304d36c
MD5 e1c79589d90b7b85df68c14252ffe0de
BLAKE2b-256 dedcf434e3517d61f8a3d9c19bb2f615942ae0888d35dd1ab8a8f39dbf4014fa

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: arc4-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for arc4-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4d07b1aa184b78a6e10d1920dbe92644b4113b34062ad2869f450e678bb7ada6
MD5 93928ad8080390fb28b9ebe7f3be9789
BLAKE2b-256 7fafc2cd8636fa5f1e5bfee2d2772ac377ecea27112b7d4d5a664df9646542e1

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 7a3b4325e550a8bc2b56484edf91a983d2bd3f32fae8f169d5a5846a22554ea9
MD5 dcd8712d3576e6c83163283a3f7b4ce5
BLAKE2b-256 7a77c4b547dd33a23079dff6e173fc2313841802bb9a1be3975673bf4c5efbe1

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 7eb640302490f105c68336e763a9e8a9513377c46ad0a704c297d5d943f98831
MD5 822a7e154732f6d5c6ecdf707d686703
BLAKE2b-256 b2440c9ea0129c022a71ce3d686f4a04280a01657b83d8fff5de683524f10748

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: arc4-0.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for arc4-0.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6c20103a2ff7cd43b91d707fb520a3d10dac5b9ef647957a2d19fa3a05725be6
MD5 015e83f0246849fd01c826b30071cd24
BLAKE2b-256 b9f7e4ff9ee3d4b6227fd2e3b34d66d2242b7f55fd245c537b578e7f2b60becb

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0ffd6df658cf4d348eebbd125e9dcd35fcfcb2efec31ff4258b85791b0207bad
MD5 ca0a36808e4cfb7f4b039e2d4b8d506a
BLAKE2b-256 378084266d1b251fe29272d9f7796e3d4a323cf0a005749b6ddda45a191c2f11

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 343a67c0bd2dcfdee78dc4269d8bd8ac362e6e911047833172468b337faccb1f
MD5 2e8eb54168997ebb7ef1f4af08da1d2b
BLAKE2b-256 e84ff2e28e91c9083876090e6218d3f601f7d54acdb5cc189fd4af406f104778

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: arc4-0.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for arc4-0.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 631786051c1468d3ec1010d1fc1089b539831d72d7f08ea342bdcd25aa019620
MD5 e876b75d6cb026133b34ee00eca0170d
BLAKE2b-256 d9e92086b401b89885156424f3d5095de9ae3807ba04b05a768ba320c163ebc1

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 83a1f1934c55256838aa40998b87777f881e81c2056af9734cdb35a84574488c
MD5 d003d33977f2107b0a3a9adf858563c7
BLAKE2b-256 0b6832c530846e2037275c094854c63935a15fac694de9279e62b23d86cf00e7

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2a052f9934746d81917032a4f37b390577141c56b4445c7f85c52b1155fdbf9f
MD5 2ab46a240e01d4f3319b3c3f60613d7e
BLAKE2b-256 243fab228c5d60e1d6ba345fa993b5336cd24376a86851673e112ad09b681c91

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: arc4-0.5.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for arc4-0.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e6584f7a62bab998ef9a908307448cb62dee6555480da95a0c667e2d7372ab72
MD5 791509a3d324d8a13cdd4235a5483a4c
BLAKE2b-256 dd1ed24142b5814a9f9ddb37630e7ca6316373ab5d2754ee62f36052afcc4e55

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for arc4-0.5.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 2aa709409fed2e7db2525c5b2022369067feb25a44723a14c90b629c9d2fa091
MD5 0d831195d95381fe328b19b5ed226d05
BLAKE2b-256 f92ff3548362dfb6fb09543c48b5f5ac2e4b79a0007942e9cf0f9b1711024eb8

See more details on using hashes here.

File details

Details for the file arc4-0.5.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

  • Download URL: arc4-0.5.0-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for arc4-0.5.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8c8ce5f81553956660eb845c9d8ecea3db1de358e2b5fdfd49ba5033da2c4b14
MD5 96a2f067bfbe203ede850ff9aa0ab4b1
BLAKE2b-256 a27d73f01294b591634c1541477c44351f36399d580f681b5de6d2c9e4ecc00c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page