The KW36's AES128 sample code or programming reference manual

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

The KW36's AES128 sample code or programming reference manual

4,658 次查看
sihanchen
Contributor III

Hello~

      I work on the KW36 platform and try to implement the AES128 function in our products, so I need ASE128 sample code or programming reference manual to support this work. Who can provide me with relevant resources?   Thank you very much. 

标签 (2)
0 项奖励
回复
9 回复数

4,610 次查看
sihanchen
Contributor III

HI Mario,

      I have referenced the sample code and implemented the AES 128 function in my project, but how do I use the AES128 function to encrypt Central’s ATT packets and send the packet to Peripheral so that Peripheral can receive AES128 encrypted data from Central.

Central sends AP as follows:
=> GattClient_SimpleCharacteristicWrite(....)

How to use AES 128 function to encrypt Central's ATT packets and send it to Peripheral? Is there any relevant sample code or programming reference manuals for reference, thank you very much.

0 项奖励
回复

4,593 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @sihanchen,

You could enable the Bluetooth LE security feature using the paring and bonding process.

You could enable it in the app_preinclude.h file. You will send all the information over the air encrypted.

/*! Enable/disable use of bonding capability */
#define gAppUseBonding_d 1

/*! Enable/disable use of pairing procedure */
#define gAppUsePairing_d 1

Also, depending on your application you could set the security mode and level in the app_config.c file. I am not sure if you want the secure connection feature.

Let me know if you have any further questions.

Regards,

Mario

 

0 项奖励
回复

4,584 次查看
sihanchen
Contributor III

Hi Mario,

         Thanks for your reply. In our project, we do not need a secure connection function. Just use AES128 function to encrypt the Central ATT packet and send it to Peripheral. So does this mean that all of ATT packet of Central need to be encrypted or just encrypt the part of data of ATT packet ?

Thanks again. 

0 项奖励
回复

4,561 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @sihanchen,

The Secure connections could help with the encryption process that you want, the Bluetooth LE stack will encrypt the communication and both sides will be able to decrypt the information that you are sending.

If you do not want to enable the pairing and bonding process, you could use the AES driver to encrypt the information that you want to send, but it is not recommended because you will have the key in the device, and it could not be really secure.

Regards,

Mario

 

 

0 项奖励
回复

4,540 次查看
sihanchen
Contributor III

Hi Mario, 

        Because the Peripheral device in our application is replaceable and does not provide an interface for the user to enter the password, so the Central device will automatically detect the appropriate Peripheral device and connect it.
        we cannot use pin code or bonding as the connection method in our product, is there any sample code for ATT packet encrypted by AES-driver? Or you can give me a related programming reference manual for this. Thank you very much.

0 项奖励
回复

4,531 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @sihanchen,

You are right, the Secure Connections is not possible because you do not have any input, however, you could set level 3 but you could be attacked by a MITM.

AES-related APIs are provided in the SecLib module in the framework. I am not sure if you are working with a specific example, but you could try with the wireless UART and send custom data, after that you could compare if the information was sent encrypted.

Regards,

Mario

 

 

0 项奖励
回复

4,519 次查看
sihanchen
Contributor III

Hi Mario,

       So far, I can use AES-128-API to encrypt the data of the ATT packet, but I cannot use AES-128-API to encrypt the entire ATT packet, which means that only the data part of the ATT packet is encrypted . So Sniffer-Tool can see the handle and characteristics of the ATT package.

Thanks. 

0 项奖励
回复

4,511 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @sihanchen,

You are right, our stack is taking care of the rest of the packet. You could use the just works option that will encrypt the packet.

There is another option, you could look at the GFSK example, you could implement the BLE stack routine by your side, but you will have more access to your own packet and security.

Regards

Mario

0 项奖励
回复

4,634 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @sihanchen,

I hope you are doing great.

Sure, you could look at our AES examples that explain a little bit the process that you could follow for the encryption process.
\SDK_2.2.7_FRDM-KW36\boards\frdmkw36\driver_examples\ltc\aes

Please let me know if you have any further questions.

Regards,

Mario

0 项奖励
回复