{"id":20292502,"url":"https://github.com/mauricelambert/rc6encryption","last_synced_at":"2026-02-06T20:31:50.343Z","repository":{"id":57460263,"uuid":"423467124","full_name":"mauricelambert/RC6Encryption","owner":"mauricelambert","description":"This package implements the RC6 encryption.","archived":false,"fork":false,"pushed_at":"2025-01-27T08:06:11.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T09:22:25.211Z","etag":null,"topics":["cipher","encryption","pypi-package","python3","rc6"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mauricelambert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-01T13:03:29.000Z","updated_at":"2025-01-27T08:06:15.000Z","dependencies_parsed_at":"2025-01-27T09:20:24.669Z","dependency_job_id":"c3c77102-d07c-4ae8-b59f-c96d114f7ba8","html_url":"https://github.com/mauricelambert/RC6Encryption","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FRC6Encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FRC6Encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FRC6Encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FRC6Encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauricelambert","download_url":"https://codeload.github.com/mauricelambert/RC6Encryption/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787485,"owners_count":20020101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cipher","encryption","pypi-package","python3","rc6"],"created_at":"2024-11-14T15:17:34.709Z","updated_at":"2026-02-06T20:31:50.302Z","avatar_url":"https://github.com/mauricelambert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![RC6Encryption logo](https://mauricelambert.github.io/info/python/security/rc6_small_background.png \"RC6Encryption logo\")\r\n\r\n# RC6Encryption\r\n\r\n## Description\r\n\r\nThis pure python package implements the RC6 encryption (ECB and CBC encryption mode).\r\n\r\n\u003e All encryption and decryption mode are tested, i compare the result with https://www.lddgo.net/en/encrypt/rc6 API.\r\n\u003e\u003e The ECB mode is not recommended, it's the basic encryption for block cipher, you should always use CBC encryption for data greater than 16 bytes.\r\n\r\n## Requirements\r\n\r\nThis package require:\r\n\r\n - python3\r\n - python3 Standard Library\r\n\r\n## Installation\r\n\r\n### Pip\r\n\r\n```bash\r\npython3 -m pip install RC6Encryption\r\n```\r\n\r\n### Git\r\n\r\n```bash\r\ngit clone \"https://github.com/mauricelambert/RC6Encryption.git\"\r\ncd \"RC6Encryption\"\r\npython3 -m pip install .\r\n```\r\n\r\n### Wget\r\n\r\n```bash\r\nwget https://github.com/mauricelambert/RC6Encryption/archive/refs/heads/main.zip\r\nunzip main.zip\r\ncd RC6Encryption-main\r\npython3 -m pip install .\r\n```\r\n\r\n### cURL\r\n\r\n```bash\r\ncurl -O https://github.com/mauricelambert/RC6Encryption/archive/refs/heads/main.zip\r\nunzip main.zip\r\ncd RC6Encryption-main\r\npython3 -m pip install .\r\n```\r\n\r\n## Usages\r\n\r\n### Recommended options\r\n\r\n```bash\r\nrc6 [key] -m CBC -6 -o [secrets.cipher] -i [secrets.file]            # encryption\r\nrc6 [key] -m CBC -n base64 -i [secrets.cipher] -o [decipher.file] -d # decryption\r\n```\r\n\r\n### Command line\r\n\r\n#### Module\r\n\r\n```bash\r\npython3 -m RC6Encryption rc6key -s secrets\r\n```\r\n\r\n#### Python executable\r\n\r\n```bash\r\npython3 RC6Encryption.pyz rc6key -s secrets\r\n```\r\n\r\n#### Command\r\n\r\n##### Basic\r\n\r\n```bash\r\nrc6 rc6key -s secrets                               # encrypt \"secrets\" with rc6key sha256 as key\r\n```\r\n\r\n##### Advanced\r\n\r\n```bash\r\nrc6 rc6key -r 12 -l 5 -w 32 -s secrets              # encrypt \"secrets\" with rc6key sha256 as key (rounds=12, wbit=32, lgw=5) in ECB mode\r\necho secrets| rc6 rc6key --no-sha256 -i             # encrypt \"secrets\\n\" with key and PKCS 5/7 padding in ECB mode\r\nrc6 rc6key -m CBC -I IVTEST -i secrets.txt          # encrypt secrets.txt file content with rc6key sha256 as key and CBC mode and IVTEST as IV\r\nrc6 rc6key -o encrypt.rc6 -s secrets -m CBC         # encrypt \"secrets\" with rc6key sha256 as key, IVTEST as IV and redirect the output to the encrypt.rc6 file using CBC encryption mode and random IV\r\nrc6 rc6key -i encrypt.rc6 -d -m CBC                 # decrypt encrypt.rc6 with rc6key sha256 as key using CBC encryption mode\r\n\r\n## INPUT  ENCODING\r\n\r\nrc6 rc6key -n base64 -s c2VjcmV0cw==                # encrypt \"secrets\" with rc6key sha256 as key (\"c2VjcmV0cw==\" = base64(\"secrets\"))\r\n\r\n## OUTPUT ENCODING\r\n\r\nrc6 rc6key -s secrets -8                            # encrypt \"secrets\" with rc6key sha256 as key, base85-encoded output\r\nrc6 rc6key -s secrets -6                            # encrypt \"secrets\" with rc6key sha256 as key, base64-encoded output\r\nrc6 rc6key -s secrets -3                            # encrypt \"secrets\" with rc6key sha256 as key, base30-encoded output\r\nrc6 rc6key -s secrets -1                            # encrypt \"secrets\" with rc6key sha256 as key, base16-encoded output\r\nrc6 rc6key -s secrets -u                            # encrypt \"secrets\" with rc6key sha256 as key, uu-encoded output\r\n```\r\n\r\n### Python script\r\n\r\n#### RC6 encryption using CBC (recommended)\r\n\r\n```python\r\nfrom RC6Encryption import RC6Encryption\r\n\r\nrc6 = RC6Encryption(b'abcdefghijklm')\r\niv, encrypt = rc6.data_encryption_CBC(b'abcdefghijklmnopabcdefghijklmnopabcdefghijklm')             # Random IV\r\nplaintext = rc6.data_decryption_CBC(encrypt, iv)\r\n\r\niv, encrypt = rc6.data_encryption_CBC(b'abcdefghijklmnopabcdefghijklmnopabcdefghijklm', b'IVTEST')  # Generate your IV, be careful, an IV with size less than 16 bytes is not recommended\r\nplaintext = rc6.data_decryption_CBC(encrypt, iv)\r\n```\r\n\r\n#### RC6 encryption using ECB (not recommended)\r\n\r\n```python\r\nfrom RC6Encryption import RC6Encryption\r\n\r\nrc6 = RC6Encryption(b'abcdefghijklm')\r\nencrypt = rc6.data_encryption_ECB(b'abcdefghijklmnopabcdefghijklmnopabcdefghijklm')\r\nplaintext = rc6.data_decryption_ECB(encrypt)\r\n```\r\n\r\n#### Low level API\r\n\r\n```python\r\nfrom RC6Encryption import RC6Encryption\r\nfrom hashlib import sha256\r\n\r\nrc6 = RC6Encryption(sha256(b'abcdefghijklmnop').digest())\r\ncipher = rc6.blocks_to_data(rc6.encrypt(b'abcdefghijklmnop'))\r\ndecipher = rc6.blocks_to_data(rc6.decrypt(cipher))\r\n```\r\n\r\n## Links\r\n\r\n - [Pypi](https://pypi.org/project/RC6Encryption/)\r\n - [Github](https://github.com/mauricelambert/RC6Encryption/)\r\n - [Documentation](https://mauricelambert.github.io/info/python/security/RC6Encryption.html)\r\n - [Executable](https://mauricelambert.github.io/info/python/security/RC6Encryption.pyz)\r\n - [Python Windows executable](https://mauricelambert.github.io/info/python/security/RC6Encryption.exe)\r\n\r\n## Help\r\n\r\n```text\r\nusage: RC6Encryption.py [-h] [--mode {CBC,ECB}] [--decryption] (--input-file [INPUT_FILE] | --input-string INPUT_STRING) [--output-file OUTPUT_FILE]\r\n                        [--base85 | --base64 | --base32 | --base16 | --output-encoding {base32,base16,base64,base85}]\r\n                        [--input-encoding {base32,base16,base64,base85}] [--rounds ROUNDS] [--w-bit W_BIT] [--iv IV] [--lgw LGW] [--sha256 | --no-sha256]\r\n                        key\r\n\r\nThis script performs RC6 encryption.\r\n\r\npositional arguments:\r\n  key                   Encryption key.\r\n\r\noptions:\r\n  -h, --help            show this help message and exit\r\n  --mode {CBC,ECB}, -m {CBC,ECB}\r\n                        Ecryption mode, for CBC encryption IV is write on the first 16 bytes of the encrypted data.\r\n  --decryption, -d      Data decryption.\r\n  --input-file [INPUT_FILE], --i-file [INPUT_FILE], -i [INPUT_FILE]\r\n                        The file to be encrypted.\r\n  --input-string INPUT_STRING, --string INPUT_STRING, -s INPUT_STRING\r\n                        The string to be encrypted.\r\n  --output-file OUTPUT_FILE, --o-file OUTPUT_FILE, -o OUTPUT_FILE\r\n                        The output file.\r\n  --base85, --85, -8    Base85 encoding as output format\r\n  --base64, --64, -6    Base64 encoding as output format\r\n  --base32, --32, -3    Base32 encoding as output format\r\n  --base16, --16, -1    Base16 encoding as output format\r\n  --output-encoding {base32,base16,base64,base85}, --o-encoding {base32,base16,base64,base85}, -e {base32,base16,base64,base85}\r\n                        Output encoding.\r\n  --input-encoding {base32,base16,base64,base85}, --i-encoding {base32,base16,base64,base85}, -n {base32,base16,base64,base85}\r\n                        Input encoding.\r\n  --rounds ROUNDS, -r ROUNDS\r\n                        RC6 rounds\r\n  --w-bit W_BIT, -b W_BIT\r\n                        RC6 w-bit\r\n  --iv IV, -I IV        IV for CBC mode only, for decryption if IV is not set the 16 first bytes are used instead.\r\n  --lgw LGW, -l LGW     RC6 lgw\r\n  --sha256, --no-sha256\r\n                        Use the sha256 hash of the key as the key.\r\n```\r\n\r\n## Licence\r\n\r\nLicensed under the [GPL, version 3](https://www.gnu.org/licenses/).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauricelambert%2Frc6encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauricelambert%2Frc6encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauricelambert%2Frc6encryption/lists"}