{"id":14964480,"url":"https://github.com/andreispurim/aradi","last_synced_at":"2026-02-09T09:31:14.289Z","repository":{"id":255095014,"uuid":"848510172","full_name":"AndreisPurim/ARADI","owner":"AndreisPurim","description":"Implementation of the NSA cryptography algorithm ARADI and LLAMA","archived":false,"fork":false,"pushed_at":"2024-09-21T23:40:51.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T06:11:42.261Z","etag":null,"topics":["algorithm","aradi","cryptography","decryption","encryption","llama","nsa"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyaradi/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreisPurim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-08-27T22:34:06.000Z","updated_at":"2024-09-21T23:41:15.000Z","dependencies_parsed_at":"2024-08-28T00:48:13.893Z","dependency_job_id":"d0b05cd6-0006-4843-8a0b-728c359e831b","html_url":"https://github.com/AndreisPurim/ARADI","commit_stats":{"total_commits":11,"total_committers":3,"mean_commits":"3.6666666666666665","dds":0.4545454545454546,"last_synced_commit":"d85f3b0678f072a61dc861b2f8b7e9843a6936bf"},"previous_names":["andreispurim/aradi"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreisPurim%2FARADI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreisPurim%2FARADI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreisPurim%2FARADI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreisPurim%2FARADI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreisPurim","download_url":"https://codeload.github.com/AndreisPurim/ARADI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238096383,"owners_count":19415789,"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":["algorithm","aradi","cryptography","decryption","encryption","llama","nsa"],"created_at":"2024-09-24T13:33:14.776Z","updated_at":"2026-02-09T09:31:14.231Z","avatar_url":"https://github.com/AndreisPurim.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ARADI and LLAMA Encryption Implementations\n\n## Overview\n\nThis repository includes many implementations of the the ARADI and LLAMA cryptographic algorithms as described in the NSA publication [ARADI and LLAMA](https://eprint.iacr.org/2024/1240). This library is designed for encrypting and decrypting messages and files securely using ARADI. The following lines will present each implementation:\n\n**License:** This project is licensed under the MIT License.\n\n**Contributions:** All suggestions and corrections are welcome. Please feel free to submit issues or pull requests.\n\n**To-do:**\n-   Implement LLAMA\n-   Optimize the Python and C code\n-   Create unit tests to verify integrity\n-   Benchmark performance across different systems\n- Implement in an eletronic hardware system\n\n**Acknowledgements:** Thanks to the authors of the original ARADI and LLAMA paper for their contributions to cryptography; to Bill Buchanan and Odzhan for their C implementations (for benchmark comparisons, check the C implementation); and to Professor Julio César López Hernández (IC-UNICAMP) for introducing us to this algorithm.\n\n# Python Library: pyaradi\n\n```pyaradi``` is the implementation of these functions in Python, which include the following features (so far):\n\n- ARADI encryption in CTR mode\n- Encrypt and decrypt strings and files\n- Automatic nonce generation\n- Padding support with PKCS7\n- Easy-to-use API\n\nTo install the `pyaradi` library, use pip:\n\n```bash\npip install pyaradi\n```\n\n## Use\n\n### Encryption\n\nYou can encrypt a message using the ```encrypt``` function. Here's an example:\n\n```python\nfrom pyaradi import aradi_utils, aradi_core, encrypt\n\n# Define your key (list of 8 32-bit words)\nkey = [\n    0x01234567,\n    0x89ABCDEF,\n    0xFEDCBA98,\n    0x76543210,\n    0x00112233,\n    0x44556677,\n    0x8899AABB,\n    0xCCDDEEFF,\n]\n\nmessage = \"Hello, World!\"\nencrypted_message = encrypt(message, key)\nprint(\"Encrypted message (hex):\", encrypted_message.hex())\n```\n\n### Decrypting a Message\n\nTo decrypt a message, use the `decrypt` function:\n\n```python\nfrom pyaradi import decrypt\n\n# Assuming you have the encrypted message and the key\nreconstructed_message = decrypt(encrypted_message, key)\nprint(\"Reconstructed message:\", reconstructed_message)\n```\n### Encrypting and Decrypting Files\n\nYou can also process files with the `aradi_process_file` function:\n\n```python\nfrom pyaradi import aradi_process_file\n\ninput_file = 'input.txt'\noutput_file = 'output.txt'\nnonce = aradi_utils.generate_nonce(size=8)\n\naradi_process_file(input_file, output_file, key, nonce)\nprint(f\"File '{input_file}' has been encrypted to '{output_file}'.\")\n```\n\n### Testing the Implementation\n\nYou can run a test to verify the encryption and decryption:\n\n```python\nfrom pyaradi import aradi_test\n\nkey = [\n    0x01234567,\n    0x89ABCDEF,\n    0xFEDCBA98,\n    0x76543210,\n    0x00112233,\n    0x44556677,\n    0x8899AABB,\n    0xCCDDEEFF,\n]\n\nmessage = \"Test message for encryption.\"\nencrypted_hex, reconstructed_message = aradi_test(message, key)\n\nprint(\"Encrypted message (hex):\", encrypted_hex)\nprint(\"Reconstructed message:\", reconstructed_message)\n```\n\n### Contributing and Formatting\n\nFeel free to make contributions. In order to automate the boring parts, the file ```pybash.sh``` should have all necessary functions to format, create the releases and upload the code to pip (although I'd prefer you left that to the admins). The functions are:\n\n```chmod +x pybash.sh``` to make it executable.\n\n```./pybash format``` to format using black and flake8.\n\n```./pybash create_dist``` to create the dist packages.\n\n```./pybash test_upload``` to test the upload to test.pypi.org\n\nFor the test uploads, create/configure the ```$HOME/.pypirc```  as:\n\n```\n[distutils]\nindex-servers=\npypi\ntestpypi\n[pypi]\nrepository = https://upload.pypi.org/legacy/\nusername = \u003cusername\u003e\npassword = \u003capi-key starting with pypi-...\u003e\n\n[testpypi]\nrepository = https://test.pypi.org/legacy/\nusername = \u003cusername\u003e\npassword = \u003capi-key starting with pypi-...\u003e\n```\nBe aware that your test.pypi and pypi are different \"organizations\" with different usernames and api-keys. You need to create an account on both.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreispurim%2Faradi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreispurim%2Faradi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreispurim%2Faradi/lists"}