{"id":27290765,"url":"https://github.com/hellman/divprop","last_synced_at":"2025-04-11T21:38:54.321Z","repository":{"id":246786570,"uuid":"339841230","full_name":"hellman/divprop","owner":"hellman","description":"Division property cryptanalysis tools","archived":false,"fork":false,"pushed_at":"2024-07-08T09:07:49.000Z","size":410,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T11:05:52.438Z","etag":null,"topics":["cryptanalysis","integral-cryptanalysis","s-boxes"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-02-17T20:00:58.000Z","updated_at":"2024-11-04T03:12:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"59249996-abdf-4a69-8142-13fd6408133c","html_url":"https://github.com/hellman/divprop","commit_stats":null,"previous_names":["hellman/divprop"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellman%2Fdivprop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellman%2Fdivprop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellman%2Fdivprop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellman%2Fdivprop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellman","download_url":"https://codeload.github.com/hellman/divprop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248485373,"owners_count":21111843,"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":["cryptanalysis","integral-cryptanalysis","s-boxes"],"created_at":"2025-04-11T21:38:53.667Z","updated_at":"2025-04-11T21:38:54.310Z","avatar_url":"https://github.com/hellman.png","language":"Python","readme":"# divprop - Tools for cryptanalysis using division property\n\nThis package provides C++ implementation and Python bindings (SWIG) for division property computations of S-boxes. It was developed for the [Convexity of division property transitions](https://eprint.iacr.org/2021/1285) paper ([ASIACRYPT 2021](https://link.springer.com/chapter/10.1007/978-3-030-92062-3_12)), see also the other [supporting code](https://github.com/CryptoExperts/AC21-divprop-convexity/) for the paper.\n\nIf you this library in your research, please cite\n\n```bib\n@inproceedings{AC:Udovenko21,\n  author       = {Aleksei Udovenko},\n  title        = {Convexity of Division Property Transitions: Theory, Algorithms and\n                  Compact Models},\n  booktitle    = {{ASIACRYPT} {(1)}},\n  series       = {Lecture Notes in Computer Science},\n  volume       = {13090},\n  pages        = {332--361},\n  publisher    = {Springer},\n  year         = {2021}\n}\n```\n\n## Installation\n\nRequires SWIG for building the extension (both for this package and its dependency [subsets](https://github.com/hellman/subsets)). Can be installed for pure python 3 or pypy3 for faster speeds.\n\n```\n$ sudo apt install swig\n$ pip install divprop\n```\n\n## Usage\n\nDivProp is the main package related to the paper's developments on division property. The two most important classes are `Sbox` and `SboxDivision`.\n\n- `Sbox` is a small wrapper for representing S-boxes. \n- `SboxDivision` allows to easily compute all the convex sets described in the paper.\n\nExamples:\n\n```py\nfrom divprop.all_sboxes import AES\nfrom divprop import Sbox, SboxDivision\n\ns = Sbox(AES, 8, 8)\n# \u003cSbox hash=3b66e44419610dd0 n=8 m=8\u003e\n\nsd = SboxDivision(s)\nsd.divcore\n# \u003cDenseSet hash=14421c71a4b40a67 n=16 wt=122 | 2:25 3:66 4:29 8:2\u003e\nsd.min_dppt\n# \u003cDenseSet hash=3bdcec9ddb5303f2 n=16 wt=2001 | 0:1 2:64 3:224 4:448 5:560 6:428 7:173 8:54 9:42 10:6 16:1\u003e\nsd.invalid_max\n# \u003cDenseSet hash=af326bfc6e4b2f4a n=16 wt=87 | 3:30 4:41 7:16\u003e\nsd.redundant_min\n# \u003cDenseSet hash=d165309d0be60267 n=16 wt=319 | 3:137 4:168 5:6 9:8\u003e\nsd.redundant_alternative_min\n# \u003cDenseSet hash=82186fa2cffeefc6 n=16 wt=274 | 3:152 4:112 5:2 9:8\u003e\nsd.propagation_map\n[[0], [1, 2, 4, 8, 16, 32, 64, 128], [1, 2, 4, 8, 16, 32, 64, 128], ..., [4, 10, 18, 24, 33, 40, 48, 65, 80, 98, 129, 144], [255]]\n```\n\nThe advanced algorithm for heavy S-boxes is implemented in [divprop.divcore_peekanfs](./src/divprop/divcore_peekanfs.py):\n\n```py\nfrom divprop.divcore_peekanfs import SboxPeekANFs\n\ndivcore, invalid_max = SboxPeekANFs(s).compute()\nassert divcore == set(sd.divcore.to_Bins())\nassert invalid_max == set(sd.invalid_max.to_Bins())\n```\n\nIts variation with filesystem cache (to reduce RAM usage) is implemented in [divpop.tool_random_sbox_benchmark](./src/divprop/tool_random_sbox_benchmark.py)\n\n\nTodo\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellman%2Fdivprop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellman%2Fdivprop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellman%2Fdivprop/lists"}