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

Encryption using user defined keys

Hi Team,

We are working on project where we are trying to encrypt the advertisement data (non-connectable) using our own defined keys.

currently I have been through the links and documentation provided over website where there enough details provided.

I would like to know, if there is a way to have user defined keys for encryption instead of using methods provided for all advertisement packets weather its connectable or non-connectable.

If any example or any pointer would be useful for our development.

Thanks,

Parents
  • Hello again, Zero.cool!

    As @Awneil mentions, this will not have anything to do with BLE or Nordic specifically, it is more a problem of how to encrypt and decrypt arbitrary data.
    Your chosen method for transporting this data is through advertising, most likely as part of the "manufacturing specific data" field of an advertisement. I note this just to have it out of the way, since it does not matter for the next steps.

    So, the problem in this case becomes how to encrypt the data on one device, and decrypt the data on another device. This is the base problem of the whole cryptographic research field.
    There is "endless" possibilities for how to actually implement the encryption & decryption, and which method you should choose depends on your application and its use-case. What are your requirements here?

    I see from your comment to Awneil, that you say you do not want to use any provided algorithm. 
    The task of designing and implementing encryption on your own is something I can not recommend, since it is a huge undertaking, which is 'guaranteed' to yield an inferior cryptographic end-product compared to using an existing implementation / design.  Luckily, the nrf_crypto library have already implemented a lot of cryptographically advanced and recognized methods for encryption. All you have to do is decide on your cryptographic requirements. To see how you may go about using the different algorithms / curves here, you should take a look at the existing cryptographic examples - these demonstrate how to apply the nrf_crypto library to an application.

    In conclusion: I recommend that you take a look at the nrf_crypto library and provided cryptographic examples, choose a method you would like to try out, and apply it to an existing project's advertising data.
    You can use the BLE Beacon peripheral example as a starting point for this testing, and attempt to encrypt and decrypt the contents of the manufacturing specific field of the advertisement.

    Are these resources and guidance along the lines of what you were looking for?
    If you are adamant that you would not like to use an existing algorithm / cryptographic design - and instead would like to implement it on your own - then I am not sure what I may do to help you other than to point you in the direction of existing literature on cryptography.

    Best regards,
    Karl

Reply
  • Hello again, Zero.cool!

    As @Awneil mentions, this will not have anything to do with BLE or Nordic specifically, it is more a problem of how to encrypt and decrypt arbitrary data.
    Your chosen method for transporting this data is through advertising, most likely as part of the "manufacturing specific data" field of an advertisement. I note this just to have it out of the way, since it does not matter for the next steps.

    So, the problem in this case becomes how to encrypt the data on one device, and decrypt the data on another device. This is the base problem of the whole cryptographic research field.
    There is "endless" possibilities for how to actually implement the encryption & decryption, and which method you should choose depends on your application and its use-case. What are your requirements here?

    I see from your comment to Awneil, that you say you do not want to use any provided algorithm. 
    The task of designing and implementing encryption on your own is something I can not recommend, since it is a huge undertaking, which is 'guaranteed' to yield an inferior cryptographic end-product compared to using an existing implementation / design.  Luckily, the nrf_crypto library have already implemented a lot of cryptographically advanced and recognized methods for encryption. All you have to do is decide on your cryptographic requirements. To see how you may go about using the different algorithms / curves here, you should take a look at the existing cryptographic examples - these demonstrate how to apply the nrf_crypto library to an application.

    In conclusion: I recommend that you take a look at the nrf_crypto library and provided cryptographic examples, choose a method you would like to try out, and apply it to an existing project's advertising data.
    You can use the BLE Beacon peripheral example as a starting point for this testing, and attempt to encrypt and decrypt the contents of the manufacturing specific field of the advertisement.

    Are these resources and guidance along the lines of what you were looking for?
    If you are adamant that you would not like to use an existing algorithm / cryptographic design - and instead would like to implement it on your own - then I am not sure what I may do to help you other than to point you in the direction of existing literature on cryptography.

    Best regards,
    Karl

Children
No Data
Related