Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: use one process to test many keys for mfkey32v2 #191

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

p-l-
Copy link
Contributor

@p-l- p-l- commented Dec 21, 2023

It is done by adding a "server" mode (on STDIN/STDOUT) to mfkey32v2 using --server.

This improves the speed of the decrypt process, as it prevents a lot of Python calls to subprocess.Popen() (and of course, a lot of fork/execve syscalls).

On my laptop, with the same logs (37 records for one block and 37 records for another block), here are the performances, as measured using a simple command:

time echo -e "hw connect\nhf mf elog --decrypt\nhw disconnect" | ./chameleon_cli_main.py
real user sys
Before parallelisation 05ea03d 14m59,277s 14m47,995s 0m8,490s
With parallelisation #187 6m13,513s 35m2,926s 0m22,038s
With item skipping #189 2m42,491s 15m43,425s 0m9,881s
With mfkey32v2 --server this PR 1m55,160s 0m1,315s 0m0,250s

Also, the Python code has been cleaned a bit, mostly to improve readability.

Copy link

Built artifacts for commit 04ee2f4

Firmware

Client

@p-l- p-l- marked this pull request as ready for review December 21, 2023 19:25
@p-l- p-l- force-pushed the enh-hf-mf-elog-continuous-process branch from 04ee2f4 to 7e18ed4 Compare December 31, 2023 12:01
It is done by adding a "server" mode (on STDIN/STDOUT) to `mfkey32v2`
using `--server`.

This improves the speed of the decrypt process, as it prevents a lot
of Python calls to `subprocess.Popen()` (and of course, a lot of
fork/execve syscalls).

On my laptop, with the same logs (37 records for one block and 37
records for another block), here are the performances, as measuerd
using a simple command:

```bash
time echo -e "hw connect\nhf mf elog --decrypt\nhw disconnect" | ./chameleon_cli_main.py
```

|                           |         | real       | user       | sys       |
|---------------------------|---------|------------|------------|-----------|
| Before parallelisation    | 05ea03d | 14m59,277s | 14m47,995s | 0m8,490s  |
| With parallelisation      | RfidResearchGroup#187    | 6m13,513s  | 35m2,926s  | 0m22,038s |
| With item skipping        | RfidResearchGroup#189    | 2m42,491s  | 15m43,425s | 0m9,881s  |
| With `mfkey32v2 --server` | this PR | 1m55,160s  | 0m1,315s   | 0m0,250s  |
@p-l- p-l- force-pushed the enh-hf-mf-elog-continuous-process branch from 473ffa1 to 732c894 Compare August 20, 2024 20:42
@p-l- p-l- marked this pull request as draft August 20, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant