Skip to main content

This package implements RC4 encryption.

Project description

RC4Encryption logo

RC4Encryption

Description

This package implements the RC4 encryption.

Requirements

This package require:

  • python3
  • python3 Standard Library

Installation

pip install RC4Encryption

Usages

Recommended options

rc4 [key] -6 -o [secrets.cipher] -i [secrets.file]            # encryption
rc4 [key] -n base64 -i [secrets.cipher] -o [decipher.file] -d # decryption

Command line

Module

python3 -m RC4Encryption rc4key -s secrets

Python executable

python3 RC4Encryption.pyz rc4key -s secrets

Command

Basic
rc4 rc4key -s secrets                               # encrypt "secrets" with rc4key sha256 as key
Advanced
rc4 rc4key -s secrets                               # encrypt "secrets" with rc4key as key
echo secrets| rc4 rc4key --no-sha256 -i             # encrypt "secrets\n" with sha256 of rc4key as key
rc4 rc4key -i secrets.txt                           # encrypt secrets.txt file with rc4key as key
rc4 rc4key -o encrypt.rc4 -s secrets                # encrypt "secrets" with rc4key as key and redirect the output to the encrypt.rc4 file
rc4 rc4key -i encrypt.rc4 -d                        # decrypt encrypt.rc4 with rc4key as key

## INPUT  ENCODING

rc4 rc4key -n base64 -s c2VjcmV0cw==                # encrypt "secrets" with rc4key sha256 as key ("c2VjcmV0cw==" = base64("secrets"))

## OUTPUT ENCODING

rc4 rc4key -s secrets -8                            # encrypt "secrets" with rc4key sha256 as key, base85-encoded output
rc4 rc4key -s secrets -6                            # encrypt "secrets" with rc4key sha256 as key, base64-encoded output
rc4 rc4key -s secrets -3                            # encrypt "secrets" with rc4key sha256 as key, base30-encoded output
rc4 rc4key -s secrets -1                            # encrypt "secrets" with rc4key sha256 as key, base16-encoded output
rc4 rc4key -s secrets -u                            # encrypt "secrets" with rc4key sha256 as key, uu-encoded output

Python script

from RC4Encryption import RC4Encryption

rc4 = RC4Encryption(b'key')
rc4.make_key()
cipher = rc4.crypt(b'secrets')
cipher_continuation = rc4.crypt(b'secrets')


rc4.reset(b'key')
rc4.make_key()
decipher = rc4.crypt(cipher)
decipher_continuation = rc4.crypt(cipher_continuation)

Links

Help

usage: RC4.py [-h] (--input-file [INPUT_FILE] | --input-string INPUT_STRING) [--output-file OUTPUT_FILE]
              [--base85 | --base64 | --base32 | --base16 | --output-encoding {base64,base85,base16,base32}]
              [--input-encoding {base64,base85,base16,base32}] [--sha256]
              key

This file performs RC4 encryption.

positional arguments:
  key                   Encryption key.

options:
  -h, --help            show this help message and exit
  --input-file [INPUT_FILE], --i-file [INPUT_FILE], -i [INPUT_FILE]
                        The secrets file to be encrypted.
  --input-string INPUT_STRING, --string INPUT_STRING, -s INPUT_STRING
                        The string to be encrypted.
  --output-file OUTPUT_FILE, --o-file OUTPUT_FILE, -o OUTPUT_FILE
                        The output file.
  --base85, --85, -8    Base85 encoding as output format
  --base64, --64, -6    Base64 encoding as output format
  --base32, --32, -3    Base32 encoding as output format
  --base16, --16, -1    Base16 encoding as output format
  --output-encoding {base64,base85,base16,base32}, --o-encoding {base64,base85,base16,base32}, -e {base64,base85,base16,base32}
                        Output encoding.
  --input-encoding {base64,base85,base16,base32}, --i-encoding {base64,base85,base16,base32}, -n {base64,base85,base16,base32}
                        Input encoding.
  --sha256              Use the sha256 of the key as the key.

Licence

Licensed under the GPL, version 3.

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

RC4Encryption-0.0.2.tar.gz (18.3 kB view details)

Uploaded Source

File details

Details for the file RC4Encryption-0.0.2.tar.gz.

File metadata

  • Download URL: RC4Encryption-0.0.2.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for RC4Encryption-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d07cfccc0fee756b1dd717c225aee46902f3bece9bf227a08f390191c4588642
MD5 4d65fb2b589ff52d3164f7a5565732b6
BLAKE2b-256 2c9fbfcc48d6b6261fff2f2a653bceab793eb3baa939adf0a6525ffdf444584b

See more details on using hashes here.

Supported by

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