{"id":13818395,"url":"https://github.com/AISyLab/side-channel-analysis-toolbox","last_synced_at":"2025-05-15T23:31:54.336Z","repository":{"id":181309335,"uuid":"254006092","full_name":"AISyLab/side-channel-analysis-toolbox","owner":"AISyLab","description":"This is a project in which side-channel attacks are researched and developed.","archived":false,"fork":false,"pushed_at":"2020-04-21T08:58:54.000Z","size":357,"stargazers_count":38,"open_issues_count":1,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-19T16:43:34.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/AISyLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-08T06:38:29.000Z","updated_at":"2024-11-12T02:10:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c599cc9-99d8-4df8-bfd0-a2bdb0cc3268","html_url":"https://github.com/AISyLab/side-channel-analysis-toolbox","commit_stats":null,"previous_names":["aisylab/side-channel-analysis-toolbox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AISyLab%2Fside-channel-analysis-toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AISyLab%2Fside-channel-analysis-toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AISyLab%2Fside-channel-analysis-toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AISyLab%2Fside-channel-analysis-toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AISyLab","download_url":"https://codeload.github.com/AISyLab/side-channel-analysis-toolbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442314,"owners_count":22071863,"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":[],"created_at":"2024-08-04T07:00:44.868Z","updated_at":"2025-05-15T23:31:53.923Z","avatar_url":"https://github.com/AISyLab.png","language":"Python","funding_links":[],"categories":["Conference"],"sub_categories":[],"readme":"# Side-channel Attack Project\n\u003c!---\n[![build status](https://gitlab.ewi.tudelft.nl/TI2806/2018-2019/CS/cp19-cs-11/cs-11/badges/development/pipeline.svg)](https://gitlab.ewi.tudelft.nl/TI2806/2018-2019/CS/cp19-cs-11/cs-11/commits/development)\n[![coverage report](https://gitlab.ewi.tudelft.nl/TI2806/2018-2019/CS/cp19-cs-11/cs-11/badges/development/coverage.svg)](https://gitlab.ewi.tudelft.nl/TI2806/2018-2019/CS/cp19-cs-11/cs-11/commits/development)\n---\u003e\n\nThis is a project in which side-channel attacks are researched and developed.\n\n## Features\n\nThe software includes a number of features.\n\nSide-channel attacks included in current version:\n* Template attack\n* Pooled template attack\n* Stochastic attack\n* Mutual information analysis\n\nAnalysis tools included in current version:\n* Normalized inter class variance analysis\n* Pearson correlation analysis\n\nOther features include:\n* Progressbar\n* Logging of sub result\n\n## Getting started\n\n\u003c!---\n\nThis section should contain installation, testing, and running instructions for people who want to get started with the project.\n\n- These instructions should work on a clean system.\n- These instructions should work without having to install an IDE.\n- You can specify that the user should have a certain operating system.\n\n---\u003e\n\n### Requirements\nThis project needs to following to run:\n* Python 3.7.x\n* A CUDA enabled grapics card with Compute Capability \u003e= 3.5\n    - You can check the CC of your card here: https://developer.nvidia.com/cuda-gpus\n* The CUDA SDK (CUDA 10.x)\n\n### Installing packages\nIn a terminal, run\n```bash\npython setup.py install\n```\nin the root directory (`cs-11/` most likely) to install most of the required dependencies.\n\n### Running\nPython can't find our modules by itself, so we need to tell Python where they are.\nThe command below will append the current directory (which should be the project root directory)\nto the `PYTHONPATH` environment variable.\n\nOn Linux or if using a Linux shell on Windows:\n````bash\nexport PYTHONPATH=$(pwd)\n````\nOn Windows' `cmd`:\n```\nset PYTHONPATH=%cd%\n```\n\nThen you can run the program:\n```bash\npython sca\n```\n\n### Running tests\nTo verify the correctness of your installation, the test suite can be executed with the following command:\n```bash\npython setup.py test\n```\n\n## Documentation\n\nThe side-channel attack (sca) program allows the following side-channel attacks to be run:\n* Mutual Information Analysis Attack (mia)\n* Stochastic Attack (sa)\n* (Pooled) Template Attack (ta)\n* Online Correlation Power Analysis (cpa-online)\n\nThese simple attacks can be run using the following commands\n\n```bash\npython sca mia\npython sca sa\npython sca ta\npython sca cpa-online\n```\n\n### Flags for the attacks\n| Flag | Info | Default | Compatibility |\n|------|------|---------|---------------|\n| --traces-file, -tf | The path for the traces to be used | Default data set | ALL |\n| --keys-file, -kf | The path for the keys to be used | Default data set | ALL |\n| --plain-file, -pf | The path for the plain to be used | Default data set | ALL |\n| --subkey | The subkey to find; must be in the range [0-15]. When leaving this option out, the whole key is calculated. | MIA: 0, SA: ALL, TA: ALL, CPA-online: ALL | ALL |\n| --traces, -t | The number of traces to run the attack with. | MIA: 1000, SA: 4000, TA: 30, CPA-online: 100 | ALL |\n| --num_attack-traces, -a | The number of traces which will be attacked | MIA: 1000, SA: 30, TA: - | MIA, SA, TA |\n| --round, -r | The round to attack on. | 1 | MIA, SA, TA |\n| --num-features, -f | Specify the number of features | - | MIA, SA |\n| --op-substitution | Attack the SubBytes operation. | 0 |  MIA, SA, TA |\n| --op-shift-rows | Attack the ShiftRows operation. | 0 |  MIA, SA, TA |\n| --op-mix-columns | Attack the MixColumns operation. | 0 |  MIA, SA, TA |\n| --op-add-round-key | Attack the AddRoundKey operation. | 0 |  MIA, SA, TA |\n| --fs-none | Don\\'t use feature selection | SOST | MIA, SA |\n| --fs-pearson | Use pearson for feature selection | SOST | MIA, SA |\n| --fs-sost | Use SOST for feature selection | SOST | MIA, SA |\n| --fs-nicv | Use Nicv for feature selection | SOST | MIA, SA |\n| --leakage-model, -lm | The leakage model used, the default is the hamming weights model, enable the flag to switch to the intermediate values model. | True |  MIA, SA, TA |\n| --debug-mode, -d | 'Enables debug mode, a mode in which more detailed information about the execution of the attack is printed and logged | False |  MIA, SA, TA |\n| --points-of-interest, -i | The number of points of interest. | 5 | TA |\n| --pooled, -p | Perform pooled template attack instead of normal template attack. | False | TA |\n| --spacing, -s | The spacing between the points of interest. | 1 | TA |\n\n### Examples\nRunning just the simple mia attack on the default traces will not always yield the same subkey guess.\nThis behaviour is caused by the number of traces that are used to run the attack. Increasing the number of traces will give more consistent results\n\n```bash\npython sca mia --traces 2000\n```\n\nRunning an attack with custom numpy datasets can be done as follows\n\n```bash\npython sca ta -tf data/custom_traces.npy -kf data/custom_keys.npy -pf data/custom_plain.npy\n```\n\nIt is possible to attack the AES implementation on different encryption rounds as well as the operation to attack.\n\nThis example shows how to attack AES on the shift-rows operation on round three using stochastic attack.\n```bash\npython sca sa --op-shift-rows --round 3\n```\n\nThe program provides multiple feature selection tools to use. The program also allows you to run an attack without any feature selection tool.\nHowever, not using a feature selection tool will sometimes increase the computation time drastically.\n\nThis example shows how to use the pearson feature selection instead of the default SOST feature selection.\n```bash\npython sca mia --fs-pearson\n```\n\n### References\n\nIf you use this code, please consider citing:\n\n    @misc{SCAT,\n      author = {Wolfgang Bubberman and Sengim Karayalcin and Matthias Meester and Olaf Braakman and Stjepan Picek},\n      title  = {{Side-channel Analysis Toolbox}},\n      note   = {{\\url{https://github.com/AISyLab/side-channel-analysis-toolbox}}},\n      year   = {2020}\n    }\n\n\u003c!-- comment to break blocks --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAISyLab%2Fside-channel-analysis-toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAISyLab%2Fside-channel-analysis-toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAISyLab%2Fside-channel-analysis-toolbox/lists"}