Signing or encrypting the data
-
You are perfectly correct. But if you reach my level of paranoia, you will find that encryption provides little comfort. But you may use it to your hearts content of course.
-
@Anticimex said:
OTA require MANY packages to transfer a typical sketch. For each package a nonce exchange will take place. For this reason, signing is not used for streams. And it does not have to be. A stream should always be checksummed in order to be fully validated. A signature only needs to cover that checksum.
Please bear with me. I just want to be sure I understand it well.
"For this reason, signing is not used for streams." Means that signing is not used when uploading a sketch. Does this lead to a hacker replacing my sketch ?A stream should always be checksummed in order to be fully validated
Checksum will make sure that the sketch is transferred correctly to avoid data corruption, NOT security, correct ?
A signature only needs to cover that checksum
So you propose that a signature must be added with the checksum for security, correct ??
So in brief. OTA is not secured at the moment and the code can be replaced easily with an unsigned one, correct ?
Thanks.
@ahmedadelhosni said:
Please bear with me. I just want to be sure I understand it well.
"For this reason, signing is not used for streams." Means that signing is not used when uploading a sketch. Does this lead to a hacker replacing my sketch ?No, I stated that the sketch is checksummed and that checksum is signed. So no, a hacker won't (probably) be able to replace your sketch. Lest he is able to produce one that yields the exact same checksum AND manages to inject it so that the signed checksum is arrived in a timely manner for the receiver to take it into account.
Checksum will make sure that the sketch is transferred correctly so to avoid data corruption, correct ?
"Sure" in this aspect is a very relative term. But yes, that is it's purpose.
So you propose that a signature must be added with the checksum for security, correct ??
No, I say it is added if signing is enabled. But please be aware that the current version of MYSBootloader does not support signing. Future versions will do.
So in brief. OTA is not secured at the moment and the code can be replaced easily with an unsigned one, correct ?
No, as I said, dualoptiboot should be secure. But the use of CRC as checksum is not as secure as SHA256 would be, so the security is not as good as it can be.
-
@ahmedadelhosni said:
Please bear with me. I just want to be sure I understand it well.
"For this reason, signing is not used for streams." Means that signing is not used when uploading a sketch. Does this lead to a hacker replacing my sketch ?No, I stated that the sketch is checksummed and that checksum is signed. So no, a hacker won't (probably) be able to replace your sketch. Lest he is able to produce one that yields the exact same checksum AND manages to inject it so that the signed checksum is arrived in a timely manner for the receiver to take it into account.
Checksum will make sure that the sketch is transferred correctly so to avoid data corruption, correct ?
"Sure" in this aspect is a very relative term. But yes, that is it's purpose.
So you propose that a signature must be added with the checksum for security, correct ??
No, I say it is added if signing is enabled. But please be aware that the current version of MYSBootloader does not support signing. Future versions will do.
So in brief. OTA is not secured at the moment and the code can be replaced easily with an unsigned one, correct ?
No, as I said, dualoptiboot should be secure. But the use of CRC as checksum is not as secure as SHA256 would be, so the security is not as good as it can be.
@Anticimex Great. now it is very clear :) Thanks a lot
I will order all ICs soon and test this in real life :)
-
@Anticimex Great. now it is very clear :) Thanks a lot
I will order all ICs soon and test this in real life :)
@ahmedadelhosni
Fine, please let stay me informed, because i am very interested too. -
@ahmedadelhosni
Fine, please let stay me informed, because i am very interested too.@meddie Sure. Maybe by the end of that month I may begin in OTA process.
I hope I can find good documentation :) -
@ahmedadelhosni said:
Please bear with me. I just want to be sure I understand it well.
"For this reason, signing is not used for streams." Means that signing is not used when uploading a sketch. Does this lead to a hacker replacing my sketch ?No, I stated that the sketch is checksummed and that checksum is signed. So no, a hacker won't (probably) be able to replace your sketch. Lest he is able to produce one that yields the exact same checksum AND manages to inject it so that the signed checksum is arrived in a timely manner for the receiver to take it into account.
Checksum will make sure that the sketch is transferred correctly so to avoid data corruption, correct ?
"Sure" in this aspect is a very relative term. But yes, that is it's purpose.
So you propose that a signature must be added with the checksum for security, correct ??
No, I say it is added if signing is enabled. But please be aware that the current version of MYSBootloader does not support signing. Future versions will do.
So in brief. OTA is not secured at the moment and the code can be replaced easily with an unsigned one, correct ?
No, as I said, dualoptiboot should be secure. But the use of CRC as checksum is not as secure as SHA256 would be, so the security is not as good as it can be.
one more question: is it possble to run the atmega with dualoptiboot bootloader at 1MHz. For battery use. And use the the encryption and signing and OTA.
-
@meddie Sure. Maybe by the end of that month I may begin in OTA process.
I hope I can find good documentation :)@ahmedadelhosni
fine, thank you in advanced -
one more question: is it possble to run the atmega with dualoptiboot bootloader at 1MHz. For battery use. And use the the encryption and signing and OTA.
-
for a MCU that never enters sleep states, running at 1Mhz can save you some power, compared to running at 8Mhz. But if you plan to enter sleep state, and only wake up periodically, you won't gain that much. As sleepmode current is the same for both 1Mhz and 8Mhz.
One can also argue that if you are using 1Mhz, then the program execution will be longer, compared to 8Mhz. So when it wakes up from sleep mode, it will stay awake for a longer time, if running at 1Mhz, compared to 8Mhz.
-
for a MCU that never enters sleep states, running at 1Mhz can save you some power, compared to running at 8Mhz. But if you plan to enter sleep state, and only wake up periodically, you won't gain that much. As sleepmode current is the same for both 1Mhz and 8Mhz.
One can also argue that if you are using 1Mhz, then the program execution will be longer, compared to 8Mhz. So when it wakes up from sleep mode, it will stay awake for a longer time, if running at 1Mhz, compared to 8Mhz.
@tbowmo Good points. Neven thought about it as I flash 1Mhz always.
I may try power consumption using 8Mhz in a new sensor node.
Thanks for the info. -
Any one tried to run a atmega with encryption and software signing? And with Hardware Signing?
-
Yes.