security in NRF24L01+

Hello everybody!

I want to use this module between two micro controllers...
the data does not matter because I transmit a constant Byte always. But it is important that my receiver receives the data ONLY from my transmitter.
I read the datasheet. It was written in it that the NRF has a 5 Byte address.
I want to open the Door of my house with NRF.

my question:
How secure is it??? (NRF module)

nRF24 has no hardware built-in encryption, if that's what you mean. Not that it would help you in this case - single byte (or any number of constant bytes) seems very vulnerable to a replay attack.

The 5 byte address gives a total of 2555 variations. It should not be easy to guess. Also you can choose one of several (IIRC 100) channels. To receive the data someone would have to get both the address and the channel correct.

You could choose low power transmission to reduce the range over which the signal can be detected.

You could further increase the security by requiring a conversation to take place between your hand unit and the lock controller before it would agree to open the lock.

In the course of that conversation the two units could be required to change channel - though that runs the risk of confusion leading to a complete failure of communication.

An additional strategy would be a time delay after a failed attempt with the time delay doubling after each failure.

…R
Simple nRF24L01+ Tutorial

Robin2:
The 5 byte address gives a total of 2555 variations. It should not be easy to guess. Also you can choose one of several (IIRC 100) channels. To receive the data someone would have to get both the address and the channel correct.

There is a simple possibility to detect used addresses if there is some traffic and you find out the channel,
the NRF can be set to 2 byte addresses and if you use the preamble byte as one of them,
there are only 256 possibilties to detect any address.
If you have found the used address you can grab all packets on that address undetected.

But with the little traffic that the opening would generate there is only a very small chance to find the address.

Whandall:
the NRF can be set to 2 byte addresses and if you use the preamble byte as one of them,
there are only 256 possibilties to detect any address.

Interesting, but ...

What is the preamble byte and who is the "you" that should use it? Is it that the guy who wants the security might accidentally use it thereby making life easier for the hacker?

Or is it the hacker who must use it - which seems to imply that he can somehow reduce 65536 options down to 256

...R

The preamble byte is 0x55 or 0xAA dependig on the highest bit of the adr MSB.

See nRF24L01+ sniffer for reference.

Whandall:
There is a simple possibility to detect used addresses if there is some traffic and you find out the channel,
the NRF can be set to 2 byte addresses and if you use the preamble byte as one of them,
there are only 256 possibilties to detect any address.
If you have found the used address you can grab all packets on that address undetected.

But with the little traffic that the opening would generate there is only a very small chance to find the address.

thanks for answer...
what do you mean... what is the "traffic"?

I read the datasheet ---> https://www.sparkfun.com/datasheets/Components/SMD/nRF24L01Pluss_Preliminary_Product_Specification_v1_0.pdf

but I don't understand the use of preamble byte...

the_SAT:
what do you mean... what is the "traffic"?

In this context it's just the number of packets.
You have to listen to 256 different addresses which can be done in chunks of 6,
and this is after the discovery of the correct channel.
So if there are only very few packets, the chance of grabbing one is pretty small
unless you scale up the number of receiving NRFs to 43.

the_SAT:
I read the datasheet ---> https://www.sparkfun.com/datasheets/Components/SMD/nRF24L01Pluss_Preliminary_Product_Specification_v1_0.pdf

but I don't understand the use of preamble byte...

So it seems the NRFs are save enough for people of your knowledge level,
even without any encryption. :wink:

The link I provided is a good explanation of the inner workings of the NRF format.

NRFs have been used in wireless keyboards from major brands,
despite the fact that they are inherently insecure and the used 'encryption' is trivial.

Robin2:
The 5 byte address gives a total of 2555 variations. It should not be easy to guess. Also you can choose one of several (IIRC 100) channels. To receive the data someone would have to get both the address and the channel correct.

You could choose low power transmission to reduce the range over which the signal can be detected.

You could further increase the security by requiring a conversation to take place between your hand unit and the lock controller before it would agree to open the lock.

In the course of that conversation the two units could be required to change channel - though that runs the risk of confusion leading to a complete failure of communication.

An additional strategy would be a time delay after a failed attempt with the time delay doubling after each failure.

…R
Simple nRF24L01+ Tutorial

Thanks for your answer!
the conversation between two micro controllers is a good idea!!!

for example the first uC makes a really random byte and transmits it.
then, the second uC makes some changes to the byte and then transmits it to first uC.(constant algorithm)
if Everything is right, uC opens the Door.

Whandall:
The preamble byte is 0x55 or 0xAA dependig on the highest bit of the adr MSB.

Thanks for the interesting link.

From what I can figure out that guy's sniffer only works if he knows 4 bytes of the 5 byte address - it seems to be a system to monitor traffic within a network where the addresses of the modules all use the same 4 bytes and use the 5th byte to identify the different units.

If my interpretation is correct then the system represents no meaningful risk for the OP.

...R

the_SAT:
for example the first uC makes a really random byte and transmits it.
then, the second uC makes some changes to the byte and then transmits it to first uC.(constant algorithm)
if Everything is right, uC opens the Door.

I think I would have messages that are longer than a single byte. An nRF24 can send up to 32 bytes in a single message.

...R

Robin2:
From what I can figure out that guy's sniffer only works if he knows 4 bytes of the 5 byte address

It works perfectly well with two byte address configuration and the high byte being one of the two preamble possibilities.

You use the received packets to figure out the address that is really used.

Robin2:
I think I would have messages that are longer than a single byte. An nRF24 can send up to 32 bytes in a single message.

…R

yes! you are right…
but I think the conversation between two uC (s) before opening the Door is a good idea and it increases the security level.

My knowledge level isn't very low!?!?!?! :o :confused:
But I can only speak a bit English! :slight_smile:

however... thanks a lot!

Don't be offended, you probably know more about NRFs than most people,
but asking about the security of a NRF communication and the

but I don't understand the use of preamble byte...

shows that there is more to learn. :wink:

Whandall:
It works perfectly well with two byte address configuration and the high byte being one of the two preamble possibilities.

I can understand how the “proper” preamble byte is used to get the wireless in sync but I don’t understand why one would also put the preamble byte as one of the address bytes? There is nothing about that in your sniffer link.

Does that have the effect that it treats the real preamble byte and the first (preamble) address byte as a long preamble as a way to trick it into working with what, in effect, is a single byte address?

But then the datasheet says that an address length below 3 is illegal? So how can it work with a 2 byte address?

…R

Robin2:
Does that have the effect that it treats the real preamble byte and the first (preamble) address byte as a long preamble as a way to trick it into working with what, in effect, is a single byte address?

Exactly.

Whandall:
Exactly.

But what about the apparent requirement to have a minimum of 3 address bytes?

...R

The two byte format is supported by the chip, but that fact is not documented,
it's undefined behaviour that happens to be constant and useful.

The preamble trick works too, probably due to a very simple internal state machine.

Whandall:
The two byte format is supported by the chip, but that fact is not documented,

Does that mean that you set the address length to 3 (the minimum) but actually only upload 2 address bytes?

(Sorry for being slow).

And, just to bring all this navel gazing back into focus for the OP - a hacker is still left with the task of trying up to 256 address bytes before he stumbles on the 2nd (from top) byte of the OP’s chosen address. And, as you said in Reply #3 that still leaves the OP with a reasonable degree of security - especially if authorization requires a conversation between the two devices.

By the way (and this is mainly addressed to the OP) there is no reason why the conversation could not include an agreement to use a different address on the next occasion (with some risk that the two systems become confused and would need a fallback arrangement).

I guess another strategy to improve security is for the door unit to talk to the hand unit using a different address (i.e. NOT auto-ack) and particularly, an address that uses a different real preamble byte so that a hacker listening cannot accidentally receive messages from both units.

…R

PS … it is disappointing that a system that, on the face of it, has a high level of security is so easily compromised. But perhaps it was designed more for reliability than for security.