Limit pyexception code to Python >= 3.10
[RRG-proxmark3.git] / tools / hitag2crack / crack2 / README.md
blob1f922dbece4705ce9200e5358db6b5aca1c37dc1
1 ht2crack2 suite
5 Build
6 -----
8 Edit ht2crack2buildtable.c and set the DATAMAX, NUM_BUILD_THREADS and NUM_SORT_THREADS values.
9 These are important if you want it to run quickly.  Ideally set DATAMAX to the largest value
10 that you can get away with and set NUM_BUILD_THREADS and NUM_SORT_THREADS to the number of
11 virtual cores you have available, which MUST be a power of 2.  NUM_BUILD_THREADS MUST be >=
12 NUM_SORT_THREADS.
14 Calculate DATAMAX = free RAM available / 65536, and then round down to a power of 10.
16 The Makefile is configured for linux.  To compile on Mac, edit it and swap the LIBS= lines.
18 ```
19 make clean
20 make
21 ```
23 Run ht2crack2buildtable
24 -----------------------
26 Make sure you are in a directory on a disk with at least 1.5TB of space.
28 ```
29 ./ht2crack2buildtable
30 ```
32 Wait a very long time.  Maybe a few days.
34 This will create a directory tree called table/ while it is working that will contain
35 files that will slowly build up in size to approx 20MB each.  Once it has finished making
36 these unsorted files, it will sort them into the directory tree sorted/ and remove the
37 original files.  It will then exit and you'll have your shiny table.
40 Test with ht2crack2gentests
41 ---------------------------
43 ```
44 ./ht2crack2gentests NUMBER_OF_TESTS
45 ```
47 to generate NUMBER_OF_TESTS test files.  These will all be named
48 keystream.key-KEYVALUE.uid-UIDVALUE.nR-NRVALUE
50 Test a single test with
52 ```
53 ./runtest.sh KEYSTREAMFILE
54 ```
55 or manually with
57 ```
58 ./ht2crack2search KEYSTREAMFILE UIDVALUE NRVALUE
59 ```
61 or run all tests with
62 ```
63 ./runalltests.sh
64 ```
66 Feel free to edit the shell scripts to find your tools.  You might want to create a
67 symbolic link to your sorted/ directory called 'sorted' to help ht2crack2seach find the
68 table.
70 If the tests work, then the table is sound.
73 Search for key in real keystream
74 --------------------------------
76 Recover 2048 bits of keystream from the target RFID tag with the RFIDler.  You will have had
77 to supply an NR value and you should know the tag's UID (you can get this using the RFIDler).
79 ```
80 ./ht2crack2search KEYSTREAMFILE UIDVALUE NRVALUE
81 ```