I am new to iOS and Core Bluetooth. What I would like to know is how to create a secured connection to the device.
What I understand is:
[manager connectPeripheral:peripheral options:nil]
is the API provided to connect to the BLE device. From this, how do I establish a secured connection?
All BT4.0 connections are secured and managed by the device/sensor and iOS, you do not have control over this.
BT4.0 devices you also have bounded and unbounded connections.
Bounded connections are in a way "paired" to the iOS device. Once bounded they will not communicate to any other device. This ensures the device will always have a secured connection with the bounded iOS device. Bounding is controlled by the operating system (iOS). When a device that requires a bounded connection communicates with a iOS device, the iOS device will present a alert view asking if you wish to connect to the device.
Unbounded devices are continually broadcast their services and allows any iOS device to connect to it. The operating system will not remember the device information, normally the application would store the UUID so it can establish the connection to the same device next time. This is the normal/recommended method for most BT4.0 sensors.
NOTE: Although unbounded devices are not "paired" with the iOS device, they will only communicate with a single iOS device at any one time.
How can you define "secured connection"? According to the specification of Bluetooth Low Energy, when one BLE connection is established between two different BLE devices, the connection is secured, and the AccessAddress field in Link-layer packet is generated for this connection. The value of the AccessAddress are different from other connection's. If you want to know about more details, please refer to page 36 of 138, Bluetooth core specification 4.0 [vol. 6].
If you concerns that someone will sniff the data transmitted through this BLE connection, I have to see it's not easy. Only one BLE slave connecting to the same Master as your BLE sensor can have the ability to sniff your BLE packets, and the functionality is implemented in the Controller side, and only few companies which can access the Controller firmware code can enable the sniffer function.
Furthermore, if you are still worried about your sensor data, Bluetooth Low Energy also provides encryption for BLE packets.