* (Small) bias in generation of random passkeys for pairing
@ 2019-06-19 16:24 Pavel Machek
2019-06-20 12:00 ` Stefan Seyfried
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2019-06-19 16:24 UTC (permalink / raw)
To: kernel list, security, linux-bluetooth, johan.hedberg, marcel
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
Hi!
There's a (small) bias in passkey generation in bluetooth:
get_random_bytes(&passkey, sizeof(passkey));
passkey %= 1000000;
put_unaligned_le32(passkey, smp->tk);
(there are at least two places doing this).
All passkeys are not of same probability, passkey "000000" is more
probable than "999999", but difference is small.
Do we care?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: (Small) bias in generation of random passkeys for pairing
2019-06-19 16:24 (Small) bias in generation of random passkeys for pairing Pavel Machek
@ 2019-06-20 12:00 ` Stefan Seyfried
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Seyfried @ 2019-06-20 12:00 UTC (permalink / raw)
To: Pavel Machek, kernel list, security, linux-bluetooth,
johan.hedberg, marcel
Hi Pavel,
Am 19.06.19 um 18:24 schrieb Pavel Machek:
> Hi!
>
> There's a (small) bias in passkey generation in bluetooth:
>
> get_random_bytes(&passkey, sizeof(passkey));
> passkey %= 1000000;
> put_unaligned_le32(passkey, smp->tk);
>
> (there are at least two places doing this).
>
> All passkeys are not of same probability, passkey "000000" is more
> probable than "999999", but difference is small.
It is slightly different IMHO.
Unsigned 32bits passkey assumed (and all users I found were u32),
the passkeys "000000" to "967295" are slightly more probable than
"967296" to "999999".
If my math is right (which I doubt), the difference in probability
for both entities is 4294:4293.
> Do we care?
I, personally, don't (yet).
But then, I'm not a real security expert.
Have fun,
--
Stefan Seyfried
"For a successful technology, reality must take precedence over
public relations, for nature cannot be fooled." -- Richard Feynman
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-20 12:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 16:24 (Small) bias in generation of random passkeys for pairing Pavel Machek
2019-06-20 12:00 ` Stefan Seyfried
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).