This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How I use sd110 function decryption data to cleartext?

Hello, every: I have success to use sd_ecb_block function to encryption data. But I am not find how use this function to do decryption. Please teach me how to use this function, or give me a demo code. Thanks very much.

Parents
  • There is no hardware block to do ECB decryption in the nRF51822, and ECB encryption/decryption can be very insecure (see this Wikipedia page for an example).

    I'd therefore strongly recommend you to instead use a AES mode which uses a hardware encryption block both for encryption and decryption, for example the counter mode. We don't currently have any example code for this, but it should be fairly easy to implement yourself.

  • I understand why ECB is insecure. I am trying to do a CBC AES encryption/decryption function on the 1422/1822 and I cannot find any information on what the underlying hardware is doing. Posts keep saying that there are no examples but it's easy and refers back to the wiki. I know how to do CBC and my app already does that on other hardware. I want to make use the the hardware acceleration for ECB to do the bulk of the math. Can someone tell me what the nrf_ecb_crypt function is doing so I can leverage the ECB part and do my own block chaining. The header files says that it will encrypt and decrypt, however when I send in a plaintext string to encrypt then decrypt I get back garbage.

    -Jim

Reply
  • I understand why ECB is insecure. I am trying to do a CBC AES encryption/decryption function on the 1422/1822 and I cannot find any information on what the underlying hardware is doing. Posts keep saying that there are no examples but it's easy and refers back to the wiki. I know how to do CBC and my app already does that on other hardware. I want to make use the the hardware acceleration for ECB to do the bulk of the math. Can someone tell me what the nrf_ecb_crypt function is doing so I can leverage the ECB part and do my own block chaining. The header files says that it will encrypt and decrypt, however when I send in a plaintext string to encrypt then decrypt I get back garbage.

    -Jim

Children
No Data
Related