{"action":"created","issue":{"url":"https://api.github.com/repos/Proxmark/proxmark3/issues/209","repository_url":"https://api.github.com/repos/Proxmark/proxmark3","labels_url":"https://api.github.com/repos/Proxmark/proxmark3/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/Proxmark/proxmark3/issues/209/comments","events_url":"https://api.github.com/repos/Proxmark/proxmark3/issues/209/events","html_url":"https://github.com/Proxmark/proxmark3/pull/209","id":203311171,"number":209,"title":"Adds random nonce (r) option to `hf mf sim`.","user":{"login":"micolous","id":246847,"avatar_url":"https://avatars.githubusercontent.com/u/246847?v=3","gravatar_id":"","url":"https://api.github.com/users/micolous","html_url":"https://github.com/micolous","followers_url":"https://api.github.com/users/micolous/followers","following_url":"https://api.github.com/users/micolous/following{/other_user}","gists_url":"https://api.github.com/users/micolous/gists{/gist_id}","starred_url":"https://api.github.com/users/micolous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micolous/subscriptions","organizations_url":"https://api.github.com/users/micolous/orgs","repos_url":"https://api.github.com/users/micolous/repos","events_url":"https://api.github.com/users/micolous/events{/privacy}","received_events_url":"https://api.github.com/users/micolous/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-26T07:55:51Z","updated_at":"2017-01-26T10:29:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Proxmark/proxmark3/pulls/209","html_url":"https://github.com/Proxmark/proxmark3/pull/209","diff_url":"https://github.com/Proxmark/proxmark3/pull/209.diff","patch_url":"https://github.com/Proxmark/proxmark3/pull/209.patch"},"body":"This makes the PM3 generate pseudo-random nonces rather than sequential nonces, to make it act a bit more like a \"real\" MFC card.  A reader may otherwise be able to detect the PM3 probing based on the predictable nonces and throw different authentication challenges (or refuse to authenticate at all).\r\n\r\nThe code includes an implementation of a rand-like function (prand), similar to the one from libc, which is seeded automatically based on the time it takes between the PM3 starting up and the first call to the RNG.\r\n\r\nThis isn't cryptographically random, but should be \"good enough\" to be able to evade basic detection.\r\n\r\nThis is [a port of a similar patch I wrote for @iceman1001's branch](https://github.com/micolous/proxmark3/commit/3508ed9eb5257ede1e32039e37e9af0b0060ed83), except this uses a different set of [LCG](https://en.wikipedia.org/wiki/Linear_congruential_generator) parameters.\r\n\r\nI haven't seen any readers in the wild attempt to detect the sequential nonces (the ones in Proxmark upstream `n*=7` are slightly harder to predict than @iceman1001's branch `n++`), but I suspect that it is possible.\r\n\r\nI wrote this code while trying to troubleshoot key extraction with one particularly difficult reader, but it turns out that I just had another bug in my code."},"comment":{"url":"https://api.github.com/repos/Proxmark/proxmark3/issues/comments/275355805","html_url":"https://github.com/Proxmark/proxmark3/pull/209#issuecomment-275355805","issue_url":"https://api.github.com/repos/Proxmark/proxmark3/issues/209","id":275355805,"user":{"login":"pwpiwi","id":7026004,"avatar_url":"https://avatars.githubusercontent.com/u/7026004?v=3","gravatar_id":"","url":"https://api.github.com/users/pwpiwi","html_url":"https://github.com/pwpiwi","followers_url":"https://api.github.com/users/pwpiwi/followers","following_url":"https://api.github.com/users/pwpiwi/following{/other_user}","gists_url":"https://api.github.com/users/pwpiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/pwpiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwpiwi/subscriptions","organizations_url":"https://api.github.com/users/pwpiwi/orgs","repos_url":"https://api.github.com/users/pwpiwi/repos","events_url":"https://api.github.com/users/pwpiwi/events{/privacy}","received_events_url":"https://api.github.com/users/pwpiwi/received_events","type":"User","site_admin":false},"created_at":"2017-01-26T10:29:11Z","updated_at":"2017-01-26T10:29:11Z","body":"Looks good but I currently don't have access to PM3 and a reader. Did you test both attacks?"}}
{"actor":{"display_login":"pwpiwi"}}