This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR6989: Problems while using Crypto Bootloader

Part Number: MSP430FR6989
Other Parts Discussed in Thread: MSP-FET

Hi everyone,

Does anyone know if there is more related information about how to update keys and send encrypted data to the device? I have read and followed step by step the slau 657 document, but I am not able to make correct use of it. The downloaded firmware is the one which lets you use both ROM based and crypto bootloader. I did it to be able to restore all data in case of getting lost while using crypto mode.

My main doubts are the following ones:

-How does the nonce exactly work? Does it have to be applied in the same way to update keys or to send data?

-Do the key version and data version need to be the same?

-If I want to send again the same data to the device, does this new sent data need another version update or can it remain the same?

I am quite new in this so I would appreciate your help. Thank you so much!

Cristian

  • Hi, Cristian,

    Thanks to select the MSP430 device for your application. I will check with expertise and come back to you.

    Regards,
    Lixin
  • Hi Cristian,

    Thank you for using the Crypto-Bootloader and MSP430. Please see my comments below:

    Cristian Rogel said:
    -How does the nonce exactly work? Does it have to be applied in the same way to update keys or to send data?

    The initialization vector (IV) is an initial value to start the encryption process. You want the IV to be random or unpredictable so that messages are encrypted differently every time. I.e. if you encrypt the same message with the same key twice, you would get two different results because the IV is different.

    The IV is expected to be a nonce because it should be used only once.

    The IV can be different between data and keys.

    Cristian Rogel said:
    -Do the key version and data version need to be the same?

    No, they can be different.

    Cristian Rogel said:
    -If I want to send again the same data to the device, does this new sent data need another version update or can it remain the same?

    The bootloader has "downgrade" protection which means that you can't send an older version of the firmware. However, you can send the same version. Note that all firmware versions should be encrypted; however the downgrade protection is helpful to prevent an attack exploiting an application vulnerability from an older release.

    I.e.

    - Your version 1.0 has a flaw which can be exploited by attackers.

    - You find out, fix it, and update to version 1.1.

    - An attacker can't decrypt firmware 1.0 or 1.1, but they have access to the encrypted firmware, so they try to download version 1.0 to exploit the vulnerability.

    - With downgrade protection enabled, the attacker can't go back to 1.0.

    Regards,

    Luis R

  • Hi Luis,

    Thank you so much for your support. Looking at the response you gave me about the nonce, does it mean that if I want to upload the keys or data I couldn't be able to use the same nonce? Does the last used nonce remain in the Non-volatile memory or similar?

    Then, I am using a custom Labview program to transfer all the data between the computer and the device, as I am using an FT232R to do the hardware invocation of the bootloader. The FT232R has a limit buffer of 256 bytes, and I am trying to send the blinking led program that can be found by default in Code Composer. Once I encrypt its txt, there are three data frames to be sent individually, separated by @A000. The last data frame is formed by exactly 256 bytes to which will be also added the header, the CRC, the data Lenght...being finally more than 260 bytes. Due to this, I think that I am receiving an error 0x51 (header error) from the device, as it exceeds the buffer size, but I don't really know how to solve it. I tried to divide each frame into groups of at most 200 bytes, to empty the buffer and then continue sending the rest of the frame but didn't work.

    Finally, always that I try to send those three frames, for the first frame I receive a 05 message from the device (cryptographic error), then a 00 message for the second one (successful operation) and finally the 51 error message. Only in very punctual cases, I received two 00 messages and then the 51 error message. If I try to send all those frames again with a different nonce, the device simply sends me 07 error message (Unknown command) all the time, so I have to download again the crypto firmware through ROM based bootloader in order to restart original values (or that is what I think that it does). 

    Below you will find attached an example of the encrypted file that I am using. 

    @A000
    01 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB ED 00 00
    32 47 E7 39 50 9E 2C 89 E3 7E E8 B5 7F B2 BB D6
    2A 66 E6 EF 7D 33 29 E4 46 6F C8 4F 21 EF 32 79
    A3 CB AE 4C 26 1F C5 4B 76 CF E3 7C C3 1F 8F 52
    CF 94 34 B0 7E 0B D8 1F 3D E4
    @A000
    01 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EE 00 00
    BF 74 11 0B 2F C4 5B C6 BA 4C FD D5 80 87 9D CC
    FC 37 A0 3F DA 8C B8 3D 82 CB AE A8 E1 9E 71 F2
    6B 49 4C 70 48 9B F4 A6 C6 24
    @A000
    01 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EF 00 00
    16 61 8D 98 DA 1A E5 00 F0 2C AA 66 E9 9C 45 53
    88 37 0A 71 9F 71 54 AD 59 77 DF 42 91 A1 7E 4B
    AD B6 4C 18 E8 7C 62 C3 93 C2 A8 DF 54 D0 17 76
    A7 CF 50 AA 2E 33 59 3D BF 9D 57 F5 53 AD 2B 69
    67 82 1B 03 10 5F EC A7 AE 6B 1A 47 62 05 F7 10
    AF F0 9E 1B A5 4B 14 E7 77 2B 93 34 94 F2 78 2D
    FD C2 16 0D C0 0C D5 05 10 30 38 D0 BF A5 DB FE
    D9 C2 6B 7A E2 0C C8 8B 37 29 91 CC 8C AF 0B C9
    F1 CA D4 75 2D 26 A5 97 0C 13 D1 81 2C A9 90 7A
    B3 C8 2F 91 19 9C C5 4B 6B 09 32 82 8A 9B AA 08
    92 BA 10 CB CB 1E AB 9B 31 67 40 4F A3 9F AD 1F
    A8 83 3A FD 34 4E E8 0D 83 30 F6 40 F3 67 DB 40
    E8 A2 1F D6 D2 A3 FD DF 23 34 33 EB D0 40 F4 9E
    1B F0 E0 28 9A C9 A8 A8 14 EA 8B 24 BA 65 E9 B6
    95 BB D9 FB A0 E3 A3 B3 43 E2 32 D6 23 05 07 F6
    q

    Regards,

    Cristian

  • Hi Cristian,

    Just wanted to let you know that we didn't forget about your question, we are working on it and we will get back to you as soon as we have an answer.

    Regards,

    Luis R

  • Hi Cristian

    "Looking at the response you gave me about the nonce, does it mean that if I want to upload the keys or data I couldn't be able to use the same nonce? Does the last used nonce remain in the Non-volatile memory or similar?"
    Yes, Luis have mentioned before the nonce just can be used once. And that just use to make the down load image to be different even they are with same keys and .txt image data.
    Have you try the MSP-FET or BSL rocket to down load the encrypted image that you post before?
    Could you send me all file about your image code?(Both .txt image and encrypted image and the key file)
    Do you have a Saleae ? If you have one , could you capture the UART communication wave for me?

    Best regards
    Gary
  • Hi Cristian

    Any update about this problem?

    Best regards

    Gary

**Attention** This is a public forum