{"id":15049290,"url":"https://github.com/aczid/crypto1_bs","last_synced_at":"2025-04-07T07:08:20.696Z","repository":{"id":52410032,"uuid":"56089546","full_name":"aczid/crypto1_bs","owner":"aczid","description":"Bitsliced Crypto-1 brute-forcer","archived":false,"fork":false,"pushed_at":"2024-03-14T19:51:50.000Z","size":137,"stargazers_count":209,"open_issues_count":9,"forks_count":78,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-31T05:06:34.315Z","etag":null,"topics":["bitslicing","c99","craptev1","crapto1","crypto1","cryptography","gcc","iso14443a","libnfc","mifare","proxmark3"],"latest_commit_sha":null,"homepage":"","language":"C","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/aczid.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":"2016-04-12T18:53:52.000Z","updated_at":"2025-03-11T15:49:28.000Z","dependencies_parsed_at":"2024-09-29T01:20:57.825Z","dependency_job_id":"c348ac29-738e-411d-b8fc-b0a46ed881e1","html_url":"https://github.com/aczid/crypto1_bs","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/aczid%2Fcrypto1_bs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aczid%2Fcrypto1_bs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aczid%2Fcrypto1_bs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aczid%2Fcrypto1_bs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aczid","download_url":"https://codeload.github.com/aczid/crypto1_bs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"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":["bitslicing","c99","craptev1","crapto1","crypto1","cryptography","gcc","iso14443a","libnfc","mifare","proxmark3"],"created_at":"2024-09-24T21:19:32.153Z","updated_at":"2025-04-07T07:08:20.665Z","avatar_url":"https://github.com/aczid.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Bitsliced Crypto-1 brute-forcer\n===============================\n\nA pure C(99) implementation of the [Crypto-1 cipher](https://en.wikipedia.org/wiki/Crypto-1) using the method of [bitslicing](https://en.wikipedia.org/wiki/Bit_slicing), which uses GNU vector extensions to be portable across SSE/AVX/AVX2 supporting architectures while offering the highest amount of possible parallelism.\n\n\nBackground\n----------\n\nI wrote this as a patch for [piwi's imlementation](https://github.com/pwpiwi/proxmark3/tree/hard_nested/) of the research documented in [Ciphertext-only cryptanalysis on hardened Mifare Classic cards](http://www.cs.ru.nl/~rverdult/Ciphertext-only_Cryptanalysis_on_Hardened_Mifare_Classic_Cards-CCS_2015.pdf) after reading (most of) the paper, while it was still under [active development](http://www.proxmark.org/forum/viewtopic.php?id=2120).\n\nAfter my development of a somewhat naive brute-forcer, another implementation of the same attack surfaced, [CraptEV1](http://crapto1.netgarage.org/).\nWith all of its clever tricks that code pushed me to improve my own, eventually reaching a significant (8-10x) speedup.\nBesides that, its publication as a library also inspired the included libnfc application that demonstrates the CraptEV1 attack code + my bitsliced cracker.\n\nThe proxmark3 patch, as well as the code for piwi's branch that it applies to, have since been merged into [Iceman1001's fork](https://github.com/iceman1001/proxmark3/) along with many other experimental improvements to the proxmark3 codebase.\nMuch more work has been done in the project since my patch, so I would advise proxmark3 users to use that fork to test the code.\nMy original patch is included for completeness as `pwpiwi_proxmark3_hard_nested.patch`.\n\nEven later still, this code actually got merged into the upstream [Proxmark3 codebase](https://github.com/Proxmark/proxmark3)! More importantly, it was included as part of an entirely new variation on the attack by [@pwpiwi](https://github.com/pwpiwi/), which requires fewer nonces and achieves a better reduction of potential states, while also improving the brute-forcing phase, ending up as another order of magnitude faster in practice.\nThis improved solution is also usable with a branch of [mfoc](https://github.com/vk496/mfoc/tree/hardnested) by [@vk496](https://github.com/vk496).\n\nTools\n-----\n\n~~The following tools are only available for / tested on 64-bit Linux.~~\nSupport for 32-bit and 64-bit machines was tested on various Intel/ARM based Linux platforms.\nOSX compatibility issues were resolved by [@unkernet](https://github.com/unkernet/).\n\nIf you want to use the following stand-alone binaries, you will need the original CraptEV1 / Crapto1 source packages.\nFor convenience, and because redistribution of CraptEV1 is not allowed, I've added make targets `get_craptev1` and `get_crapto1` to fetch and extract these packages to the current working directory.\nI have included a conversion of the test file `0xcafec0de.txt` included in the CraptEV1 package to the binary format used by the `proxmark3/hard_nested` branch.\n\n`solve_bs` is analogous to CraptEV1 `solve` and works on .txt files using the bitsliced crypto-1 cracker\n\n    $ ./solve_bs craptev1-v1.1/0xcafec0de.txt 0xcafec0de\n\n`solve_piwi` uses CraptEV1 on .bin files as gathered by piwi's PM3 code\n\n    $ ./solve_piwi 0xcafec0de.bin\n\n`solve_piwi_bs` does the same but uses the bitsliced cracker\n\n    $ ./solve_piwi_bs 0xcafec0de.bin\n\n`libnfc_crypto1_crack` uses libnfc to demonstrate the CraptEV1 code using the bitsliced cracker\n\n    $ ./libnfc_crypto1_crack 000000000000 0 A 4 A\n\n\nAcknowledgements\n----------------\n\nSpecial thanks to Carlo Meijer, Roel Verdult, piwi and bla.\n\n\nLicense\n-------\n\nAll the code in this repository is made available under the MIT license, except for the files `pwpiwi_proxmark3_hard_nested.patch` and `libnfc_crypto1_crack.c`, which are GPLv2 due to deriving from respectively Proxmark3 and MFOC.\n\nCopyright (c) 2015-2016 Aram Verstegen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faczid%2Fcrypto1_bs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faczid%2Fcrypto1_bs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faczid%2Fcrypto1_bs/lists"}