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

how to transmitt encryption data with nRF51 SDK9 hrm example?

I just want to understand concept. For example, I need transmit battery level, heart rate level and other.. in closed (encrypted characteristic). I use S130 nRF51 SDK9. HRS example. If I run this example, on my smartfone I can see all of this data. But data not crypted. I use s130 in advertise mode.

I need underastand concept what I sould do to crypted it? Is it necessary add to

static void gap_params_init(void) ()

uint8_t passkey[] = "123456";

ble_opt_t static_pin_option;
static_pin_option.gap_opt.passkey.p_passkey = passkey;
err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &static_pin_option);
APP_ERROR_CHECK(err_code);

Or I need add another fields more? With those added lines, I don't see crypted data on smartfone. Why?

Parents
  • Hi Mikhail,

    Do did you check if the data was encrypted or not ?

    The easiest way is to encrypt data is to pair/bond your phone with the device. After pairing/bonding, the communication between the phone and the device is encrypted with AES128.

    The passkey configuration is part of the pairing process when you want to have MITM protection.

    But you need to start pairing first. Please try to test with our proximity example where bonding is required to read a characteristic.

    I would suggest you to have a look at a BLE book to have a rough overview of how BLE security works for example "Bluetooth Low Energy: The Developer's Handbook" , "Getting Started with Bluetooth Low Energy: Tools and Techniques for Low-Power Networking" or have a look here.

  • @Mikhail: please give more information on how you test it. What you meant by "see" and "can't see" ? which tool did you use ? Which central device?

Reply Children
No Data
Related