{"id":16082076,"url":"https://github.com/floressek/theory_of_crypto_lab","last_synced_at":"2025-08-01T19:36:24.334Z","repository":{"id":235592584,"uuid":"790971023","full_name":"Floressek/Theory_of_crypto_lab","owner":"Floressek","description":"Code for random assignments in Theory of Cryptology ","archived":false,"fork":false,"pushed_at":"2024-05-13T14:05:47.000Z","size":80,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T23:03:33.250Z","etag":null,"topics":["lz77-compression-algorithm","shannon-entropy"],"latest_commit_sha":null,"homepage":"","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/Floressek.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-04-23T21:24:47.000Z","updated_at":"2024-10-20T12:13:31.000Z","dependencies_parsed_at":"2024-04-23T23:12:46.963Z","dependency_job_id":"185ac72a-3e41-4a7d-a2aa-1c5521b59716","html_url":"https://github.com/Floressek/Theory_of_crypto_lab","commit_stats":null,"previous_names":["floressek/theory_of_crypto_lab"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Floressek/Theory_of_crypto_lab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floressek%2FTheory_of_crypto_lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floressek%2FTheory_of_crypto_lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floressek%2FTheory_of_crypto_lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floressek%2FTheory_of_crypto_lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Floressek","download_url":"https://codeload.github.com/Floressek/Theory_of_crypto_lab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floressek%2FTheory_of_crypto_lab/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268288477,"owners_count":24226576,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["lz77-compression-algorithm","shannon-entropy"],"created_at":"2024-10-09T11:25:19.988Z","updated_at":"2025-08-01T19:36:24.285Z","avatar_url":"https://github.com/Floressek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# LZ77 Compression and Shannon Entropy Calculator\n\nThis repository contains Python implementations of the LZ77 compression algorithm and a Shannon entropy calculator. These tools are designed to help understand and analyze the efficiency of text compression and the inherent information content in data.\n\n## Features\n\n- **LZ77 Compression**: Encode text using the LZ77 algorithm, which is useful for understanding basic concepts in data compression techniques.\n- **Shannon Entropy Calculator**: Compute the Shannon entropy for a given text to understand the theoretical limits of lossless compression for that text.\n\n## Getting Started\n\nTo use these scripts, you will need Python installed on your computer. These scripts are tested with Python 3.8 but should be compatible with other Python 3.x versions.\n\n### Prerequisites\n\nEnsure you have Python installed. You can download Python from [python.org](https://www.python.org/downloads/).\n\n### Installation\n\nClone this repository to your local machine using:\n\n```bash\ngh repo clone Floressek/Theory_of_crypto_lab\ncd your-repository-directory\n```\n\n### Usage\n\n#### LZ77 Compression\n\nTo encode text using the LZ77 algorithm, run the `Encoded.py` script. You will be prompted to enter the dictionary size, buffer size, and the text you want to compress.\n\n```bash\npython Encoded.py\n```\n\nFollow the prompts to input your parameters and text.\n\n#### Shannon Entropy Calculator\n\nTo calculate the Shannon entropy of a given text, run the `Shannon_result_table.py` script. You will need to input the text for which you want the entropy calculated.\n\n```bash\npython Shannon_result_table.py\n```\n\n### Examples\n\nHere's how you can use the LZ77 encoding script:\n\n```bash\nEnter the dictionary size: 15\nEnter the buffer size: 5\nEnter the text to encode: BAADAADDDBEEDAAEAADAABDDA\n```\n\nOutput:\n```\nDictionary           | Buffer               | Remaining            | Match               \n------------------------------------------------------------------------------------\n                     | BAADA                | ADDDBEEDAAEAADAABDDA | \u003c0, 0, B\u003e\nB                    | AADAA                | DDDBEEDAAEAADAABDDA  | \u003c0, 0, A\u003e\nBA                   | ADAAD                | DDBEEDAAEAADAABDDA   | \u003c1, 1, D\u003e\nBAAD                 | AADDD                | BEEDAAEAADAABDDA     | \u003c3, 3, D\u003e\nBAADAADD             | DBEED                | AAEAADAABDDA         | \u003c5, 1, B\u003e\nBAADAADDDB           | EEDAA                | EAADAABDDA           | \u003c0, 0, E\u003e\nBAADAADDDBE          | EDAAE                | AADAABDDA            | \u003c1, 1, D\u003e\nBAADAADDDBEED        | AAEAA                | DAABDDA              | \u003c12, 2, E\u003e\nAADAADDDBEEDAAE      | AADAA                | BDDA                 | \u003c15, 5, B\u003e\nDDBEEDAAEAADAAB      | DDA                  |                      | \u003c15, 2, A\u003e\nEncoded LZ77: [(0, 0, 'B'), (0, 0, 'A'), (1, 1, 'D'), (3, 3, 'D'), (5, 1, 'B'), (0, 0, 'E'), (1, 1, 'D'), (12, 2, 'E'), (15, 5, 'B'), (15, 2, 'A')]\nAmount of encoded words: 10\n\n```\n\n## Contributing\n\nContributions are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloressek%2Ftheory_of_crypto_lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloressek%2Ftheory_of_crypto_lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloressek%2Ftheory_of_crypto_lab/lists"}