<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Encryption using user defined keys</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66465/encryption-using-user-defined-keys</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Sep 2020 08:38:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66465/encryption-using-user-defined-keys" /><item><title>RE: Encryption using user defined keys</title><link>https://devzone.nordicsemi.com/thread/271986?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 08:38:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71059a5a-9a4b-4f11-9e43-b9da4dc10e25</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again, Zero.cool!&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;Your chosen method for transporting this data is through advertising, most likely as part of the &amp;quot;manufacturing specific data&amp;quot; field of an advertisement. I note this just to have it out of the way, since it does not matter for the next steps.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;There is &amp;quot;endless&amp;quot; possibilities for how to actually implement the encryption &amp;amp; decryption, and which method you should choose depends on your application and its use-case. What are your requirements here?&lt;br /&gt;&lt;br /&gt;I see from your comment to Awneil, that you say you do not want to use any provided algorithm.&amp;nbsp;&lt;br /&gt;The task of designing and implementing encryption on your own is something &lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;I can not recommend&lt;/strong&gt;, since it is a &lt;em&gt;huge&lt;/em&gt; undertaking, which is &amp;#39;guaranteed&amp;#39; to yield an inferior cryptographic end-product compared to using an existing implementation / design.&amp;nbsp; Luckily, the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_crypto.html"&gt;nrf_crypto library&lt;/a&gt;&amp;nbsp;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 &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/crypto_examples_nrf_crypto.html"&gt;cryptographic examples&lt;/a&gt;&amp;nbsp;- these demonstrate how to apply the nrf_crypto library to an application.&lt;br /&gt;&lt;br /&gt;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&amp;#39;s advertising data.&lt;br /&gt;You can use the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_beacon.html"&gt;BLE Beacon peripheral example&lt;/a&gt;&amp;nbsp;as a starting point for this testing, and attempt to encrypt and decrypt the contents of the manufacturing specific field of the advertisement.&lt;br /&gt;&lt;br /&gt;Are these resources and guidance along the lines of what you were looking for?&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Encryption using user defined keys</title><link>https://devzone.nordicsemi.com/thread/271971?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 08:13:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10997475-5296-45ff-91b0-687b7277d81b</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;again, it&amp;#39;s nothing specific to BLE or Nordic - so &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt; &lt;/em&gt;general examples will apply&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Encryption using user defined keys</title><link>https://devzone.nordicsemi.com/thread/271910?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 02:29:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b971195-481d-49fd-8cba-2fedd05adde0</guid><dc:creator>Zero.cool</dc:creator><description>&lt;p&gt;yes, I am requesting is , is there any example or pointer which I can refer?&lt;br /&gt;Any pointer &lt;a href="https://devzone.nordicsemi.com/members/karl-ylvisaker"&gt;Karl Ylvisaker&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Encryption using user defined keys</title><link>https://devzone.nordicsemi.com/thread/271889?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 21:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aea882a-e96d-47a2-af8e-2bcaa355d45f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;exactly: if it&amp;#39;s all your own encryption then it&amp;#39;s nothing to do with BLE - as far as the BLE is concerned, it&amp;#39;s just a load of arbitrary bytes.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Encryption using user defined keys</title><link>https://devzone.nordicsemi.com/thread/271874?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 17:37:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2262eb92-ebbb-470b-aad2-9728a953edae</guid><dc:creator>Zero.cool</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt;&lt;br /&gt;Yes, it relates to that, But here I am trying to check that I don&amp;#39;t want use any algorithm provided and wanted to go with user defined key for encryption for (connectable and non-connectable) advertisement. as we have different applicaiton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Encryption using user defined keys</title><link>https://devzone.nordicsemi.com/thread/271872?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 17:32:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bd8747b-528a-4e13-8457-edbcf2a3113f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Isn&amp;#39;t this just the same as your previous thread:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66099/encryption-in-data"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/66099/encryption-in-data&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re doing your own encryption, then you&amp;#39;re just using the BLE link as a transparent pipe: to the BLE, it&amp;#39;s just a load of bytes - the BLE neither knows nor cares&amp;nbsp;anything about what those bytes represent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>