<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SVeseli</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SVeseli"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/SVeseli"/>
	<updated>2026-09-10T15:30:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5557</id>
		<title>Bluetooth Security Features</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5557"/>
		<updated>2020-12-21T19:49:07Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This documentation is a survey about the security features of Bluetooth Classic and Bluetooth Low Energy.&lt;br /&gt;
&lt;br /&gt;
== Basic Security Services ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Authentication:&#039;&#039;&#039; verifies the identity of communicating devices based on their Bluetooth address. User authentication is not provided by the Bluetooth Specification. &lt;br /&gt;
* &#039;&#039;&#039;Confidentiality:&#039;&#039;&#039; prevents eavesdropping of the transmitted data by an untrusted third person in the piconet. Confidentiality is created by data encryption.  &lt;br /&gt;
* &#039;&#039;&#039;Authorization:&#039;&#039;&#039; controls the access of the resources. It assures that only authorized devices get permitted to access a service.&lt;br /&gt;
* &#039;&#039;&#039;Message Integrity:&#039;&#039;&#039; checks if the data was altered during the transmission.&lt;br /&gt;
* &#039;&#039;&#039;Pairing/Bonding:&#039;&#039;&#039; creates shared secret keys to use them in subsequent connections.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic Security  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-1.png|500px|thumb|right|BR/EDR/HS Security Modes ]]&lt;br /&gt;
&lt;br /&gt;
Bluetooth Classic defines encryption and authentication during two different stages of the communication setup. The stages can be differed in Link-level and Service-level. Link-level enforced security features occur before the Bluetooth physical link is fully established. Service-level enforced security features occur after the physical link is already established and while the logical link gets established.Security mode one to the three were defined before Bluetooth version 2.1 came out. Bluetooth version 2.1 added the fourth security mode.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 1  ===&lt;br /&gt;
This mode is considered as non-secure because it doesn’t use authentication nor encryption.  Security Mode 1 is only supported by today&#039;s Bluetooth devices to communicate with old devices that are not capable of the other security modes.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 2  ===&lt;br /&gt;
Security Mode 2 is called Service Level Enforced Security, access to services depends on the device. Trusted devices may use all services, untrusted devices only to a limited extent. There are three service security levels.&lt;br /&gt;
* Level 1 open to all devices. It is a default mode that also allows outdated applications.&lt;br /&gt;
* Level 2 authentication required, a permanently installed PIN is sufficient.&lt;br /&gt;
* Level 3 requires authentication and authorization, a PIN must be entered.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 3  ===&lt;br /&gt;
This security mode is a link level security mode and security procedures get initiated before the physical link is fully established. Authentication and Encryption is fully supported by security mode 3 connections. Furthermore, service discovery can only be performed with an authenticated device which encrypts its traffic.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 4  ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-2.png|500px|thumb|right|BR/EDR/HS Security Mode 4 Levels Summar]]&lt;br /&gt;
&lt;br /&gt;
Security mode 4 was introduced in Bluetooth version 2.1 and is a service level enforces security mode which security mechanisms get initiated after physical and logical link setup. Security mode takes advantage of the Secure Simple Pairing (SSP) Mechanism. SSP in Bluetooth version 4.1 uses the P-256 elliptic curve to generate the link key. Bluetooth 4.1 uses Hash Messages Authentication Codes Secure Hash Algorithm with 256-bit (HMAC-SHA-256) for integrity checks. For encryption the AES-Counter with CBC-MAC (AES-CCM) cypher is used. The P-256 elliptic curve, HMAC-SHA-256 and AES-CCM are security mechanisms which got approved by the Federal Information Processing Standard (FIPS). Security mode 4 gets differentiated into 5 different layers with different security levels.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer 0:&#039;&#039;&#039; Layer 0 is only used by the Service Discovery Protocol (SDP). This layer doesn’t have any security features.&lt;br /&gt;
* &#039;&#039;&#039;Layer 1:&#039;&#039;&#039; Layer 1 doesn’t use any security.&lt;br /&gt;
* &#039;&#039;&#039;Layer 2:&#039;&#039;&#039; Layer 2 uses an unauthenticated link key. &lt;br /&gt;
* &#039;&#039;&#039;Layer 3:&#039;&#039;&#039; Layer 3 required an authenticated link key.&lt;br /&gt;
* &#039;&#039;&#039;Layer 4:&#039;&#039;&#039; Layer 4 uses secure connection in addition to the authenticated link key&lt;br /&gt;
&lt;br /&gt;
Whether or not a link key is authenticated depends on the SSP association model used.&lt;br /&gt;
&lt;br /&gt;
=== Secure Simple Pairing (SSP)  ===&lt;br /&gt;
&lt;br /&gt;
Secure Simple Pairing was introduced with Security Mode 4 at Bluetooth Version 2.1 and got improved in Version 4.1. The main goal of secure simple pairing is to simplify the pairing process for users. The secondary goal is to maintain or enhance the security of Bluetooth. SSP has two security goals, passive eavesdropping protection and man-in-the-middle protection. SSP provide several association models suited for all input/output capability combinations. Some of these association models are protected against passive and active man-in-the-middle (MITM) attacks during pairing by using ECDH public key cryptography.&lt;br /&gt;
&lt;br /&gt;
[[File:Association models.png|500px|thumb|right|Association models]]&lt;br /&gt;
&lt;br /&gt;
==== Numeric Comparison ====&lt;br /&gt;
Numeric comparison was designed for devices, where both can display a six-digit number and allow a user input to accept and deny the connection. During the Paring both devices show a six-digit code on their displays. The user can accept the parring if the displayed numbers are the same. The connection is secure against MITM attacks and eavesdropping, if the paring was done correctly.  &lt;br /&gt;
&lt;br /&gt;
==== Passkey Entry ====&lt;br /&gt;
This model can be used where one device a has a display that sows a six-digit number and the other device has a digit input. Device a show a code that must be entered into the keyboard of the other device to establish the connection. This model is also secure against MITM attacks and eavesdropping.&lt;br /&gt;
&lt;br /&gt;
==== Out of Band (OOB) ====&lt;br /&gt;
The out of band model uses an additional wireless or wired technology like Near Field Communication (NFC) to exchange the needed cryptographic keys. This model’s security is only as secure as the out of band technology. Even though, this association model is associated to be secure against eavesdropping and MITM attacks.&lt;br /&gt;
&lt;br /&gt;
==== Just Works ====&lt;br /&gt;
The just works model is not secured against eavesdropping and MITM attacks. This model is designed for connection where both devices have no input or output capabilities.&lt;br /&gt;
&lt;br /&gt;
==== SSP Phases ====&lt;br /&gt;
Secure Simple Pairing consists of 5 phases:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public key exchange:&#039;&#039;&#039; Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair. Pairing starts when the initiating device sends its public key to the receiving device. The responding device replies with its own public key, when both devices support Secure Connections then P-256 elliptic curve will be used, if at least one device does not support Secure Connections the P-192 elliptic curve will be used.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 1:&#039;&#039;&#039; Phase 2 consist of three protocols: Numeric Comparison, Out-of-Band and Passkey Entry. The protocol is selected depending on the IO capabilities of the device.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 2:&#039;&#039;&#039; Phase 3 confirms that the exchange between the two participants has been successfully completed. Both devices calculate a new confirmation value that takes into account the previously exchanged values and the new shared key. The initiator sends the new confirmations value to the responding device and is checked by it. If a failure occurs, the protocol should abort.&lt;br /&gt;
* &#039;&#039;&#039;Link key calculation:&#039;&#039;&#039; After both devices confirm the pairing, a link key is calculated using the shared key and the publicly exchanged data. The link key is used to maintain pairing.&lt;br /&gt;
* &#039;&#039;&#039;Link Manager Protocol Authentication and Encryption:&#039;&#039;&#039; Authentication and generation of the encryption key.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Pairing ===&lt;br /&gt;
With PIN / Legacy Pairing, the link keys are derived from a PIN entered by the user in one or both devices, depending on the configuration and device type. If the PIN is smaller than 16 bytes, the Bluetooth address of the initializing device is used for filling. After the key generation has been completed, the devices authenticate each other to ensure that both are using the same link key.This method only serves to mutually identify the devices and cannot prevent a man-in-the-middle attack. An attacker who knows the PIN can calculate the key from it.&lt;br /&gt;
&lt;br /&gt;
=== Key Generation ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Key Generation ====&lt;br /&gt;
The link key is a 128-bit random number, shared between two or multiple participants, and is the basis of all security transactions between these participants. The link key must be created and then distributed to the associated devices in order to be used for the authentication procedure. The initialization key is used temporarily during initialization and should be discarded afterwards. The initialization key is the result of the E22 algorithm the input parameters are a Bluetooth address, a PIN and a random number. The initialization key is used for the key exchange during the generation of a link key.&lt;br /&gt;
&lt;br /&gt;
==== Secure Key Generation ====&lt;br /&gt;
Phase 4 (Link key calculation) of Secure Simple Pairing the link key will be established by using Elliptic Curve Diffie-Hellman public/private key pairs.&lt;br /&gt;
&lt;br /&gt;
=== Confidentiality of the data ===&lt;br /&gt;
The Bluetooth standard defines three encryption modes for data traffic, but only two of them actuals provide confidentiality. The modes are as follows: &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 1:&#039;&#039;&#039; The data traffic is unencrypted &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 2:&#039;&#039;&#039; Individually addressed traffic is encrypted based on individual link keys but broadcast traffic is not.&lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 3:&#039;&#039;&#039; Individually addressed traffic and broadcast traffic is encrypted using an encryption key based on the master link key.&lt;br /&gt;
For encryption mode 2 and 3 is either the AES-CCM or E0 stream cipher used. Bluetooth Security Mode 4 encrypts all data traffic, expect service discovery messages&lt;br /&gt;
&lt;br /&gt;
=== Trust Levels and Service Security Levels.=== &lt;br /&gt;
In addition to the security modes, exist different levels of service security and trust.&lt;br /&gt;
The trust levels can be differentiated into trusted and untrusted. A trusted device has an established relation ship to the device and has full access to all the services. The untrusted device doesn’t have a relationship to the other device and has only a restricted access to the services.&lt;br /&gt;
The Service security level depend on the used Security mode. There are no Service security levels defined for Security mode 1 and 3. Security mode 2 has the following Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Authentication required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Encryption required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Authorization required&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Security mode 2 defines the following five Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Service Level 0:&#039;&#039;&#039; No MITM protection, encryption, or user interaction required.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 1:&#039;&#039;&#039; MITM protection and encryption not required. Minimal user interaction.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 2:&#039;&#039;&#039; Requires encryption only; MITM protection is not necessary.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 3:&#039;&#039;&#039; Requires MITM protection and encryption; user interaction is acceptable.[[File:LABluetooth.PNG|350px|thumb|right|Legacy Authentication ]]&lt;br /&gt;
* &#039;&#039;&#039;Service Level 4:&#039;&#039;&#039; Requires MITM protection and encryption with 128-bit strength; user interaction is acceptable.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Authentication ====&lt;br /&gt;
&lt;br /&gt;
Legacy authentication uses a challenge-response scheme, in which a symmetric key is used to check the claimant’s key knowledge through a two-step protocol. In legacy authentication, the verifier is not required to be the master, the application indicates which device has to be authenticated. The second implies that the correct claimaint/verifier pair share the same secret keys. The verifier challenges the claimaint to authenticate a random input. Some applications only require a one-way authentication.[[File:SABluetooth.PNG|400px|thumb|right|Secure Authentication ]] Some peer-to-peer applications should use two authentication procedures in which each device is the challenger. In Figure is an example of a legacy authentication. The verifier has 3 input parameters, random input, bluetooth address and the link key the result is the SRES. The verifier sends the random message to the claimaint and does the same as the verifier and send back its SRES.&lt;br /&gt;
&lt;br /&gt;
==== Secure Authentication ====&lt;br /&gt;
&lt;br /&gt;
Secure Authentication follows the same principle but with two algorithms and several input parameters. Both devices act as a verifier and claimaint in the same sequence. Master Sends a random message to the Slave and vice verca. Both parties do their calculations and send each other their results.&lt;br /&gt;
The input parameter BD_ADDRm is the Bluetooth Address from the Master, BD_ADDRs is the bluetooth Address from the Slave, btdk is a secret string, Link Key is the shared key, AU_RANDm is the random message from the Master, AU_RANDs is the random message from the Slave, SRESm is the result of the Master, SRESs is the result of the Slave.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Low Energy security ==&lt;br /&gt;
Fundamentals of the BLE Standard can be found in the [[BLE Fundamentals]] documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bluetooth Low Energy security modes are similar to the Security Modes 2 and 4 of Bluetooth Classic, but each service can have its own security requirements.  Furthermore, Bluetooth Low Energy has two security modes with multiple security levels.&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 1 is associated with encryption&lt;br /&gt;
*Level 1 does neither use authentication nor encryption.  &lt;br /&gt;
*Level 2 uses unauthenticated pairing with encryption.&lt;br /&gt;
*Level 3 uses authenticated pairing with encryption.&lt;br /&gt;
*Level 4 which uses authenticated low energy Secure Connections pairing with encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 2 is associated with encryption data integrity&lt;br /&gt;
*Level 1 uses unauthenticated pairing with data signing.&lt;br /&gt;
*Level 2 uses authenticated pairing with data signing.&lt;br /&gt;
&lt;br /&gt;
Security Mode 1 Level 4 is considered to create the strongest connections because it uses AES-CMAC and P-256 elliptic curve for pairing and encryption.  Security Mode 1 Level 3 is less secure because it doesn’t use elliptical curve cryptography. Because Security Mode 2 does not provide encryption, it is strongly recommended to use Security Mode 1 Level 3 and 4.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic and Bluetooth Low Energy security differences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Key_Differences_Between_Bluetooth_BR_EDR_and_Low_Energy.png|600px|Key Differences Between Bluetooth BR/EDR and Low Energy ]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://csrc.nist.gov/publications/detail/sp/800-121/rev-2/final&lt;br /&gt;
* https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=478726&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5556</id>
		<title>Bluetooth Security Features</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5556"/>
		<updated>2020-12-21T19:48:47Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Security Mode 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This Page is work in progress please come back later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This documentation is a survey about the security features of Bluetooth Classic and Bluetooth Low Energy. &lt;br /&gt;
&lt;br /&gt;
== Basic Security Services ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Authentication:&#039;&#039;&#039; verifies the identity of communicating devices based on their Bluetooth address. User authentication is not provided by the Bluetooth Specification. &lt;br /&gt;
* &#039;&#039;&#039;Confidentiality:&#039;&#039;&#039; prevents eavesdropping of the transmitted data by an untrusted third person in the piconet. Confidentiality is created by data encryption.  &lt;br /&gt;
* &#039;&#039;&#039;Authorization:&#039;&#039;&#039; controls the access of the resources. It assures that only authorized devices get permitted to access a service.&lt;br /&gt;
* &#039;&#039;&#039;Message Integrity:&#039;&#039;&#039; checks if the data was altered during the transmission.&lt;br /&gt;
* &#039;&#039;&#039;Pairing/Bonding:&#039;&#039;&#039; creates shared secret keys to use them in subsequent connections.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic Security  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-1.png|500px|thumb|right|BR/EDR/HS Security Modes ]]&lt;br /&gt;
&lt;br /&gt;
Bluetooth Classic defines encryption and authentication during two different stages of the communication setup. The stages can be differed in Link-level and Service-level. Link-level enforced security features occur before the Bluetooth physical link is fully established. Service-level enforced security features occur after the physical link is already established and while the logical link gets established.Security mode one to the three were defined before Bluetooth version 2.1 came out. Bluetooth version 2.1 added the fourth security mode.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 1  ===&lt;br /&gt;
This mode is considered as non-secure because it doesn’t use authentication nor encryption.  Security Mode 1 is only supported by today&#039;s Bluetooth devices to communicate with old devices that are not capable of the other security modes.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 2  ===&lt;br /&gt;
Security Mode 2 is called Service Level Enforced Security, access to services depends on the device. Trusted devices may use all services, untrusted devices only to a limited extent. There are three service security levels.&lt;br /&gt;
* Level 1 open to all devices. It is a default mode that also allows outdated applications.&lt;br /&gt;
* Level 2 authentication required, a permanently installed PIN is sufficient.&lt;br /&gt;
* Level 3 requires authentication and authorization, a PIN must be entered.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 3  ===&lt;br /&gt;
This security mode is a link level security mode and security procedures get initiated before the physical link is fully established. Authentication and Encryption is fully supported by security mode 3 connections. Furthermore, service discovery can only be performed with an authenticated device which encrypts its traffic.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 4  ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-2.png|500px|thumb|right|BR/EDR/HS Security Mode 4 Levels Summar]]&lt;br /&gt;
&lt;br /&gt;
Security mode 4 was introduced in Bluetooth version 2.1 and is a service level enforces security mode which security mechanisms get initiated after physical and logical link setup. Security mode takes advantage of the Secure Simple Pairing (SSP) Mechanism. SSP in Bluetooth version 4.1 uses the P-256 elliptic curve to generate the link key. Bluetooth 4.1 uses Hash Messages Authentication Codes Secure Hash Algorithm with 256-bit (HMAC-SHA-256) for integrity checks. For encryption the AES-Counter with CBC-MAC (AES-CCM) cypher is used. The P-256 elliptic curve, HMAC-SHA-256 and AES-CCM are security mechanisms which got approved by the Federal Information Processing Standard (FIPS). Security mode 4 gets differentiated into 5 different layers with different security levels.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer 0:&#039;&#039;&#039; Layer 0 is only used by the Service Discovery Protocol (SDP). This layer doesn’t have any security features.&lt;br /&gt;
* &#039;&#039;&#039;Layer 1:&#039;&#039;&#039; Layer 1 doesn’t use any security.&lt;br /&gt;
* &#039;&#039;&#039;Layer 2:&#039;&#039;&#039; Layer 2 uses an unauthenticated link key. &lt;br /&gt;
* &#039;&#039;&#039;Layer 3:&#039;&#039;&#039; Layer 3 required an authenticated link key.&lt;br /&gt;
* &#039;&#039;&#039;Layer 4:&#039;&#039;&#039; Layer 4 uses secure connection in addition to the authenticated link key&lt;br /&gt;
&lt;br /&gt;
Whether or not a link key is authenticated depends on the SSP association model used.&lt;br /&gt;
&lt;br /&gt;
=== Secure Simple Pairing (SSP)  ===&lt;br /&gt;
&lt;br /&gt;
Secure Simple Pairing was introduced with Security Mode 4 at Bluetooth Version 2.1 and got improved in Version 4.1. The main goal of secure simple pairing is to simplify the pairing process for users. The secondary goal is to maintain or enhance the security of Bluetooth. SSP has two security goals, passive eavesdropping protection and man-in-the-middle protection. SSP provide several association models suited for all input/output capability combinations. Some of these association models are protected against passive and active man-in-the-middle (MITM) attacks during pairing by using ECDH public key cryptography.&lt;br /&gt;
&lt;br /&gt;
[[File:Association models.png|500px|thumb|right|Association models]]&lt;br /&gt;
&lt;br /&gt;
==== Numeric Comparison ====&lt;br /&gt;
Numeric comparison was designed for devices, where both can display a six-digit number and allow a user input to accept and deny the connection. During the Paring both devices show a six-digit code on their displays. The user can accept the parring if the displayed numbers are the same. The connection is secure against MITM attacks and eavesdropping, if the paring was done correctly.  &lt;br /&gt;
&lt;br /&gt;
==== Passkey Entry ====&lt;br /&gt;
This model can be used where one device a has a display that sows a six-digit number and the other device has a digit input. Device a show a code that must be entered into the keyboard of the other device to establish the connection. This model is also secure against MITM attacks and eavesdropping.&lt;br /&gt;
&lt;br /&gt;
==== Out of Band (OOB) ====&lt;br /&gt;
The out of band model uses an additional wireless or wired technology like Near Field Communication (NFC) to exchange the needed cryptographic keys. This model’s security is only as secure as the out of band technology. Even though, this association model is associated to be secure against eavesdropping and MITM attacks.&lt;br /&gt;
&lt;br /&gt;
==== Just Works ====&lt;br /&gt;
The just works model is not secured against eavesdropping and MITM attacks. This model is designed for connection where both devices have no input or output capabilities.&lt;br /&gt;
&lt;br /&gt;
==== SSP Phases ====&lt;br /&gt;
Secure Simple Pairing consists of 5 phases:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public key exchange:&#039;&#039;&#039; Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair. Pairing starts when the initiating device sends its public key to the receiving device. The responding device replies with its own public key, when both devices support Secure Connections then P-256 elliptic curve will be used, if at least one device does not support Secure Connections the P-192 elliptic curve will be used.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 1:&#039;&#039;&#039; Phase 2 consist of three protocols: Numeric Comparison, Out-of-Band and Passkey Entry. The protocol is selected depending on the IO capabilities of the device.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 2:&#039;&#039;&#039; Phase 3 confirms that the exchange between the two participants has been successfully completed. Both devices calculate a new confirmation value that takes into account the previously exchanged values and the new shared key. The initiator sends the new confirmations value to the responding device and is checked by it. If a failure occurs, the protocol should abort.&lt;br /&gt;
* &#039;&#039;&#039;Link key calculation:&#039;&#039;&#039; After both devices confirm the pairing, a link key is calculated using the shared key and the publicly exchanged data. The link key is used to maintain pairing.&lt;br /&gt;
* &#039;&#039;&#039;Link Manager Protocol Authentication and Encryption:&#039;&#039;&#039; Authentication and generation of the encryption key.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Pairing ===&lt;br /&gt;
With PIN / Legacy Pairing, the link keys are derived from a PIN entered by the user in one or both devices, depending on the configuration and device type. If the PIN is smaller than 16 bytes, the Bluetooth address of the initializing device is used for filling. After the key generation has been completed, the devices authenticate each other to ensure that both are using the same link key.This method only serves to mutually identify the devices and cannot prevent a man-in-the-middle attack. An attacker who knows the PIN can calculate the key from it.&lt;br /&gt;
&lt;br /&gt;
=== Key Generation ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Key Generation ====&lt;br /&gt;
The link key is a 128-bit random number, shared between two or multiple participants, and is the basis of all security transactions between these participants. The link key must be created and then distributed to the associated devices in order to be used for the authentication procedure. The initialization key is used temporarily during initialization and should be discarded afterwards. The initialization key is the result of the E22 algorithm the input parameters are a Bluetooth address, a PIN and a random number. The initialization key is used for the key exchange during the generation of a link key.&lt;br /&gt;
&lt;br /&gt;
==== Secure Key Generation ====&lt;br /&gt;
Phase 4 (Link key calculation) of Secure Simple Pairing the link key will be established by using Elliptic Curve Diffie-Hellman public/private key pairs.&lt;br /&gt;
&lt;br /&gt;
=== Confidentiality of the data ===&lt;br /&gt;
The Bluetooth standard defines three encryption modes for data traffic, but only two of them actuals provide confidentiality. The modes are as follows: &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 1:&#039;&#039;&#039; The data traffic is unencrypted &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 2:&#039;&#039;&#039; Individually addressed traffic is encrypted based on individual link keys but broadcast traffic is not.&lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 3:&#039;&#039;&#039; Individually addressed traffic and broadcast traffic is encrypted using an encryption key based on the master link key.&lt;br /&gt;
For encryption mode 2 and 3 is either the AES-CCM or E0 stream cipher used. Bluetooth Security Mode 4 encrypts all data traffic, expect service discovery messages&lt;br /&gt;
&lt;br /&gt;
=== Trust Levels and Service Security Levels.=== &lt;br /&gt;
In addition to the security modes, exist different levels of service security and trust.&lt;br /&gt;
The trust levels can be differentiated into trusted and untrusted. A trusted device has an established relation ship to the device and has full access to all the services. The untrusted device doesn’t have a relationship to the other device and has only a restricted access to the services.&lt;br /&gt;
The Service security level depend on the used Security mode. There are no Service security levels defined for Security mode 1 and 3. Security mode 2 has the following Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Authentication required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Encryption required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Authorization required&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Security mode 2 defines the following five Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Service Level 0:&#039;&#039;&#039; No MITM protection, encryption, or user interaction required.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 1:&#039;&#039;&#039; MITM protection and encryption not required. Minimal user interaction.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 2:&#039;&#039;&#039; Requires encryption only; MITM protection is not necessary.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 3:&#039;&#039;&#039; Requires MITM protection and encryption; user interaction is acceptable.[[File:LABluetooth.PNG|350px|thumb|right|Legacy Authentication ]]&lt;br /&gt;
* &#039;&#039;&#039;Service Level 4:&#039;&#039;&#039; Requires MITM protection and encryption with 128-bit strength; user interaction is acceptable.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Authentication ====&lt;br /&gt;
&lt;br /&gt;
Legacy authentication uses a challenge-response scheme, in which a symmetric key is used to check the claimant’s key knowledge through a two-step protocol. In legacy authentication, the verifier is not required to be the master, the application indicates which device has to be authenticated. The second implies that the correct claimaint/verifier pair share the same secret keys. The verifier challenges the claimaint to authenticate a random input. Some applications only require a one-way authentication.[[File:SABluetooth.PNG|400px|thumb|right|Secure Authentication ]] Some peer-to-peer applications should use two authentication procedures in which each device is the challenger. In Figure is an example of a legacy authentication. The verifier has 3 input parameters, random input, bluetooth address and the link key the result is the SRES. The verifier sends the random message to the claimaint and does the same as the verifier and send back its SRES.&lt;br /&gt;
&lt;br /&gt;
==== Secure Authentication ====&lt;br /&gt;
&lt;br /&gt;
Secure Authentication follows the same principle but with two algorithms and several input parameters. Both devices act as a verifier and claimaint in the same sequence. Master Sends a random message to the Slave and vice verca. Both parties do their calculations and send each other their results.&lt;br /&gt;
The input parameter BD_ADDRm is the Bluetooth Address from the Master, BD_ADDRs is the bluetooth Address from the Slave, btdk is a secret string, Link Key is the shared key, AU_RANDm is the random message from the Master, AU_RANDs is the random message from the Slave, SRESm is the result of the Master, SRESs is the result of the Slave.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Low Energy security ==&lt;br /&gt;
Fundamentals of the BLE Standard can be found in the [[BLE Fundamentals]] documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bluetooth Low Energy security modes are similar to the Security Modes 2 and 4 of Bluetooth Classic, but each service can have its own security requirements.  Furthermore, Bluetooth Low Energy has two security modes with multiple security levels.&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 1 is associated with encryption&lt;br /&gt;
*Level 1 does neither use authentication nor encryption.  &lt;br /&gt;
*Level 2 uses unauthenticated pairing with encryption.&lt;br /&gt;
*Level 3 uses authenticated pairing with encryption.&lt;br /&gt;
*Level 4 which uses authenticated low energy Secure Connections pairing with encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 2 is associated with encryption data integrity&lt;br /&gt;
*Level 1 uses unauthenticated pairing with data signing.&lt;br /&gt;
*Level 2 uses authenticated pairing with data signing.&lt;br /&gt;
&lt;br /&gt;
Security Mode 1 Level 4 is considered to create the strongest connections because it uses AES-CMAC and P-256 elliptic curve for pairing and encryption.  Security Mode 1 Level 3 is less secure because it doesn’t use elliptical curve cryptography. Because Security Mode 2 does not provide encryption, it is strongly recommended to use Security Mode 1 Level 3 and 4.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic and Bluetooth Low Energy security differences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Key_Differences_Between_Bluetooth_BR_EDR_and_Low_Energy.png|600px|Key Differences Between Bluetooth BR/EDR and Low Energy ]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://csrc.nist.gov/publications/detail/sp/800-121/rev-2/final&lt;br /&gt;
* https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=478726&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5555</id>
		<title>KNOB Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5555"/>
		<updated>2020-12-21T19:48:11Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Key negotiation protocol */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
Bluetooth specification has an encryption key negotiation protocol to negotiate encryption keys. Attackers can manipulate this protocol to force encryption keys with 1 Byte of entropy without protecting the integrity of the negotiation process. This enables brute forcing the encryption keys in real time.&lt;br /&gt;
[[File:bluetoothKNOB.PNG|300px|thumb|right|Key negotiation protocol]]&lt;br /&gt;
&lt;br /&gt;
== Key negotiation protocol ==&lt;br /&gt;
&lt;br /&gt;
The goal of this protocol is to compute a session key starting from a long term shared secret&lt;br /&gt;
At the top is Encryption Key Generation Function that takes as input the longterm secret a bunch of nonces and Bluetooth address of Slave and is computing Kc a key with 16 Bytes of entropy this key is not used as session key it is processed by an entropy reduction function that is used to modify the entropy to N bytes and this N number is computed from an entropy negotiation phase that is performed by alice and bob. This session key is used to encrypt and decrypt the packets using E0 stream cipher in case using legacy security mode or AES-CCM if both devices supporting Bluetooth secure connections.&lt;br /&gt;
&lt;br /&gt;
== Stages of Attack ==&lt;br /&gt;
KNOB Attack has 4 Main stages&lt;br /&gt;
* &#039;&#039;&#039;First stage:&#039;&#039;&#039; Alice and Bob (Victims) are pairing using the strongest security mechanisms Secure Simple pairing. They are establishing a long term secret and the attacker is not there. &lt;br /&gt;
* &#039;&#039;&#039;Second Phase:&#039;&#039;&#039; Alice and Bob wants to establish a new encrypted session and Charlie(Attacker) is in Bluetooth range with the victim.  &lt;br /&gt;
* &#039;&#039;&#039;Phase 3:&#039;&#039;&#039; Charlie is able to manipulate the entropy negotiation phase of Bluetooth and let the two victim negotiate an encryption key with one byte of entropy.&lt;br /&gt;
* &#039;&#039;&#039;Phase 4:&#039;&#039;&#039; Charlie is able to eavesdropping ciphertext and using the ciphertext to bruteforce the encryption key and the brute force is in real time because If you use an encryption key with 1 Byte of entropy then you have to brute force one key out of 256 possibilities.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/knob&lt;br /&gt;
* Rooted Nexus 5 running the internalblue/android_bluetooth_stack/nexus5_android6_0_1/bluetooth.default.so custom Android Bluetooth stack&lt;br /&gt;
* Computer running Linux operating system&lt;br /&gt;
* Wireshark&lt;br /&gt;
&lt;br /&gt;
Internalblue is a framework which can patch the firmware from the operating system.&lt;br /&gt;
This attack is simulating an attacker using Internalblue, because the setup is easier, has a higher reliability, and it is cheaper than over the air.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
&lt;br /&gt;
* Connect Nexus 5 via USB to the computer&lt;br /&gt;
* Configure and install modified internalblue v0.1&lt;br /&gt;
** Edit &#039;&#039;&#039;internalblue/internalblue/core.py&#039;&#039;&#039; and set &#039;&#039;&#039;NEXUS5_MODE&#039;&#039;&#039; to which mode you want to perform&lt;br /&gt;
** Set &#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039; then the Nexus 5 is the master device or &#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039; to set Nexus 5 to the slave device&lt;br /&gt;
** In terminal, switch into the &#039;&#039;&#039;internalblue&#039;&#039;&#039; directory, and run &#039;&#039;&#039;sudo python2 setup.py install&#039;&#039;&#039;&lt;br /&gt;
** Open a terminal and run internalblue (Internalblue is inserted in PATH Variable)&lt;br /&gt;
* In the internalblue menu start LMP monitoring with monitor lmp start&lt;br /&gt;
** A Wireshark window should pop up&lt;br /&gt;
* Pair target with Nexus 5&lt;br /&gt;
* When Nexus 5 is as the master configured (&#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039;) then you have to start the connection from the Nexus 5 to the target device.&lt;br /&gt;
* When the Nexus 5 is as the slave configured (&#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039;) then you have to start the connection from the victim to the Nexus 5.&lt;br /&gt;
* In Wireshark you can see that the devices have negotiated an encryption key with 1 byte of entropy.&lt;br /&gt;
&lt;br /&gt;
== Countermeasures ==&lt;br /&gt;
* Force minimum and maximum amount of entropy that cannot be easily brute forced.&lt;br /&gt;
* Encryption keys with a fixed number of entropy.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.usenix.org/conference/usenixsecurity19/presentation/antonioli&lt;br /&gt;
* https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;br /&gt;
* https://francozappa.github.io/publication/knob/&lt;br /&gt;
* https://github.com/francozappa/knob&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5554</id>
		<title>KNOB Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5554"/>
		<updated>2020-12-21T19:48:04Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Countermeasures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
Bluetooth specification has an encryption key negotiation protocol to negotiate encryption keys. Attackers can manipulate this protocol to force encryption keys with 1 Byte of entropy without protecting the integrity of the negotiation process. This enables brute forcing the encryption keys in real time.&lt;br /&gt;
[[File:bluetoothKNOB.PNG|300px|thumb|right|Key negotiation protocol]]&lt;br /&gt;
&lt;br /&gt;
== Key negotiation protocol ==&lt;br /&gt;
&lt;br /&gt;
The goal of this protocol is to compute a session key starting from a long term shared secret&lt;br /&gt;
At the top is Encryption Key Generation Function that takes as input the longterm secret a bunch of nonces and Bluetooth address of Slave and is computing Kc a key with 16 Bytes of entropy this key is not used as session key it is processed by an entropy reduction function that is used to modify the entropy to N bytes and this N number is computed from an entropy negotiation phase that is performed by alice and bob. This session key is used to encrypt and decrypt the packets using E0 stream cipher in case using legacy security mode or AES-CCM if both devices supporting Bluetooth secure connections.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stages of Attack ==&lt;br /&gt;
KNOB Attack has 4 Main stages&lt;br /&gt;
* &#039;&#039;&#039;First stage:&#039;&#039;&#039; Alice and Bob (Victims) are pairing using the strongest security mechanisms Secure Simple pairing. They are establishing a long term secret and the attacker is not there. &lt;br /&gt;
* &#039;&#039;&#039;Second Phase:&#039;&#039;&#039; Alice and Bob wants to establish a new encrypted session and Charlie(Attacker) is in Bluetooth range with the victim.  &lt;br /&gt;
* &#039;&#039;&#039;Phase 3:&#039;&#039;&#039; Charlie is able to manipulate the entropy negotiation phase of Bluetooth and let the two victim negotiate an encryption key with one byte of entropy.&lt;br /&gt;
* &#039;&#039;&#039;Phase 4:&#039;&#039;&#039; Charlie is able to eavesdropping ciphertext and using the ciphertext to bruteforce the encryption key and the brute force is in real time because If you use an encryption key with 1 Byte of entropy then you have to brute force one key out of 256 possibilities.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/knob&lt;br /&gt;
* Rooted Nexus 5 running the internalblue/android_bluetooth_stack/nexus5_android6_0_1/bluetooth.default.so custom Android Bluetooth stack&lt;br /&gt;
* Computer running Linux operating system&lt;br /&gt;
* Wireshark&lt;br /&gt;
&lt;br /&gt;
Internalblue is a framework which can patch the firmware from the operating system.&lt;br /&gt;
This attack is simulating an attacker using Internalblue, because the setup is easier, has a higher reliability, and it is cheaper than over the air.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
&lt;br /&gt;
* Connect Nexus 5 via USB to the computer&lt;br /&gt;
* Configure and install modified internalblue v0.1&lt;br /&gt;
** Edit &#039;&#039;&#039;internalblue/internalblue/core.py&#039;&#039;&#039; and set &#039;&#039;&#039;NEXUS5_MODE&#039;&#039;&#039; to which mode you want to perform&lt;br /&gt;
** Set &#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039; then the Nexus 5 is the master device or &#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039; to set Nexus 5 to the slave device&lt;br /&gt;
** In terminal, switch into the &#039;&#039;&#039;internalblue&#039;&#039;&#039; directory, and run &#039;&#039;&#039;sudo python2 setup.py install&#039;&#039;&#039;&lt;br /&gt;
** Open a terminal and run internalblue (Internalblue is inserted in PATH Variable)&lt;br /&gt;
* In the internalblue menu start LMP monitoring with monitor lmp start&lt;br /&gt;
** A Wireshark window should pop up&lt;br /&gt;
* Pair target with Nexus 5&lt;br /&gt;
* When Nexus 5 is as the master configured (&#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039;) then you have to start the connection from the Nexus 5 to the target device.&lt;br /&gt;
* When the Nexus 5 is as the slave configured (&#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039;) then you have to start the connection from the victim to the Nexus 5.&lt;br /&gt;
* In Wireshark you can see that the devices have negotiated an encryption key with 1 byte of entropy.&lt;br /&gt;
&lt;br /&gt;
== Countermeasures ==&lt;br /&gt;
* Force minimum and maximum amount of entropy that cannot be easily brute forced.&lt;br /&gt;
* Encryption keys with a fixed number of entropy.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.usenix.org/conference/usenixsecurity19/presentation/antonioli&lt;br /&gt;
* https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;br /&gt;
* https://francozappa.github.io/publication/knob/&lt;br /&gt;
* https://github.com/francozappa/knob&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5553</id>
		<title>BIAS Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5553"/>
		<updated>2020-12-21T19:46:37Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description == &lt;br /&gt;
Bluetooth Impersonation AttackS (BIAS) was found 2020 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
The Bluetooth specification includes authentication mechanisms based on long term pairing key, which are created to protect against impersonation attacks. This attack shows that this mechanisms are not reliable and that an attacker can use the mechanisms to impersonate any master or slave device.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
* Victims Alice &amp;amp; Bob share a long term key and support mutual authentication&lt;br /&gt;
*Attacker Charlie presents to Bob as Alice and downgrades mutual authentication to unilateral authentication.&lt;br /&gt;
* Abuses Bluetooth role switching to become the new authenticator. Authenticates bob and starts a secure session with Bob as Alice without having to authenticate.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/bias&lt;br /&gt;
* CYW920819 devboard&lt;br /&gt;
* Google Pixel 2&lt;br /&gt;
* Linux laptop that can parse diagnostic messages from  CYW920819 devboard and run internalblue. Can be achieved by using vanilla linux-4.14.111 kernel compiled with provided modifications of github.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
* Open &#039;&#039;&#039;IF_PIXEL2&#039;&#039;&#039; File&lt;br /&gt;
** Change the &#039;&#039;&#039;btadd&#039;&#039;&#039; to the Bluetooth address of the impersonated device&lt;br /&gt;
** Change the &#039;&#039;&#039;btname&#039;&#039;&#039; to the Bluetooth name of the impersonated device&lt;br /&gt;
** Change lmin and lmax to set the max and min entropy value for the session key &lt;br /&gt;
* Connect the devboard to laptop via USB&lt;br /&gt;
* Attach to the devboard with &#039;&#039;&#039;btattach -B /dev/ttyUSB1 -S 115200 &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
* Enable the devboard diagnostic mode with &#039;&#039;&#039;sudo python2 enable_diag.py&#039;&#039;&#039;&lt;br /&gt;
* Start internalblue with &#039;&#039;&#039;sudo internalblue&#039;&#039;&#039;&lt;br /&gt;
* Start wireshark monitoring from internalblue&lt;br /&gt;
* Use &#039;&#039;&#039;make generate&#039;&#039;&#039; to create &#039;&#039;&#039;bias.py&#039;&#039;&#039;&lt;br /&gt;
* Pair the impersonated victim (Pixel 2) and the other victim device&lt;br /&gt;
* Disconnect them and disable Bluetooth on the impersonated device (Pixel 2)&lt;br /&gt;
* Start a connection from the victim to the impersonated device (BIAS slave impersonation)&lt;br /&gt;
* Start a connection from the attack device to the victim (BIAS master impersonation)&lt;br /&gt;
&lt;br /&gt;
== Countermeasures == &lt;br /&gt;
To reduce the lack of integrity protection during secure connection establishment, the standard should force to use the long term key to protect the connection establishment. Before creating a secure connection the long term key should be available. The standard should force to always use the legacy authentication procedure mutually.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://francozappa.github.io/publication/bias/paper.pdf&lt;br /&gt;
* https://github.com/francozappa/bias&lt;br /&gt;
* https://francozappa.github.io/about-bias/&lt;br /&gt;
* https://www.youtube.com/watch?v=fASGU7Og5_4&amp;amp;feature=emb_title&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5552</id>
		<title>BIAS Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5552"/>
		<updated>2020-12-21T19:46:13Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Counter Measures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description == &lt;br /&gt;
Bluetooth Impersonation AttackS (BIAS) was found 2020 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
The Bluetooth specification includes authentication mechanisms based on long term pairing key, which are created to protect against impersonation attacks. This attack shows that this mechanisms are not reliable and that an attacker can use the mechanisms to impersonate any master or slave device.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
* Victims Alice &amp;amp; Bob share a long term key and support mutual authentication&lt;br /&gt;
*Attacker Charlie presents to Bob as Alice and downgrades mutual authentication to unilateral authentication.&lt;br /&gt;
* Abuses Bluetooth role switching to become the new authenticator. Authenticates bob and starts a secure session with Bob as Alice without having to authenticate.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/bias&lt;br /&gt;
* CYW920819 devboard&lt;br /&gt;
* Google Pixel 2&lt;br /&gt;
* Linux laptop that can parse diagnostic messages from  CYW920819 devboard &amp;amp; run internalblue. Can be achieved by using vanilla linux-4.14.111 kernel compiled with provided modifications of github.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
* Open &#039;&#039;&#039;IF_PIXEL2&#039;&#039;&#039; File&lt;br /&gt;
** Change the &#039;&#039;&#039;btadd&#039;&#039;&#039; to the Bluetooth address of the impersonated device&lt;br /&gt;
** Change the &#039;&#039;&#039;btname&#039;&#039;&#039; to the Bluetooth name of the impersonated device&lt;br /&gt;
** Change lmin and lmax to set the max and min entropy value for the session key &lt;br /&gt;
* Connect the devboard to laptop via USB&lt;br /&gt;
* Attach to the devboard with &#039;&#039;&#039;btattach -B /dev/ttyUSB1 -S 115200 &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
* Enable the devboard diagnostic mode with &#039;&#039;&#039;sudo python2 enable_diag.py&#039;&#039;&#039;&lt;br /&gt;
* Start internalblue with &#039;&#039;&#039;sudo internalblue&#039;&#039;&#039;&lt;br /&gt;
* Start wireshark monitoring from internalblue&lt;br /&gt;
* Use &#039;&#039;&#039;make generate&#039;&#039;&#039; to create &#039;&#039;&#039;bias.py&#039;&#039;&#039;&lt;br /&gt;
* Pair the impersonated victim (Pixel 2) and the other victim device&lt;br /&gt;
* Disconnect them and disable Bluetooth on the impersonated device (Pixel 2)&lt;br /&gt;
* Start a connection from the victim to the impersonated device (BIAS slave impersonation)&lt;br /&gt;
* Start a connection from the attack device to the victim (BIAS master impersonation)&lt;br /&gt;
&lt;br /&gt;
== Countermeasures == &lt;br /&gt;
To reduce the lack of integrity protection during secure connection establishment, the standard should force to use the long term key to protect the connection establishment. Before creating a secure connection the long term key should be available. The standard should force to always use the legacy authentication procedure mutually.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://francozappa.github.io/publication/bias/paper.pdf&lt;br /&gt;
* https://github.com/francozappa/bias&lt;br /&gt;
* https://francozappa.github.io/about-bias/&lt;br /&gt;
* https://www.youtube.com/watch?v=fASGU7Og5_4&amp;amp;feature=emb_title&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5551</id>
		<title>KNOB Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5551"/>
		<updated>2020-12-21T19:45:46Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
Bluetooth specification has an encryption key negotiation protocol to negotiate encryption keys. Attackers can manipulate this protocol to force encryption keys with 1 Byte of entropy without protecting the integrity of the negotiation process. This enables brute forcing the encryption keys in real time.&lt;br /&gt;
[[File:bluetoothKNOB.PNG|300px|thumb|right|Key negotiation protocol]]&lt;br /&gt;
&lt;br /&gt;
== Key negotiation protocol ==&lt;br /&gt;
&lt;br /&gt;
The goal of this protocol is to compute a session key starting from a long term shared secret&lt;br /&gt;
At the top is Encryption Key Generation Function that takes as input the longterm secret a bunch of nonces and Bluetooth address of Slave and is computing Kc a key with 16 Bytes of entropy this key is not used as session key it is processed by an entropy reduction function that is used to modify the entropy to N bytes and this N number is computed from an entropy negotiation phase that is performed by alice and bob. This session key is used to encrypt and decrypt the packets using E0 stream cipher in case using legacy security mode or AES-CCM if both devices supporting Bluetooth secure connections.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stages of Attack ==&lt;br /&gt;
KNOB Attack has 4 Main stages&lt;br /&gt;
* &#039;&#039;&#039;First stage:&#039;&#039;&#039; Alice and Bob (Victims) are pairing using the strongest security mechanisms Secure Simple pairing. They are establishing a long term secret and the attacker is not there. &lt;br /&gt;
* &#039;&#039;&#039;Second Phase:&#039;&#039;&#039; Alice and Bob wants to establish a new encrypted session and Charlie(Attacker) is in Bluetooth range with the victim.  &lt;br /&gt;
* &#039;&#039;&#039;Phase 3:&#039;&#039;&#039; Charlie is able to manipulate the entropy negotiation phase of Bluetooth and let the two victim negotiate an encryption key with one byte of entropy.&lt;br /&gt;
* &#039;&#039;&#039;Phase 4:&#039;&#039;&#039; Charlie is able to eavesdropping ciphertext and using the ciphertext to bruteforce the encryption key and the brute force is in real time because If you use an encryption key with 1 Byte of entropy then you have to brute force one key out of 256 possibilities.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/knob&lt;br /&gt;
* Rooted Nexus 5 running the internalblue/android_bluetooth_stack/nexus5_android6_0_1/bluetooth.default.so custom Android Bluetooth stack&lt;br /&gt;
* Computer running Linux operating system&lt;br /&gt;
* Wireshark&lt;br /&gt;
&lt;br /&gt;
Internalblue is a framework which can patch the firmware from the operating system.&lt;br /&gt;
This attack is simulating an attacker using Internalblue, because the setup is easier, has a higher reliability, and it is cheaper than over the air.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
&lt;br /&gt;
* Connect Nexus 5 via USB to the computer&lt;br /&gt;
* Configure and install modified internalblue v0.1&lt;br /&gt;
** Edit &#039;&#039;&#039;internalblue/internalblue/core.py&#039;&#039;&#039; and set &#039;&#039;&#039;NEXUS5_MODE&#039;&#039;&#039; to which mode you want to perform&lt;br /&gt;
** Set &#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039; then the Nexus 5 is the master device or &#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039; to set Nexus 5 to the slave device&lt;br /&gt;
** In terminal, switch into the &#039;&#039;&#039;internalblue&#039;&#039;&#039; directory, and run &#039;&#039;&#039;sudo python2 setup.py install&#039;&#039;&#039;&lt;br /&gt;
** Open a terminal and run internalblue (Internalblue is inserted in PATH Variable)&lt;br /&gt;
* In the internalblue menu start LMP monitoring with monitor lmp start&lt;br /&gt;
** A Wireshark window should pop up&lt;br /&gt;
* Pair target with Nexus 5&lt;br /&gt;
* When Nexus 5 is as the master configured (&#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039;) then you have to start the connection from the Nexus 5 to the target device.&lt;br /&gt;
* When the Nexus 5 is as the slave configured (&#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039;) then you have to start the connection from the victim to the Nexus 5.&lt;br /&gt;
* In Wireshark you can see that the devices have negotiated an encryption key with 1 byte of entropy.&lt;br /&gt;
&lt;br /&gt;
== Countermeasures ==&lt;br /&gt;
* Force minimum and maximum amount of entropy that cannot be easily brute forced.&lt;br /&gt;
* Encryption keys with a fixed number of entropy. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.usenix.org/conference/usenixsecurity19/presentation/antonioli&lt;br /&gt;
* https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;br /&gt;
* https://francozappa.github.io/publication/knob/&lt;br /&gt;
* https://github.com/francozappa/knob&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5550</id>
		<title>KNOB Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5550"/>
		<updated>2020-12-21T19:45:03Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Perform Attack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
Bluetooth specification has an encryption key negotiation protocol to negotiate encryption keys. Attackers can manipulate this protocol to force encryption keys with 1 Byte of entropy without protecting the integrity of the negotiation process. This enables brute forcing the encryption keys in real time.&lt;br /&gt;
[[File:bluetoothKNOB.PNG|300px|thumb|right|Key negotiation protocol]]&lt;br /&gt;
&lt;br /&gt;
== Key negotiation protocol ==&lt;br /&gt;
&lt;br /&gt;
The goal of this protocol is to compute a session key starting from a long term shared secret&lt;br /&gt;
At the top is Encryption Key Generation Function that takes as input the longterm secret a bunch of nonces and Bluetooth address of Slave and is computing Kc a key with 16 Bytes of entropy this key is not used as session key it is processed by an entropy reduction function that is used to modify the entropy to N bytes and this N number is computed from an entropy negotiation phase that is performed by alice and bob. This session key is used to encrypt and decrypt the packets using E0 stream cipher in case using legacy security mode or AES-CCM if both devices supporting Bluetooth secure connections.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stages of Attack ==&lt;br /&gt;
KNOB Attack has 4 Main stages&lt;br /&gt;
* &#039;&#039;&#039;First stage:&#039;&#039;&#039; Alice and Bob (Victims) are pairing using the strongest security mechanisms Secure Simple pairing. They are establishing a long term secret and the attacker is not there. &lt;br /&gt;
* &#039;&#039;&#039;Second Phase:&#039;&#039;&#039; Alice and Bob wants to establish a new encrypted session and Charlie(Attacker) is in Bluetooth range with the victim.  &lt;br /&gt;
* &#039;&#039;&#039;Phase 3:&#039;&#039;&#039; Charlie is able to manipulate the entropy negotiation phase of Bluetooth and let the two victim negotiate an encryption key with one byte of entropy.&lt;br /&gt;
* &#039;&#039;&#039;Phase 4:&#039;&#039;&#039; Charlie is able to eavesdropping ciphertext and using the ciphertext to bruteforce the encryption key and the brute force is in real time because If you use an encryption key with 1 Byte of entropy then you have to brute force one key out of 256 possibilities.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/knob&lt;br /&gt;
* Rooted Nexus 5 running the internalblue/android_bluetooth_stack/nexus5_android6_0_1/bluetooth.default.so custom Android Bluetooth stack&lt;br /&gt;
* Computer running Linux operating system&lt;br /&gt;
* Wireshark&lt;br /&gt;
&lt;br /&gt;
Internalblue is a framework which can patch the firmware from the operating system.&lt;br /&gt;
This attack is simulating an attacker using Internalblue, because the setup is easier, has a higher reliability, and it is cheaper than over the air.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
&lt;br /&gt;
* Connect Nexus 5 via USB to the computer&lt;br /&gt;
* Configure and install modified internalblue v0.1&lt;br /&gt;
** Edit &#039;&#039;&#039;internalblue/internalblue/core.py&#039;&#039;&#039; and set &#039;&#039;&#039;NEXUS5_MODE&#039;&#039;&#039; to which mode you want to perform&lt;br /&gt;
** Set &#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039; then the Nexus 5 is the master device or &#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039; to set Nexus 5 to the slave device&lt;br /&gt;
** In terminal, switch into the &#039;&#039;&#039;internalblue&#039;&#039;&#039; directory, and run &#039;&#039;&#039;sudo python2 setup.py install&#039;&#039;&#039;&lt;br /&gt;
** Open a terminal and run internalblue (Internalblue is inserted in PATH Variable)&lt;br /&gt;
* In the internalblue menu start LMP monitoring with monitor lmp start&lt;br /&gt;
** A Wireshark window should pop up&lt;br /&gt;
* Pair target with Nexus 5&lt;br /&gt;
* When Nexus 5 is as the master configured (&#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039;) then you have to start the connection from the Nexus 5 to the target device.&lt;br /&gt;
* When the Nexus 5 is as the slave configured (&#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039;) then you have to start the connection from the victim to the Nexus 5.&lt;br /&gt;
* In Wireshark you can see that the devices have negotiated an encryption key with 1 byte of entropy.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.usenix.org/conference/usenixsecurity19/presentation/antonioli&lt;br /&gt;
* https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;br /&gt;
* https://francozappa.github.io/publication/knob/&lt;br /&gt;
* https://github.com/francozappa/knob&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5549</id>
		<title>KNOB Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5549"/>
		<updated>2020-12-21T19:44:02Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Stages of Attack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
Bluetooth specification has an encryption key negotiation protocol to negotiate encryption keys. Attackers can manipulate this protocol to force encryption keys with 1 Byte of entropy without protecting the integrity of the negotiation process. This enables brute forcing the encryption keys in real time.&lt;br /&gt;
[[File:bluetoothKNOB.PNG|300px|thumb|right|Key negotiation protocol]]&lt;br /&gt;
&lt;br /&gt;
== Key negotiation protocol ==&lt;br /&gt;
&lt;br /&gt;
The goal of this protocol is to compute a session key starting from a long term shared secret&lt;br /&gt;
At the top is Encryption Key Generation Function that takes as input the longterm secret a bunch of nonces and Bluetooth address of Slave and is computing Kc a key with 16 Bytes of entropy this key is not used as session key it is processed by an entropy reduction function that is used to modify the entropy to N bytes and this N number is computed from an entropy negotiation phase that is performed by alice and bob. This session key is used to encrypt and decrypt the packets using E0 stream cipher in case using legacy security mode or AES-CCM if both devices supporting Bluetooth secure connections.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stages of Attack ==&lt;br /&gt;
KNOB Attack has 4 Main stages&lt;br /&gt;
* &#039;&#039;&#039;First stage:&#039;&#039;&#039; Alice and Bob (Victims) are pairing using the strongest security mechanisms Secure Simple pairing. They are establishing a long term secret and the attacker is not there. &lt;br /&gt;
* &#039;&#039;&#039;Second Phase:&#039;&#039;&#039; Alice and Bob wants to establish a new encrypted session and Charlie(Attacker) is in Bluetooth range with the victim.  &lt;br /&gt;
* &#039;&#039;&#039;Phase 3:&#039;&#039;&#039; Charlie is able to manipulate the entropy negotiation phase of Bluetooth and let the two victim negotiate an encryption key with one byte of entropy.&lt;br /&gt;
* &#039;&#039;&#039;Phase 4:&#039;&#039;&#039; Charlie is able to eavesdropping ciphertext and using the ciphertext to bruteforce the encryption key and the brute force is in real time because If you use an encryption key with 1 Byte of entropy then you have to brute force one key out of 256 possibilities.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/knob&lt;br /&gt;
* Rooted Nexus 5 running the internalblue/android_bluetooth_stack/nexus5_android6_0_1/bluetooth.default.so custom Android Bluetooth stack&lt;br /&gt;
* Computer running Linux operating system&lt;br /&gt;
* Wireshark&lt;br /&gt;
&lt;br /&gt;
Internalblue is a framework which can patch the firmware from the operating system.&lt;br /&gt;
This attack is simulating an attacker using Internalblue, because the setup is easier, has a higher reliability, and it is cheaper than over the air.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
&lt;br /&gt;
* Connect Nexus 5 via USB to the computer&lt;br /&gt;
* Configure and install modified internalblue v0.1&lt;br /&gt;
** Edit &#039;&#039;&#039;internalblue/internalblue/core.py&#039;&#039;&#039; and set &#039;&#039;&#039;NEXUS5_MODE&#039;&#039;&#039; to which mode you want to perform&lt;br /&gt;
** Set &#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039; then the Nexus 5 is the master device or &#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039; to set Nexus 5 to the slave device&lt;br /&gt;
** In terminal, switch into the &#039;&#039;&#039;internalblue&#039;&#039;&#039; directory, and run &#039;&#039;&#039;sudo python2 setup.py install&#039;&#039;&#039;&lt;br /&gt;
** Open a terminal and run internalblue (Internalblue is inserted in PATH Variable)&lt;br /&gt;
* In the internalblue menu start LMP monitoring with monitor lmp start&lt;br /&gt;
** A Wireshark window should pop up&lt;br /&gt;
* Pair target with Nexus 5&lt;br /&gt;
* When Nexus 5 is as the master configured (&#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039;) then you have to start the connection from the Nexus 5 to the target device.&lt;br /&gt;
* When the Nexus 5 is as the slave configured (NEXUS5_MODE = SLAVE_MITM) then you have to start the connection from the victim to the Nexus 5.&lt;br /&gt;
* In Wireshark you can see that the devices have negotiated an encryption key with 1 byte of entropy.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.usenix.org/conference/usenixsecurity19/presentation/antonioli&lt;br /&gt;
* https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;br /&gt;
* https://francozappa.github.io/publication/knob/&lt;br /&gt;
* https://github.com/francozappa/knob&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5536</id>
		<title>BIAS Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5536"/>
		<updated>2020-12-21T19:10:13Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description == &lt;br /&gt;
Bluetooth Impersonation AttackS (BIAS) was found 2020 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
The Bluetooth specification includes authentication mechanisms based on long term pairing key, which are created to protect against impersonation attacks. This attack shows that this mechanisms are not reliable and that an attacker can use the mechanisms to impersonate any master or slave device.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
* Victims Alice &amp;amp; Bob share a long term key and support mutual authentication&lt;br /&gt;
*Attacker Charlie presents to Bob as Alice and downgrades mutual authentication to unilateral authentication.&lt;br /&gt;
* Abuses Bluetooth role switching to become the new authenticator. Authenticates bob and starts a secure session with Bob as Alice without having to authenticate.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/bias&lt;br /&gt;
* CYW920819 devboard&lt;br /&gt;
* Google Pixel 2&lt;br /&gt;
* Linux laptop that can parse diagnostic messages from  CYW920819 devboard &amp;amp; run internalblue. Can be achieved by using vanilla linux-4.14.111 kernel compiled with provided modifications of github.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
* Open &#039;&#039;&#039;IF_PIXEL2&#039;&#039;&#039; File&lt;br /&gt;
** Change the &#039;&#039;&#039;btadd&#039;&#039;&#039; to the Bluetooth address of the impersonated device&lt;br /&gt;
** Change the &#039;&#039;&#039;btname&#039;&#039;&#039; to the Bluetooth name of the impersonated device&lt;br /&gt;
** Change lmin and lmax to set the max and min entropy value for the session key &lt;br /&gt;
* Connect the devboard to laptop via USB&lt;br /&gt;
* Attach to the devboard with &#039;&#039;&#039;btattach -B /dev/ttyUSB1 -S 115200 &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
* Enable the devboard diagnostic mode with &#039;&#039;&#039;sudo python2 enable_diag.py&#039;&#039;&#039;&lt;br /&gt;
* Start internalblue with &#039;&#039;&#039;sudo internalblue&#039;&#039;&#039;&lt;br /&gt;
* Start wireshark monitoring from internalblue&lt;br /&gt;
* Use &#039;&#039;&#039;make generate&#039;&#039;&#039; to create &#039;&#039;&#039;bias.py&#039;&#039;&#039;&lt;br /&gt;
* Pair the impersonated victim (Pixel 2) and the other victim device&lt;br /&gt;
* Disconnect them and disable Bluetooth on the impersonated device (Pixel 2)&lt;br /&gt;
* Start a connection from the victim to the impersonated device (BIAS slave impersonation)&lt;br /&gt;
* Start a connection from the attack device to the victim (BIAS master impersonation)&lt;br /&gt;
&lt;br /&gt;
== Counter Measures == &lt;br /&gt;
To reduce the lack of integrity protection during secure connection establishment, the standard should force to use the long term key to protect the connection establishment. Before creating a secure connection the long term key should be available. The standard should force to always use the legacy authentication procedure mutually.&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://francozappa.github.io/publication/bias/paper.pdf&lt;br /&gt;
* https://github.com/francozappa/bias&lt;br /&gt;
* https://francozappa.github.io/about-bias/&lt;br /&gt;
* https://www.youtube.com/watch?v=fASGU7Og5_4&amp;amp;feature=emb_title&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5534</id>
		<title>BIAS Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5534"/>
		<updated>2020-12-21T19:09:21Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description == &lt;br /&gt;
Bluetooth Impersonation AttackS (BIAS) was found 2020 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
The Bluetooth specification includes authentication mechanisms based on long term pairing key, which are created to protect against impersonation attacks. This attack shows that this mechanisms are not reliable and that an attacker can use the mechanisms to impersonate any master or slave device.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
* Victims Alice &amp;amp; Bob share a long term key and support mutual authentication&lt;br /&gt;
*Attacker Charlie presents to Bob as Alice and downgrades mutual authentication to unilateral authentication.&lt;br /&gt;
* Abuses Bluetooth role switching to become the new authenticator. Authenticates bob and starts a secure session with Bob as Alice without having to authenticate.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/bias&lt;br /&gt;
* CYW920819 devboard&lt;br /&gt;
* Google Pixel 2&lt;br /&gt;
* Linux laptop that can parse diagnostic messages from  CYW920819 devboard &amp;amp; run internalblue. Can be accomplished by using vanilla linux-4.14.111 kernel compiled with provided modifications of github.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
* Open &#039;&#039;&#039;IF_PIXEL2&#039;&#039;&#039; File&lt;br /&gt;
** Change the &#039;&#039;&#039;btadd&#039;&#039;&#039; to the Bluetooth address of the impersonated device&lt;br /&gt;
** Change the &#039;&#039;&#039;btname&#039;&#039;&#039; to the Bluetooth name of the impersonated device&lt;br /&gt;
** Change lmin and lmax to set the max and min entropy value for the session key &lt;br /&gt;
* Connect the devboard to laptop via USB&lt;br /&gt;
* Attach to the devboard with &#039;&#039;&#039;btattach -B /dev/ttyUSB1 -S 115200 &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
* Enable the devboard diagnostic mode with &#039;&#039;&#039;sudo python2 enable_diag.py&#039;&#039;&#039;&lt;br /&gt;
* Start internalblue with &#039;&#039;&#039;sudo internalblue&#039;&#039;&#039;&lt;br /&gt;
* Start wireshark monitoring from internalblue&lt;br /&gt;
* Use &#039;&#039;&#039;make generate&#039;&#039;&#039; to create &#039;&#039;&#039;bias.py&#039;&#039;&#039;&lt;br /&gt;
* Pair the impersonated victim (Pixel 2) and the other victim device&lt;br /&gt;
* Disconnect them and disable Bluetooth on the impersonated device (Pixel 2)&lt;br /&gt;
* Start a connection from the victim to the impersonated device (BIAS slave impersonation)&lt;br /&gt;
* Start a connection from the attack device to the victim (BIAS master impersonation)&lt;br /&gt;
&lt;br /&gt;
== Counter Measures == &lt;br /&gt;
To reduce the lack of integrity protection during secure connection establishment, the standard should force to use the long term key to protect the connection establishment. Before creating a secure connection the long term key should be available. The standard should force to always use the legacy authentication procedure mutually.&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://francozappa.github.io/publication/bias/paper.pdf&lt;br /&gt;
* https://github.com/francozappa/bias&lt;br /&gt;
* https://francozappa.github.io/about-bias/&lt;br /&gt;
* https://www.youtube.com/watch?v=fASGU7Og5_4&amp;amp;feature=emb_title&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5533</id>
		<title>BIAS Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=BIAS_Attack&amp;diff=5533"/>
		<updated>2020-12-21T19:08:44Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: Created page with &amp;quot;== Summary ==  Bluetooth Impersonation AttackS (BIAS) was found 2020 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen. The Bluetooth specification includes a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
Bluetooth Impersonation AttackS (BIAS) was found 2020 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
The Bluetooth specification includes authentication mechanisms based on long term pairing key, which are created to protect against impersonation attacks. This attack shows that this mechanisms are not reliable and that an attacker can use the mechanisms to impersonate any master or slave device.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
* Victims Alice &amp;amp; Bob share a long term key and support mutual authentication&lt;br /&gt;
*Attacker Charlie presents to Bob as Alice and downgrades mutual authentication to unilateral authentication.&lt;br /&gt;
* Abuses Bluetooth role switching to become the new authenticator. Authenticates bob and starts a secure session with Bob as Alice without having to authenticate.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/bias&lt;br /&gt;
* CYW920819 devboard&lt;br /&gt;
* Google Pixel 2&lt;br /&gt;
* Linux laptop that can parse diagnostic messages from  CYW920819 devboard &amp;amp; run internalblue. Can be accomplished by using vanilla linux-4.14.111 kernel compiled with provided modifications of github.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
* Open &#039;&#039;&#039;IF_PIXEL2&#039;&#039;&#039; File&lt;br /&gt;
** Change the &#039;&#039;&#039;btadd&#039;&#039;&#039; to the Bluetooth address of the impersonated device&lt;br /&gt;
** Change the &#039;&#039;&#039;btname&#039;&#039;&#039; to the Bluetooth name of the impersonated device&lt;br /&gt;
** Change lmin and lmax to set the max and min entropy value for the session key &lt;br /&gt;
* Connect the devboard to laptop via USB&lt;br /&gt;
* Attach to the devboard with &#039;&#039;&#039;btattach -B /dev/ttyUSB1 -S 115200 &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
* Enable the devboard diagnostic mode with &#039;&#039;&#039;sudo python2 enable_diag.py&#039;&#039;&#039;&lt;br /&gt;
* Start internalblue with &#039;&#039;&#039;sudo internalblue&#039;&#039;&#039;&lt;br /&gt;
* Start wireshark monitoring from internalblue&lt;br /&gt;
* Use &#039;&#039;&#039;make generate&#039;&#039;&#039; to create &#039;&#039;&#039;bias.py&#039;&#039;&#039;&lt;br /&gt;
* Pair the impersonated victim (Pixel 2) and the other victim device&lt;br /&gt;
* Disconnect them and disable Bluetooth on the impersonated device (Pixel 2)&lt;br /&gt;
* Start a connection from the victim to the impersonated device (BIAS slave impersonation)&lt;br /&gt;
* Start a connection from the attack device to the victim (BIAS master impersonation)&lt;br /&gt;
&lt;br /&gt;
== Counter Measures == &lt;br /&gt;
To reduce the lack of integrity protection during secure connection establishment, the standard should force to use the long term key to protect the connection establishment. Before creating a secure connection the long term key should be available. The standard should force to always use the legacy authentication procedure mutually.&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://francozappa.github.io/publication/bias/paper.pdf&lt;br /&gt;
* https://github.com/francozappa/bias&lt;br /&gt;
* https://francozappa.github.io/about-bias/&lt;br /&gt;
* https://www.youtube.com/watch?v=fASGU7Og5_4&amp;amp;feature=emb_title&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5506</id>
		<title>Bluetooth Security Features</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5506"/>
		<updated>2020-12-21T18:31:26Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This Page is work in progress please come back later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This documentation is a survey about the security features of Bluetooth Classic and Bluetooth Low Energy. &lt;br /&gt;
&lt;br /&gt;
== Basic Security Services ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Authentication:&#039;&#039;&#039; verifies the identity of communicating devices based on their Bluetooth address. User authentication is not provided by the Bluetooth Specification. &lt;br /&gt;
* &#039;&#039;&#039;Confidentiality:&#039;&#039;&#039; prevents eavesdropping of the transmitted data by an untrusted third person in the piconet. Confidentiality is created by data encryption.  &lt;br /&gt;
* &#039;&#039;&#039;Authorization:&#039;&#039;&#039; controls the access of the resources. It assures that only authorized devices get permitted to access a service.&lt;br /&gt;
* &#039;&#039;&#039;Message Integrity:&#039;&#039;&#039; checks if the data was altered during the transmission.&lt;br /&gt;
* &#039;&#039;&#039;Pairing/Bonding:&#039;&#039;&#039; creates shared secret keys to use them in subsequent connections.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic Security  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-1.png|500px|thumb|right|BR/EDR/HS Security Modes ]]&lt;br /&gt;
&lt;br /&gt;
Bluetooth Classic defines encryption and authentication during two different stages of the communication setup. The stages can be differed in Link-level and Service-level. Link-level enforced security features occur before the Bluetooth physical link is fully established. Service-level enforced security features occur after the physical link is already established and while the logical link gets established.Security mode one to the three were defined before Bluetooth version 2.1 came out. Bluetooth version 2.1 added the fourth security mode.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 1  ===&lt;br /&gt;
This mode is considered as non-secure because it doesn’t use authentication nor encryption.  Security Mode 1 is only supported by today&#039;s Bluetooth devices to communicate with old devices that are not capable of the other security modes.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 2  ===&lt;br /&gt;
Security Mode 2 is called Service Level Enforced Security, access to services depends on the device. Trusted devices may use all services, untrusted devices only to a limited extent. There are three service security levels.&lt;br /&gt;
* Level 1 open to all devices. It is a default mode that also allows outdated applications.&lt;br /&gt;
* Level 2 authentication required, a permanently installed PIN is sufficient.&lt;br /&gt;
* Level 3 requires authentication and authorization, a PIN must be entered.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 3  ===&lt;br /&gt;
This security mode is a link level security mode and security procedures get initiated before the physical link is fully established. Authentication and Encryption is fully supported by security mode 3 connections. Furthermore, service discovery can only be performed with an authenticated device which encrypts its traffic.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 4  ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-2.png|500px|thumb|right|BR/EDR/HS Security Mode 4 Levels Summar]]&lt;br /&gt;
&lt;br /&gt;
Security mode 4 was introduced in Bluetooth version 2.1 and is a service level enforces security mode which security mechanisms get initiated after physical and logical link setup. Security mode takes advantage of the Secure Simple Pairing (SSP) Mechanism. SSP in Bluetooth version 4.1 uses the P-256 elliptic curve to generate the link key. Bluetooth 4.1 uses Hash Messages Authentication Codes Secure Hash Algorithm with 256-bit (HMAC-SHA-256) for integrity checks. For encryption the AES-Counter with CBC-MAC (AES-CCM) cypher is used. The P-256 elliptic curve, HMAC-SHA-256 and AES-CCM are security mechanisms which got approved by the Federal Information Processing Standard (FIPS). Security mode 4 gets differentiated into 5 different layers with different security levels.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer 0:&#039;&#039;&#039; Layer 0 is only used by the Service Discovery Protocol (SDP). This layer doesn’t have any security features.&lt;br /&gt;
* &#039;&#039;&#039;Layer 1:&#039;&#039;&#039; Layer 1 doesn’t use any security.&lt;br /&gt;
* &#039;&#039;&#039;Layer 2:&#039;&#039;&#039; Layer 2 uses an unauthenticated link key. &lt;br /&gt;
* &#039;&#039;&#039;Layer 3:&#039;&#039;&#039; Layer 3 required an authenticated link key.&lt;br /&gt;
* &#039;&#039;&#039;Layer 4:&#039;&#039;&#039; Layer 4 uses secure connection in addition to the authenticated link key&lt;br /&gt;
&lt;br /&gt;
Whether or not a link key is authenticated depends on the SSP association model used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Secure Simple Pairing (SSP)  ===&lt;br /&gt;
&lt;br /&gt;
Secure Simple Pairing was introduced with Security Mode 4 at Bluetooth Version 2.1 and got improved in Version 4.1. The main goal of secure simple pairing is to simplify the pairing process for users. The secondary goal is to maintain or enhance the security of Bluetooth. SSP has two security goals, passive eavesdropping protection and man-in-the-middle protection. SSP provide several association models suited for all input/output capability combinations. Some of these association models are protected against passive and active man-in-the-middle (MITM) attacks during pairing by using ECDH public key cryptography.&lt;br /&gt;
&lt;br /&gt;
[[File:Association models.png|500px|thumb|right|Association models]]&lt;br /&gt;
&lt;br /&gt;
==== Numeric Comparison ====&lt;br /&gt;
Numeric comparison was designed for devices, where both can display a six-digit number and allow a user input to accept and deny the connection. During the Paring both devices show a six-digit code on their displays. The user can accept the parring if the displayed numbers are the same. The connection is secure against MITM attacks and eavesdropping, if the paring was done correctly.  &lt;br /&gt;
&lt;br /&gt;
==== Passkey Entry ====&lt;br /&gt;
This model can be used where one device a has a display that sows a six-digit number and the other device has a digit input. Device a show a code that must be entered into the keyboard of the other device to establish the connection. This model is also secure against MITM attacks and eavesdropping.&lt;br /&gt;
&lt;br /&gt;
==== Out of Band (OOB) ====&lt;br /&gt;
The out of band model uses an additional wireless or wired technology like Near Field Communication (NFC) to exchange the needed cryptographic keys. This model’s security is only as secure as the out of band technology. Even though, this association model is associated to be secure against eavesdropping and MITM attacks.&lt;br /&gt;
&lt;br /&gt;
==== Just Works ====&lt;br /&gt;
The just works model is not secured against eavesdropping and MITM attacks. This model is designed for connection where both devices have no input or output capabilities.&lt;br /&gt;
&lt;br /&gt;
==== SSP Phases ====&lt;br /&gt;
Secure Simple Pairing consists of 5 phases:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public key exchange:&#039;&#039;&#039; Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair. Pairing starts when the initiating device sends its public key to the receiving device. The responding device replies with its own public key, when both devices support Secure Connections then P-256 elliptic curve will be used, if at least one device does not support Secure Connections the P-192 elliptic curve will be used.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 1:&#039;&#039;&#039; Phase 2 consist of three protocols: Numeric Comparison, Out-of-Band and Passkey Entry. The protocol is selected depending on the IO capabilities of the device.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 2:&#039;&#039;&#039; Phase 3 confirms that the exchange between the two participants has been successfully completed. Both devices calculate a new confirmation value that takes into account the previously exchanged values and the new shared key. The initiator sends the new confirmations value to the responding device and is checked by it. If a failure occurs, the protocol should abort.&lt;br /&gt;
* &#039;&#039;&#039;Link key calculation:&#039;&#039;&#039; After both devices confirm the pairing, a link key is calculated using the shared key and the publicly exchanged data. The link key is used to maintain pairing.&lt;br /&gt;
* &#039;&#039;&#039;Link Manager Protocol Authentication and Encryption:&#039;&#039;&#039; Authentication and generation of the encryption key.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Pairing ===&lt;br /&gt;
With PIN / Legacy Pairing, the link keys are derived from a PIN entered by the user in one or both devices, depending on the configuration and device type. If the PIN is smaller than 16 bytes, the Bluetooth address of the initializing device is used for filling. After the key generation has been completed, the devices authenticate each other to ensure that both are using the same link key.This method only serves to mutually identify the devices and cannot prevent a man-in-the-middle attack. An attacker who knows the PIN can calculate the key from it.&lt;br /&gt;
&lt;br /&gt;
=== Key Generation ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Key Generation ====&lt;br /&gt;
The link key is a 128-bit random number, shared between two or multiple participants, and is the basis of all security transactions between these participants. The link key must be created and then distributed to the associated devices in order to be used for the authentication procedure. The initialization key is used temporarily during initialization and should be discarded afterwards. The initialization key is the result of the E22 algorithm the input parameters are a Bluetooth address, a PIN and a random number. The initialization key is used for the key exchange during the generation of a link key.&lt;br /&gt;
&lt;br /&gt;
==== Secure Key Generation ====&lt;br /&gt;
Phase 4 (Link key calculation) of Secure Simple Pairing the link key will be established by using Elliptic Curve Diffie-Hellman public/private key pairs.&lt;br /&gt;
&lt;br /&gt;
=== Confidentiality of the data ===&lt;br /&gt;
The Bluetooth standard defines three encryption modes for data traffic, but only two of them actuals provide confidentiality. The modes are as follows: &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 1:&#039;&#039;&#039; The data traffic is unencrypted &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 2:&#039;&#039;&#039; Individually addressed traffic is encrypted based on individual link keys but broadcast traffic is not.&lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 3:&#039;&#039;&#039; Individually addressed traffic and broadcast traffic is encrypted using an encryption key based on the master link key.&lt;br /&gt;
For encryption mode 2 and 3 is either the AES-CCM or E0 stream cipher used. Bluetooth Security Mode 4 encrypts all data traffic, expect service discovery messages&lt;br /&gt;
&lt;br /&gt;
=== Trust Levels and Service Security Levels.=== &lt;br /&gt;
In addition to the security modes, exist different levels of service security and trust.&lt;br /&gt;
The trust levels can be differentiated into trusted and untrusted. A trusted device has an established relation ship to the device and has full access to all the services. The untrusted device doesn’t have a relationship to the other device and has only a restricted access to the services.&lt;br /&gt;
The Service security level depend on the used Security mode. There are no Service security levels defined for Security mode 1 and 3. Security mode 2 has the following Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Authentication required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Encryption required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Authorization required&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Security mode 2 defines the following five Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Service Level 0:&#039;&#039;&#039; No MITM protection, encryption, or user interaction required.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 1:&#039;&#039;&#039; MITM protection and encryption not required. Minimal user interaction.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 2:&#039;&#039;&#039; Requires encryption only; MITM protection is not necessary.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 3:&#039;&#039;&#039; Requires MITM protection and encryption; user interaction is acceptable.[[File:LABluetooth.PNG|350px|thumb|right|Legacy Authentication ]]&lt;br /&gt;
* &#039;&#039;&#039;Service Level 4:&#039;&#039;&#039; Requires MITM protection and encryption with 128-bit strength; user interaction is acceptable.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Authentication ====&lt;br /&gt;
&lt;br /&gt;
Legacy authentication uses a challenge-response scheme, in which a symmetric key is used to check the claimant’s key knowledge through a two-step protocol. In legacy authentication, the verifier is not required to be the master, the application indicates which device has to be authenticated. The second implies that the correct claimaint/verifier pair share the same secret keys. The verifier challenges the claimaint to authenticate a random input. Some applications only require a one-way authentication.[[File:SABluetooth.PNG|400px|thumb|right|Secure Authentication ]] Some peer-to-peer applications should use two authentication procedures in which each device is the challenger. In Figure is an example of a legacy authentication. The verifier has 3 input parameters, random input, bluetooth address and the link key the result is the SRES. The verifier sends the random message to the claimaint and does the same as the verifier and send back its SRES.&lt;br /&gt;
&lt;br /&gt;
==== Secure Authentication ====&lt;br /&gt;
&lt;br /&gt;
Secure Authentication follows the same principle but with two algorithms and several input parameters. Both devices act as a verifier and claimaint in the same sequence. Master Sends a random message to the Slave and vice verca. Both parties do their calculations and send each other their results.&lt;br /&gt;
The input parameter BD_ADDRm is the Bluetooth Address from the Master, BD_ADDRs is the bluetooth Address from the Slave, btdk is a secret string, Link Key is the shared key, AU_RANDm is the random message from the Master, AU_RANDs is the random message from the Slave, SRESm is the result of the Master, SRESs is the result of the Slave.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Low Energy security ==&lt;br /&gt;
Fundamentals of the BLE Standard can be found in the [[BLE Fundamentals]] documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bluetooth Low Energy security modes are similar to the Security Modes 2 and 4 of Bluetooth Classic, but each service can have its own security requirements.  Furthermore, Bluetooth Low Energy has two security modes with multiple security levels.&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 1 is associated with encryption&lt;br /&gt;
*Level 1 does neither use authentication nor encryption.  &lt;br /&gt;
*Level 2 uses unauthenticated pairing with encryption.&lt;br /&gt;
*Level 3 uses authenticated pairing with encryption.&lt;br /&gt;
*Level 4 which uses authenticated low energy Secure Connections pairing with encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 2 is associated with encryption data integrity&lt;br /&gt;
*Level 1 uses unauthenticated pairing with data signing.&lt;br /&gt;
*Level 2 uses authenticated pairing with data signing.&lt;br /&gt;
&lt;br /&gt;
Security Mode 1 Level 4 is considered to create the strongest connections because it uses AES-CMAC and P-256 elliptic curve for pairing and encryption.  Security Mode 1 Level 3 is less secure because it doesn’t use elliptical curve cryptography. Because Security Mode 2 does not provide encryption, it is strongly recommended to use Security Mode 1 Level 3 and 4.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic and Bluetooth Low Energy security differences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Key_Differences_Between_Bluetooth_BR_EDR_and_Low_Energy.png|600px|Key Differences Between Bluetooth BR/EDR and Low Energy ]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://csrc.nist.gov/publications/detail/sp/800-121/rev-2/final&lt;br /&gt;
* https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=478726&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5505</id>
		<title>Bluetooth Security Features</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5505"/>
		<updated>2020-12-21T18:30:19Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Security Mode 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This Page is work in progress please come back later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This documentation is a survey about the security features of Bluetooth Classic and Bluetooth Low Energy. &lt;br /&gt;
&lt;br /&gt;
== Basic Security Services ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Authentication:&#039;&#039;&#039; verifies the identity of communicating devices based on their Bluetooth address. User authentication is not provided by the Bluetooth Specification. &lt;br /&gt;
* &#039;&#039;&#039;Confidentiality:&#039;&#039;&#039; prevents eavesdropping of the transmitted data by an untrusted third person in the piconet. Confidentiality is created by data encryption.  &lt;br /&gt;
* &#039;&#039;&#039;Authorization:&#039;&#039;&#039; controls the access of the resources. It assures that only authorized devices get permitted to access a service.&lt;br /&gt;
* &#039;&#039;&#039;Message Integrity:&#039;&#039;&#039; checks if the data was altered during the transmission.&lt;br /&gt;
* &#039;&#039;&#039;Pairing/Bonding:&#039;&#039;&#039; creates shared secret keys to use them in subsequent connections.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic Security  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-1.png|500px|thumb|right|BR/EDR/HS Security Modes ]]&lt;br /&gt;
&lt;br /&gt;
Bluetooth Classic defines encryption and authentication during two different stages of the communication setup. The stages can be differed in Link-level and Service-level. Link-level enforced security features occur before the Bluetooth physical link is fully established. Service-level enforced security features occur after the physical link is already established and while the logical link gets established.Security mode one to the three were defined before Bluetooth version 2.1 came out. Bluetooth version 2.1 added the fourth security mode.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 1  ===&lt;br /&gt;
This mode is considered as non-secure because it doesn’t use authentication nor encryption.  Security Mode 1 is only supported by today&#039;s Bluetooth devices to communicate with old devices that are not capable of the other security modes.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 2  ===&lt;br /&gt;
Security Mode 2 is called Service Level Enforced Security, access to services depends on the device. Trusted devices may use all services, untrusted devices only to a limited extent. There are three service security levels.&lt;br /&gt;
* Level 1 open to all devices. It is a default mode that also allows outdated applications.&lt;br /&gt;
* Level 2 authentication required, a permanently installed PIN is sufficient.&lt;br /&gt;
* Level 3 requires authentication and authorization, a PIN must be entered.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 3  ===&lt;br /&gt;
This security mode is a link level security mode and security procedures get initiated before the physical link is fully established. Authentication and Encryption is fully supported by security mode 3 connections. Furthermore, service discovery can only be performed with an authenticated device which encrypts its traffic.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 4  ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-2.png|500px|thumb|right|BR/EDR/HS Security Mode 4 Levels Summar]]&lt;br /&gt;
&lt;br /&gt;
Security mode 4 was introduced in Bluetooth version 2.1 and is a service level enforces security mode which security mechanisms get initiated after physical and logical link setup. Security mode takes advantage of the Secure Simple Pairing (SSP) Mechanism. SSP in Bluetooth version 4.1 uses the P-256 elliptic curve to generate the link key. Bluetooth 4.1 uses Hash Messages Authentication Codes Secure Hash Algorithm with 256-bit (HMAC-SHA-256) for integrity checks. For encryption the AES-Counter with CBC-MAC (AES-CCM) cypher is used. The P-256 elliptic curve, HMAC-SHA-256 and AES-CCM are security mechanisms which got approved by the Federal Information Processing Standard (FIPS). Security mode 4 gets differentiated into 5 different layers with different security levels.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer 0:&#039;&#039;&#039; Layer 0 is only used by the Service Discovery Protocol (SDP). This layer doesn’t have any security features.&lt;br /&gt;
* &#039;&#039;&#039;Layer 1:&#039;&#039;&#039; Layer 1 doesn’t use any security.&lt;br /&gt;
* &#039;&#039;&#039;Layer 2:&#039;&#039;&#039; Layer 2 uses an unauthenticated link key. &lt;br /&gt;
* &#039;&#039;&#039;Layer 3:&#039;&#039;&#039; Layer 3 required an authenticated link key.&lt;br /&gt;
* &#039;&#039;&#039;Layer 4:&#039;&#039;&#039; Layer 4 uses secure connection in addition to the authenticated link key&lt;br /&gt;
&lt;br /&gt;
Whether or not a link key is authenticated depends on the SSP association model used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Secure Simple Pairing (SSP)  ===&lt;br /&gt;
&lt;br /&gt;
Secure Simple Pairing was introduced with Security Mode 4 at Bluetooth Version 2.1 and got improved in Version 4.1. The main goal of secure simple pairing is to simplify the pairing process for users. The secondary goal is to maintain or enhance the security of Bluetooth. SSP has two security goals, passive eavesdropping protection and man-in-the-middle protection. SSP provide several association models suited for all input/output capability combinations. Some of these association models are protected against passive and active man-in-the-middle (MITM) attacks during pairing by using ECDH public key cryptography.&lt;br /&gt;
&lt;br /&gt;
[[File:Association models.png|500px|thumb|right|Association models]]&lt;br /&gt;
&lt;br /&gt;
==== Numeric Comparison ====&lt;br /&gt;
Numeric comparison was designed for devices, where both can display a six-digit number and allow a user input to accept and deny the connection. During the Paring both devices show a six-digit code on their displays. The user can accept the parring if the displayed numbers are the same. The connection is secure against MITM attacks and eavesdropping, if the paring was done correctly.  &lt;br /&gt;
&lt;br /&gt;
==== Passkey Entry ====&lt;br /&gt;
This model can be used where one device a has a display that sows a six-digit number and the other device has a digit input. Device a show a code that must be entered into the keyboard of the other device to establish the connection. This model is also secure against MITM attacks and eavesdropping.&lt;br /&gt;
&lt;br /&gt;
==== Out of Band (OOB) ====&lt;br /&gt;
The out of band model uses an additional wireless or wired technology like Near Field Communication (NFC) to exchange the needed cryptographic keys. This model’s security is only as secure as the out of band technology. Even though, this association model is associated to be secure against eavesdropping and MITM attacks.&lt;br /&gt;
&lt;br /&gt;
==== Just Works ====&lt;br /&gt;
The just works model is not secured against eavesdropping and MITM attacks. This model is designed for connection where both devices have no input or output capabilities.&lt;br /&gt;
&lt;br /&gt;
==== SSP Phases ====&lt;br /&gt;
Secure Simple Pairing consists of 5 phases:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public key exchange:&#039;&#039;&#039; Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair. Pairing starts when the initiating device sends its public key to the receiving device. The responding device replies with its own public key, when both devices support Secure Connections then P-256 elliptic curve will be used, if at least one device does not support Secure Connections the P-192 elliptic curve will be used.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 1:&#039;&#039;&#039; Phase 2 consist of three protocols: Numeric Comparison, Out-of-Band and Passkey Entry. The protocol is selected depending on the IO capabilities of the device.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 2:&#039;&#039;&#039; Phase 3 confirms that the exchange between the two participants has been successfully completed. Both devices calculate a new confirmation value that takes into account the previously exchanged values and the new shared key. The initiator sends the new confirmations value to the responding device and is checked by it. If a failure occurs, the protocol should abort.&lt;br /&gt;
* &#039;&#039;&#039;Link key calculation:&#039;&#039;&#039; After both devices confirm the pairing, a link key is calculated using the shared key and the publicly exchanged data. The link key is used to maintain pairing.&lt;br /&gt;
* &#039;&#039;&#039;Link Manager Protocol Authentication and Encryption:&#039;&#039;&#039; Authentication and generation of the encryption key.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Pairing ===&lt;br /&gt;
With PIN / Legacy Pairing, the link keys are derived from a PIN entered by the user in one or both devices, depending on the configuration and device type. If the PIN is smaller than 16 bytes, the Bluetooth address of the initializing device is used for filling. After the key generation has been completed, the devices authenticate each other to ensure that both are using the same link key.This method only serves to mutually identify the devices and cannot prevent a man-in-the-middle attack. An attacker who knows the PIN can calculate the key from it.&lt;br /&gt;
&lt;br /&gt;
=== Key Generation ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Key Generation ====&lt;br /&gt;
The link key is a 128-bit random number, shared between two or multiple participants, and is the basis of all security transactions between these participants. The link key must be created and then distributed to the associated devices in order to be used for the authentication procedure. The initialization key is used temporarily during initialization and should be discarded afterwards. The initialization key is the result of the E22 algorithm the input parameters are a Bluetooth address, a PIN and a random number. The initialization key is used for the key exchange during the generation of a link key.&lt;br /&gt;
&lt;br /&gt;
==== Secure Key Generation ====&lt;br /&gt;
Phase 4 (Link key calculation) of Secure Simple Pairing the link key will be established by using Elliptic Curve Diffie-Hellman public/private key pairs.&lt;br /&gt;
&lt;br /&gt;
=== Confidentiality of the data ===&lt;br /&gt;
The Bluetooth standard defines three encryption modes for data traffic, but only two of them actuals provide confidentiality. The modes are as follows: &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 1:&#039;&#039;&#039; The data traffic is unencrypted &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 2:&#039;&#039;&#039; Individually addressed traffic is encrypted based on individual link keys but broadcast traffic is not.&lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 3:&#039;&#039;&#039; Individually addressed traffic and broadcast traffic is encrypted using an encryption key based on the master link key.&lt;br /&gt;
For encryption mode 2 and 3 is either the AES-CCM or E0 stream cipher used. Bluetooth Security Mode 4 encrypts all data traffic, expect service discovery messages&lt;br /&gt;
&lt;br /&gt;
=== Trust Levels and Service Security Levels.=== &lt;br /&gt;
In addition to the security modes, exist different levels of service security and trust.&lt;br /&gt;
The trust levels can be differentiated into trusted and untrusted. A trusted device has an established relation ship to the device and has full access to all the services. The untrusted device doesn’t have a relationship to the other device and has only a restricted access to the services.&lt;br /&gt;
The Service security level depend on the used Security mode. There are no Service security levels defined for Security mode 1 and 3. Security mode 2 has the following Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Authentication required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Encryption required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Authorization required&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Security mode 2 defines the following five Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Service Level 0:&#039;&#039;&#039; No MITM protection, encryption, or user interaction required.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 1:&#039;&#039;&#039; MITM protection and encryption not required. Minimal user interaction.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 2:&#039;&#039;&#039; Requires encryption only; MITM protection is not necessary.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 3:&#039;&#039;&#039; Requires MITM protection and encryption; user interaction is acceptable.[[File:LABluetooth.PNG|350px|thumb|right|Legacy Authentication ]]&lt;br /&gt;
* &#039;&#039;&#039;Service Level 4:&#039;&#039;&#039; Requires MITM protection and encryption with 128-bit strength; user interaction is acceptable.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Authentication ====&lt;br /&gt;
&lt;br /&gt;
Legacy authentication uses a challenge-response scheme, in which a symmetric key is used to check the claimant’s key knowledge through a two-step protocol. In legacy authentication, the verifier is not required to be the master, the application indicates which device has to be authenticated. The second implies that the correct claimaint/verifier pair share the same secret keys. The verifier challenges the claimaint to authenticate a random input. Some applications only require a one-way authentication.[[File:SABluetooth.PNG|400px|thumb|right|Secure Authentication ]] Some peer-to-peer applications should use two authentication procedures in which each device is the challenger. In Figure is an example of a legacy authentication. The verifier has 3 input parameters, random input, bluetooth address and the link key the result is the SRES. The verifier sends the random message to the claimaint and does the same as the verifier and send back its SRES.&lt;br /&gt;
&lt;br /&gt;
==== Secure Authentication ====&lt;br /&gt;
&lt;br /&gt;
Secure Authentication follows the same principle but with two algorithms and several input parameters. Both devices act as a verifier and claimaint in the same sequence. Master Sends a random message to the Slave and vice verca. Both parties do their calculations and send each other their results.&lt;br /&gt;
The input parameter BD_ADDRm is the Bluetooth Address from the Master, BD_ADDRs is the bluetooth Address from the Slave, btdk is a secret string, Link Key is the shared key, AU_RANDm is the random message from the Master, AU_RANDs is the random message from the Slave, SRESm is the result of the Master, SRESs is the result of the Slave.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Low Energy security ==&lt;br /&gt;
Fundamentals of the BLE Standard can be found in the [[BLE Fundamentals]] documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bluetooth Low Energy security modes are similar to the Security Modes 2 and 4 of Bluetooth Classic, but each service can have its own security requirements.  Furthermore, Bluetooth Low Energy has two security modes with multiple security levels.&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 1 is associated with encryption&lt;br /&gt;
*Level 1 does neither use authentication nor encryption.  &lt;br /&gt;
*Level 2 uses unauthenticated pairing with encryption.&lt;br /&gt;
*Level 3 uses authenticated pairing with encryption.&lt;br /&gt;
*Level 4 which uses authenticated low energy Secure Connections pairing with encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 2 is associated with encryption data integrity&lt;br /&gt;
*Level 1 uses unauthenticated pairing with data signing.&lt;br /&gt;
*Level 2 uses authenticated pairing with data signing.&lt;br /&gt;
&lt;br /&gt;
Security Mode 1 Level 4 is considered to create the strongest connections because it uses AES-CMAC and P-256 elliptic curve for pairing and encryption.  Security Mode 1 Level 3 is less secure because it doesn’t use elliptical curve cryptography. Because Security Mode 2 does not provide encryption, it is strongly recommended to use Security Mode 1 Level 3 and 4.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic and Bluetooth Low Energy security differences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Key_Differences_Between_Bluetooth_BR_EDR_and_Low_Energy.png|600px|Key Differences Between Bluetooth BR/EDR and Low Energy ]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://csrc.nist.gov/publications/detail/sp/800-121/rev-2/final&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5501</id>
		<title>KNOB Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5501"/>
		<updated>2020-12-21T18:27:38Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
Bluetooth specification has an encryption key negotiation protocol to negotiate encryption keys. Attackers can manipulate this protocol to force encryption keys with 1 Byte of entropy without protecting the integrity of the negotiation process. This enables brute forcing the encryption keys in real time.&lt;br /&gt;
[[File:bluetoothKNOB.PNG|300px|thumb|right|Key negotiation protocol]]&lt;br /&gt;
&lt;br /&gt;
== Key negotiation protocol ==&lt;br /&gt;
&lt;br /&gt;
The goal of this protocol is to compute a session key starting from a long term shared secret&lt;br /&gt;
At the top is Encryption Key Generation Function that takes as input the longterm secret a bunch of nonces and Bluetooth address of Slave and is computing Kc a key with 16 Bytes of entropy this key is not used as session key it is processed by an entropy reduction function that is used to modify the entropy to N bytes and this N number is computed from an entropy negotiation phase that is performed by alice and bob. This session key is used to encrypt and decrypt the packets using E0 stream cipher in case using legacy security mode or AES-CCM if both devices supporting Bluetooth secure connections.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stages of Attack ==&lt;br /&gt;
KNOB Attack has 4 Main stages&lt;br /&gt;
* &#039;&#039;&#039;First stage:&#039;&#039;&#039; Alice and Bob are pairing using the strongest security mechanisms Secure Simple pairing. They are establishing a long term secret and the attacker is not there. &lt;br /&gt;
* &#039;&#039;&#039;Second Phase:&#039;&#039;&#039; Alice and Bob wants to establish a new encrypted session and Charlie is in Bluetooth range with the victim.  &lt;br /&gt;
* &#039;&#039;&#039;Phase 3:&#039;&#039;&#039; Charlie is able to manipulate the entropy negotiation phase of Bluetooth and let the two victim negotiate an encryption key with one byte of entropy.&lt;br /&gt;
* &#039;&#039;&#039;Phase 4:&#039;&#039;&#039; Charlie is able to eavesdropping ciphertext and using the ciphertext to bruteforce the encryption key and the brute force is in real time because If you use an encryption key with 1 Byte of entropy then you have to brute force one key out of 256 possibilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/knob&lt;br /&gt;
* Rooted Nexus 5 running the internalblue/android_bluetooth_stack/nexus5_android6_0_1/bluetooth.default.so custom Android Bluetooth stack&lt;br /&gt;
* Computer running Linux operating system&lt;br /&gt;
* Wireshark&lt;br /&gt;
&lt;br /&gt;
Internalblue is a framework which can patch the firmware from the operating system.&lt;br /&gt;
This attack is simulating an attacker using Internalblue, because the setup is easier, has a higher reliability, and it is cheaper than over the air.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
&lt;br /&gt;
* Connect Nexus 5 via USB to the computer&lt;br /&gt;
* Configure and install modified internalblue v0.1&lt;br /&gt;
** Edit &#039;&#039;&#039;internalblue/internalblue/core.py&#039;&#039;&#039; and set &#039;&#039;&#039;NEXUS5_MODE&#039;&#039;&#039; to which mode you want to perform&lt;br /&gt;
** Set &#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039; then the Nexus 5 is the master device or &#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039; to set Nexus 5 to the slave device&lt;br /&gt;
** In terminal, switch into the &#039;&#039;&#039;internalblue&#039;&#039;&#039; directory, and run &#039;&#039;&#039;sudo python2 setup.py install&#039;&#039;&#039;&lt;br /&gt;
** Open a terminal and run internalblue (Internalblue is inserted in PATH Variable)&lt;br /&gt;
* In the internalblue menu start LMP monitoring with monitor lmp start&lt;br /&gt;
** A Wireshark window should pop up&lt;br /&gt;
* Pair target with Nexus 5&lt;br /&gt;
* When Nexus 5 is as the master configured (&#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039;) then you have to start the connection from the Nexus 5 to the target device.&lt;br /&gt;
* When the Nexus 5 is as the slave configured (NEXUS5_MODE = SLAVE_MITM) then you have to start the connection from the victim to the Nexus 5.&lt;br /&gt;
* In Wireshark you can see that the devices have negotiated an encryption key with 1 byte of entropy.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.usenix.org/conference/usenixsecurity19/presentation/antonioli&lt;br /&gt;
* https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;br /&gt;
* https://francozappa.github.io/publication/knob/&lt;br /&gt;
* https://github.com/francozappa/knob&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:BluetoothKNOB.PNG&amp;diff=5500</id>
		<title>File:BluetoothKNOB.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:BluetoothKNOB.PNG&amp;diff=5500"/>
		<updated>2020-12-21T18:25:38Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: Key negotiation protocol of Bluetooth

Source: https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Key negotiation protocol of Bluetooth&lt;br /&gt;
&lt;br /&gt;
Source: https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5499</id>
		<title>KNOB Attack</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KNOB_Attack&amp;diff=5499"/>
		<updated>2020-12-21T18:25:00Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: Created page with &amp;quot;== Summary ==   The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen. Bluetooth specification has an encryption key negotiation protoco...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The attack was found 2019 by Daniele Antonioli, Nils Ole Tippenhauer and Kasper B. Rasmussen.&lt;br /&gt;
Bluetooth specification has an encryption key negotiation protocol to negotiate encryption keys. Attackers can manipulate this protocol to force encryption keys with 1 Byte of entropy without protecting the integrity of the negotiation process. This enables brute forcing the encryption keys in real time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key negotiation protocol ==&lt;br /&gt;
&lt;br /&gt;
The goal of this protocol is to compute a session key starting from a long term shared secret&lt;br /&gt;
At the top is Encryption Key Generation Function that takes as input the longterm secret a bunch of nonces and Bluetooth address of Slave and is computing Kc a key with 16 Bytes of entropy this key is not used as session key it is processed by an entropy reduction function that is used to modify the entropy to N bytes and this N number is computed from an entropy negotiation phase that is performed by alice and bob. This session key is used to encrypt and decrypt the packets using E0 stream cipher in case using legacy security mode or AES-CCM if both devices supporting Bluetooth secure connections.&lt;br /&gt;
&lt;br /&gt;
== Stages of Attack ==&lt;br /&gt;
KNOB Attack has 4 Main stages&lt;br /&gt;
* &#039;&#039;&#039;First stage:&#039;&#039;&#039; Alice and Bob are pairing using the strongest security mechanisms Secure Simple pairing. They are establishing a long term secret and the attacker is not there. &lt;br /&gt;
* &#039;&#039;&#039;Second Phase:&#039;&#039;&#039; Alice and Bob wants to establish a new encrypted session and Charlie is in Bluetooth range with the victim.  &lt;br /&gt;
* &#039;&#039;&#039;Phase 3:&#039;&#039;&#039; Charlie is able to manipulate the entropy negotiation phase of Bluetooth and let the two victim negotiate an encryption key with one byte of entropy.&lt;br /&gt;
* &#039;&#039;&#039;Phase 4:&#039;&#039;&#039; Charlie is able to eavesdropping ciphertext and using the ciphertext to bruteforce the encryption key and the brute force is in real time because If you use an encryption key with 1 Byte of entropy then you have to brute force one key out of 256 possibilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Clone Github https://github.com/francozappa/knob&lt;br /&gt;
* Rooted Nexus 5 running the internalblue/android_bluetooth_stack/nexus5_android6_0_1/bluetooth.default.so custom Android Bluetooth stack&lt;br /&gt;
* Computer running Linux operating system&lt;br /&gt;
* Wireshark&lt;br /&gt;
&lt;br /&gt;
Internalblue is a framework which can patch the firmware from the operating system.&lt;br /&gt;
This attack is simulating an attacker using Internalblue, because the setup is easier, has a higher reliability, and it is cheaper than over the air.&lt;br /&gt;
&lt;br /&gt;
== Perform Attack ==&lt;br /&gt;
&lt;br /&gt;
* Connect Nexus 5 via USB to the computer&lt;br /&gt;
* Configure and install modified internalblue v0.1&lt;br /&gt;
** Edit &#039;&#039;&#039;internalblue/internalblue/core.py&#039;&#039;&#039; and set &#039;&#039;&#039;NEXUS5_MODE&#039;&#039;&#039; to which mode you want to perform&lt;br /&gt;
** Set &#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039; then the Nexus 5 is the master device or &#039;&#039;&#039;NEXUS5_MODE = SLAVE_MITM&#039;&#039;&#039; to set Nexus 5 to the slave device&lt;br /&gt;
** In terminal, switch into the &#039;&#039;&#039;internalblue&#039;&#039;&#039; directory, and run &#039;&#039;&#039;sudo python2 setup.py install&#039;&#039;&#039;&lt;br /&gt;
** Open a terminal and run internalblue (Internalblue is inserted in PATH Variable)&lt;br /&gt;
* In the internalblue menu start LMP monitoring with monitor lmp start&lt;br /&gt;
** A Wireshark window should pop up&lt;br /&gt;
* Pair target with Nexus 5&lt;br /&gt;
* When Nexus 5 is as the master configured (&#039;&#039;&#039;NEXUS5_MODE = MASTER_MITM&#039;&#039;&#039;) then you have to start the connection from the Nexus 5 to the target device.&lt;br /&gt;
* When the Nexus 5 is as the slave configured (NEXUS5_MODE = SLAVE_MITM) then you have to start the connection from the victim to the Nexus 5.&lt;br /&gt;
* In Wireshark you can see that the devices have negotiated an encryption key with 1 byte of entropy.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.usenix.org/conference/usenixsecurity19/presentation/antonioli&lt;br /&gt;
* https://www.usenix.org/system/files/sec19-antonioli.pdf&lt;br /&gt;
* https://francozappa.github.io/publication/knob/&lt;br /&gt;
* https://github.com/francozappa/knob&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5479</id>
		<title>Bluetooth Security Features</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5479"/>
		<updated>2020-12-21T16:26:55Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This Page is work in progress please come back later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This documentation is a survey about the security features of Bluetooth Classic and Bluetooth Low Energy. &lt;br /&gt;
&lt;br /&gt;
== Basic Security Services ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Authentication:&#039;&#039;&#039; verifies the identity of communicating devices based on their Bluetooth address. User authentication is not provided by the Bluetooth Specification. &lt;br /&gt;
* &#039;&#039;&#039;Confidentiality:&#039;&#039;&#039; prevents eavesdropping of the transmitted data by an untrusted third person in the piconet. Confidentiality is created by data encryption.  &lt;br /&gt;
* &#039;&#039;&#039;Authorization:&#039;&#039;&#039; controls the access of the resources. It assures that only authorized devices get permitted to access a service.&lt;br /&gt;
* &#039;&#039;&#039;Message Integrity:&#039;&#039;&#039; checks if the data was altered during the transmission.&lt;br /&gt;
* &#039;&#039;&#039;Pairing/Bonding:&#039;&#039;&#039; creates shared secret keys to use them in subsequent connections.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic Security  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-1.png|500px|thumb|right|BR/EDR/HS Security Modes ]]&lt;br /&gt;
&lt;br /&gt;
Bluetooth Classic defines encryption and authentication during two different stages of the communication setup. The stages can be differed in Link-level and Service-level. Link-level enforced security features occur before the Bluetooth physical link is fully established. Service-level enforced security features occur after the physical link is already established and while the logical link gets established.Security mode one to the three were defined before Bluetooth version 2.1 came out. Bluetooth version 2.1 added the fourth security mode.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 1  ===&lt;br /&gt;
This mode is considered as non-secure because it doesn’t use authentication nor encryption.  Security Mode 1 is only supported by today&#039;s Bluetooth devices to communicate with old devices that are not capable of the other security modes.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 2  ===&lt;br /&gt;
This mode establishes security at Link-level by using a local security manager that controls the access of supported services. It’s even possible to restrict access on a part of the services depending on the trust to the accessing device.  Bluetooth service discovery can be performed without any security challenges.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 3  ===&lt;br /&gt;
This security mode is a link level security mode and security procedures get initiated before the physical link is fully established. Authentication and Encryption is fully supported by security mode 3 connections. Furthermore, service discovery can only be performed with an authenticated device which encrypts its traffic.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 4  ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-2.png|500px|thumb|right|BR/EDR/HS Security Mode 4 Levels Summar]]&lt;br /&gt;
&lt;br /&gt;
Security mode 4 was introduced in Bluetooth version 2.1 and is a service level enforces security mode which security mechanisms get initiated after physical and logical link setup. Security mode takes advantage of the Secure Simple Pairing (SSP) Mechanism. SSP in Bluetooth version 4.1 uses the P-256 elliptic curve to generate the link key. Bluetooth 4.1 uses Hash Messages Authentication Codes Secure Hash Algorithm with 256-bit (HMAC-SHA-256) for integrity checks. For encryption the AES-Counter with CBC-MAC (AES-CCM) cypher is used. The P-256 elliptic curve, HMAC-SHA-256 and AES-CCM are security mechanisms which got approved by the Federal Information Processing Standard (FIPS). Security mode 4 gets differentiated into 5 different layers with different security levels.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer 0:&#039;&#039;&#039; Layer 0 is only used by the Service Discovery Protocol (SDP). This layer doesn’t have any security features.&lt;br /&gt;
* &#039;&#039;&#039;Layer 1:&#039;&#039;&#039; Layer 1 doesn’t use any security.&lt;br /&gt;
* &#039;&#039;&#039;Layer 2:&#039;&#039;&#039; Layer 2 uses an unauthenticated link key. &lt;br /&gt;
* &#039;&#039;&#039;Layer 3:&#039;&#039;&#039; Layer 3 required an authenticated link key.&lt;br /&gt;
* &#039;&#039;&#039;Layer 4:&#039;&#039;&#039; Layer 4 uses secure connection in addition to the authenticated link key&lt;br /&gt;
&lt;br /&gt;
Whether or not a link key is authenticated depends on the SSP association model used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Secure Simple Pairing (SSP)  ===&lt;br /&gt;
&lt;br /&gt;
Secure Simple Pairing was introduced with Security Mode 4 at Bluetooth Version 2.1 and got improved in Version 4.1. The main goal of secure simple pairing is to simplify the pairing process for users. The secondary goal is to maintain or enhance the security of Bluetooth. SSP has two security goals, passive eavesdropping protection and man-in-the-middle protection. SSP provide several association models suited for all input/output capability combinations. Some of these association models are protected against passive and active man-in-the-middle (MITM) attacks during pairing by using ECDH public key cryptography.&lt;br /&gt;
&lt;br /&gt;
[[File:Association models.png|500px|thumb|right|Association models]]&lt;br /&gt;
&lt;br /&gt;
==== Numeric Comparison ====&lt;br /&gt;
Numeric comparison was designed for devices, where both can display a six-digit number and allow a user input to accept and deny the connection. During the Paring both devices show a six-digit code on their displays. The user can accept the parring if the displayed numbers are the same. The connection is secure against MITM attacks and eavesdropping, if the paring was done correctly.  &lt;br /&gt;
&lt;br /&gt;
==== Passkey Entry ====&lt;br /&gt;
This model can be used where one device a has a display that sows a six-digit number and the other device has a digit input. Device a show a code that must be entered into the keyboard of the other device to establish the connection. This model is also secure against MITM attacks and eavesdropping.&lt;br /&gt;
&lt;br /&gt;
==== Out of Band (OOB) ====&lt;br /&gt;
The out of band model uses an additional wireless or wired technology like Near Field Communication (NFC) to exchange the needed cryptographic keys. This model’s security is only as secure as the out of band technology. Even though, this association model is associated to be secure against eavesdropping and MITM attacks.&lt;br /&gt;
&lt;br /&gt;
==== Just Works ====&lt;br /&gt;
The just works model is not secured against eavesdropping and MITM attacks. This model is designed for connection where both devices have no input or output capabilities.&lt;br /&gt;
&lt;br /&gt;
==== SSP Phases ====&lt;br /&gt;
Secure Simple Pairing consists of 5 phases:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public key exchange:&#039;&#039;&#039; Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair. Pairing starts when the initiating device sends its public key to the receiving device. The responding device replies with its own public key, when both devices support Secure Connections then P-256 elliptic curve will be used, if at least one device does not support Secure Connections the P-192 elliptic curve will be used.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 1:&#039;&#039;&#039; Phase 2 consist of three protocols: Numeric Comparison, Out-of-Band and Passkey Entry. The protocol is selected depending on the IO capabilities of the device.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 2:&#039;&#039;&#039; Phase 3 confirms that the exchange between the two participants has been successfully completed. Both devices calculate a new confirmation value that takes into account the previously exchanged values and the new shared key. The initiator sends the new confirmations value to the responding device and is checked by it. If a failure occurs, the protocol should abort.&lt;br /&gt;
* &#039;&#039;&#039;Link key calculation:&#039;&#039;&#039; After both devices confirm the pairing, a link key is calculated using the shared key and the publicly exchanged data. The link key is used to maintain pairing.&lt;br /&gt;
* &#039;&#039;&#039;Link Manager Protocol Authentication and Encryption:&#039;&#039;&#039; Authentication and generation of the encryption key.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Pairing ===&lt;br /&gt;
With PIN / Legacy Pairing, the link keys are derived from a PIN entered by the user in one or both devices, depending on the configuration and device type. If the PIN is smaller than 16 bytes, the Bluetooth address of the initializing device is used for filling. After the key generation has been completed, the devices authenticate each other to ensure that both are using the same link key.This method only serves to mutually identify the devices and cannot prevent a man-in-the-middle attack. An attacker who knows the PIN can calculate the key from it.&lt;br /&gt;
&lt;br /&gt;
=== Key Generation ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Key Generation ====&lt;br /&gt;
The link key is a 128-bit random number, shared between two or multiple participants, and is the basis of all security transactions between these participants. The link key must be created and then distributed to the associated devices in order to be used for the authentication procedure. The initialization key is used temporarily during initialization and should be discarded afterwards. The initialization key is the result of the E22 algorithm the input parameters are a Bluetooth address, a PIN and a random number. The initialization key is used for the key exchange during the generation of a link key.&lt;br /&gt;
&lt;br /&gt;
==== Secure Key Generation ====&lt;br /&gt;
Phase 4 (Link key calculation) of Secure Simple Pairing the link key will be established by using Elliptic Curve Diffie-Hellman public/private key pairs.&lt;br /&gt;
&lt;br /&gt;
=== Confidentiality of the data ===&lt;br /&gt;
The Bluetooth standard defines three encryption modes for data traffic, but only two of them actuals provide confidentiality. The modes are as follows: &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 1:&#039;&#039;&#039; The data traffic is unencrypted &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 2:&#039;&#039;&#039; Individually addressed traffic is encrypted based on individual link keys but broadcast traffic is not.&lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 3:&#039;&#039;&#039; Individually addressed traffic and broadcast traffic is encrypted using an encryption key based on the master link key.&lt;br /&gt;
For encryption mode 2 and 3 is either the AES-CCM or E0 stream cipher used. Bluetooth Security Mode 4 encrypts all data traffic, expect service discovery messages&lt;br /&gt;
&lt;br /&gt;
=== Trust Levels and Service Security Levels.=== &lt;br /&gt;
In addition to the security modes, exist different levels of service security and trust.&lt;br /&gt;
The trust levels can be differentiated into trusted and untrusted. A trusted device has an established relation ship to the device and has full access to all the services. The untrusted device doesn’t have a relationship to the other device and has only a restricted access to the services.&lt;br /&gt;
The Service security level depend on the used Security mode. There are no Service security levels defined for Security mode 1 and 3. Security mode 2 has the following Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Authentication required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Encryption required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Authorization required&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Security mode 2 defines the following five Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Service Level 0:&#039;&#039;&#039; No MITM protection, encryption, or user interaction required.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 1:&#039;&#039;&#039; MITM protection and encryption not required. Minimal user interaction.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 2:&#039;&#039;&#039; Requires encryption only; MITM protection is not necessary.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 3:&#039;&#039;&#039; Requires MITM protection and encryption; user interaction is acceptable.[[File:LABluetooth.PNG|350px|thumb|right|Legacy Authentication ]]&lt;br /&gt;
* &#039;&#039;&#039;Service Level 4:&#039;&#039;&#039; Requires MITM protection and encryption with 128-bit strength; user interaction is acceptable.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Authentication ====&lt;br /&gt;
&lt;br /&gt;
Legacy authentication uses a challenge-response scheme, in which a symmetric key is used to check the claimant’s key knowledge through a two-step protocol. In legacy authentication, the verifier is not required to be the master, the application indicates which device has to be authenticated. The second implies that the correct claimaint/verifier pair share the same secret keys. The verifier challenges the claimaint to authenticate a random input. Some applications only require a one-way authentication.[[File:SABluetooth.PNG|400px|thumb|right|Secure Authentication ]] Some peer-to-peer applications should use two authentication procedures in which each device is the challenger. In Figure is an example of a legacy authentication. The verifier has 3 input parameters, random input, bluetooth address and the link key the result is the SRES. The verifier sends the random message to the claimaint and does the same as the verifier and send back its SRES.&lt;br /&gt;
&lt;br /&gt;
==== Secure Authentication ====&lt;br /&gt;
&lt;br /&gt;
Secure Authentication follows the same principle but with two algorithms and several input parameters. Both devices act as a verifier and claimaint in the same sequence. Master Sends a random message to the Slave and vice verca. Both parties do their calculations and send each other their results.&lt;br /&gt;
The input parameter BD_ADDRm is the Bluetooth Address from the Master, BD_ADDRs is the bluetooth Address from the Slave, btdk is a secret string, Link Key is the shared key, AU_RANDm is the random message from the Master, AU_RANDs is the random message from the Slave, SRESm is the result of the Master, SRESs is the result of the Slave.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Low Energy security ==&lt;br /&gt;
Fundamentals of the BLE Standard can be found in the [[BLE Fundamentals]] documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bluetooth Low Energy security modes are similar to the Security Modes 2 and 4 of Bluetooth Classic, but each service can have its own security requirements.  Furthermore, Bluetooth Low Energy has two security modes with multiple security levels.&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 1 is associated with encryption&lt;br /&gt;
*Level 1 does neither use authentication nor encryption.  &lt;br /&gt;
*Level 2 uses unauthenticated pairing with encryption.&lt;br /&gt;
*Level 3 uses authenticated pairing with encryption.&lt;br /&gt;
*Level 4 which uses authenticated low energy Secure Connections pairing with encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 2 is associated with encryption data integrity&lt;br /&gt;
*Level 1 uses unauthenticated pairing with data signing.&lt;br /&gt;
*Level 2 uses authenticated pairing with data signing.&lt;br /&gt;
&lt;br /&gt;
Security Mode 1 Level 4 is considered to create the strongest connections because it uses AES-CMAC and P-256 elliptic curve for pairing and encryption.  Security Mode 1 Level 3 is less secure because it doesn’t use elliptical curve cryptography. Because Security Mode 2 does not provide encryption, it is strongly recommended to use Security Mode 1 Level 3 and 4.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic and Bluetooth Low Energy security differences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Key_Differences_Between_Bluetooth_BR_EDR_and_Low_Energy.png|600px|Key Differences Between Bluetooth BR/EDR and Low Energy ]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://csrc.nist.gov/publications/detail/sp/800-121/rev-2/final&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5325</id>
		<title>Bluetooth Security Features</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5325"/>
		<updated>2020-12-20T18:30:09Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Bluetooth Classic Security */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This Page is work in progress please come back later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This documentation is a survey about the security features of Bluetooth Classic and Bluetooth Low Energy. &lt;br /&gt;
&lt;br /&gt;
== Basic Security Services ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Authentication:&#039;&#039;&#039; verifies the identity of communicating devices based on their Bluetooth address. User authentication is not provided by the Bluetooth Specification. &lt;br /&gt;
* &#039;&#039;&#039;Confidentiality:&#039;&#039;&#039; prevents eavesdropping of the transmitted data by an untrusted third person in the piconet. Confidentiality is created by data encryption.  &lt;br /&gt;
* &#039;&#039;&#039;Authorization:&#039;&#039;&#039; controls the access of the resources. It assures that only authorized devices get permitted to access a service.&lt;br /&gt;
* &#039;&#039;&#039;Message Integrity:&#039;&#039;&#039; checks if the data was altered during the transmission.&lt;br /&gt;
* &#039;&#039;&#039;Pairing/Bonding:&#039;&#039;&#039; creates shared secret keys to use them in subsequent connections.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic Security  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-1.png|500px|thumb|right|BR/EDR/HS Security Modes ]]&lt;br /&gt;
&lt;br /&gt;
Bluetooth Classic defines encryption and authentication during two different stages of the communication setup. The stages can be differed in Link-level and Service-level. Link-level enforced security features occur before the Bluetooth physical link is fully established. Service-level enforced security features occur after the physical link is already established and while the logical link gets established.Security mode one to the three were defined before Bluetooth version 2.1 came out. Bluetooth version 2.1 added the fourth security mode.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 1  ===&lt;br /&gt;
This mode is considered as non-secure because it doesn’t use authentication nor encryption.  Security Mode 1 is only supported by today&#039;s Bluetooth devices to communicate with old devices that are not capable of the other security modes.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 2  ===&lt;br /&gt;
This mode establishes security at Link-level by using a local security manager that controls the access of supported services. It’s even possible to restrict access on a part of the services depending on the trust to the accessing device.  Bluetooth service discovery can be performed without any security challenges.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 3  ===&lt;br /&gt;
This security mode is a link level security mode and security procedures get initiated before the physical link is fully established. Authentication and Encryption is fully supported by security mode 3 connections. Furthermore, service discovery can only be performed with an authenticated device which encrypts its traffic.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 4  ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-2.png|500px|thumb|right|BR/EDR/HS Security Mode 4 Levels Summar]]&lt;br /&gt;
&lt;br /&gt;
Security mode 4 was introduced in Bluetooth version 2.1 and is a service level enforces security mode which security mechanisms get initiated after physical and logical link setup. Security mode takes advantage of the Secure Simple Pairing (SSP) Mechanism. SSP in Bluetooth version 4.1 uses the P-256 elliptic curve to generate the link key. Bluetooth 4.1 uses Hash Messages Authentication Codes Secure Hash Algorithm with 256-bit (HMAC-SHA-256) for integrity checks. For encryption the AES-Counter with CBC-MAC (AES-CCM) cypher is used. The P-256 elliptic curve, HMAC-SHA-256 and AES-CCM are security mechanisms which got approved by the Federal Information Processing Standard (FIPS). Security mode 4 gets differentiated into 5 different layers with different security levels.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer 0:&#039;&#039;&#039; Layer 0 is only used by the Service Discovery Protocol (SDP). This layer doesn’t have any security features.&lt;br /&gt;
* &#039;&#039;&#039;Layer 1:&#039;&#039;&#039; Layer 1 doesn’t use any security.&lt;br /&gt;
* &#039;&#039;&#039;Layer 2:&#039;&#039;&#039; Layer 2 uses an unauthenticated link key. &lt;br /&gt;
* &#039;&#039;&#039;Layer 3:&#039;&#039;&#039; Layer 3 required an authenticated link key.&lt;br /&gt;
* &#039;&#039;&#039;Layer 4:&#039;&#039;&#039; Layer 4 uses secure connection in addition to the authenticated link key&lt;br /&gt;
&lt;br /&gt;
Whether or not a link key is authenticated depends on the SSP association model used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Secure Simple Pairing (SSP)  ===&lt;br /&gt;
&lt;br /&gt;
Secure Simple Pairing was introduced with Security Mode 4 at Bluetooth Version 2.1 and got improved in Version 4.1. The main goal of secure simple pairing is to simplify the pairing process for users. The secondary goal is to maintain or enhance the security of Bluetooth. SSP has two security goals, passive eavesdropping protection and man-in-the-middle protection. SSP provide several association models suited for all input/output capability combinations. Some of these association models are protected against passive and active man-in-the-middle (MITM) attacks during pairing by using ECDH public key cryptography.&lt;br /&gt;
&lt;br /&gt;
[[File:Association models.png|500px|thumb|right|Association models]]&lt;br /&gt;
&lt;br /&gt;
==== Numeric Comparison ====&lt;br /&gt;
Numeric comparison was designed for devices, where both can display a six-digit number and allow a user input to accept and deny the connection. During the Paring both devices show a six-digit code on their displays. The user can accept the parring if the displayed numbers are the same. The connection is secure against MITM attacks and eavesdropping, if the paring was done correctly.  &lt;br /&gt;
&lt;br /&gt;
==== Passkey Entry ====&lt;br /&gt;
This model can be used where one device a has a display that sows a six-digit number and the other device has a digit input. Device a show a code that must be entered into the keyboard of the other device to establish the connection. This model is also secure against MITM attacks and eavesdropping.&lt;br /&gt;
&lt;br /&gt;
==== Out of Band (OOB) ====&lt;br /&gt;
The out of band model uses an additional wireless or wired technology like Near Field Communication (NFC) to exchange the needed cryptographic keys. This model’s security is only as secure as the out of band technology. Even though, this association model is associated to be secure against eavesdropping and MITM attacks.&lt;br /&gt;
&lt;br /&gt;
==== Just Works ====&lt;br /&gt;
The just works model is not secured against eavesdropping and MITM attacks. This model is designed for connection where both devices have no input or output capabilities.&lt;br /&gt;
&lt;br /&gt;
==== SSP Phases ====&lt;br /&gt;
Secure Simple Pairing consists of 5 phases:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public key exchange:&#039;&#039;&#039; Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair. Pairing starts when the initiating device sends its public key to the receiving device. The responding device replies with its own public key, when both devices support Secure Connections then P-256 elliptic curve will be used, if at least one device does not support Secure Connections the P-192 elliptic curve will be used.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 1:&#039;&#039;&#039; Phase 2 consist of three protocols: Numeric Comparison, Out-of-Band and Passkey Entry. The protocol is selected depending on the IO capabilities of the device.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 2:&#039;&#039;&#039; Phase 3 confirms that the exchange between the two participants has been successfully completed. Both devices calculate a new confirmation value that takes into account the previously exchanged values and the new shared key. The initiator sends the new confirmations value to the responding device and is checked by it. If a failure occurs, the protocol should abort.&lt;br /&gt;
* &#039;&#039;&#039;Link key calculation:&#039;&#039;&#039; After both devices confirm the pairing, a link key is calculated using the shared key and the publicly exchanged data. The link key is used to maintain pairing.&lt;br /&gt;
* &#039;&#039;&#039;Link Manager Protocol Authentication and Encryption:&#039;&#039;&#039; Authentication and generation of the encryption key.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Pairing ===&lt;br /&gt;
With PIN / Legacy Pairing, the link keys are derived from a PIN entered by the user in one or both devices, depending on the configuration and device type. If the PIN is smaller than 16 bytes, the Bluetooth address of the initializing device is used for filling. After the key generation has been completed, the devices authenticate each other to ensure that both are using the same link key.This method only serves to mutually identify the devices and cannot prevent a man-in-the-middle attack. An attacker who knows the PIN can calculate the key from it.&lt;br /&gt;
&lt;br /&gt;
=== Key Generation ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Key Generation ====&lt;br /&gt;
The link key is a 128-bit random number, shared between two or multiple participants, and is the basis of all security transactions between these participants. The link key must be created and then distributed to the associated devices in order to be used for the authentication procedure. The initialization key is used temporarily during initialization and should be discarded afterwards. The initialization key is the result of the E22 algorithm the input parameters are a Bluetooth address, a PIN and a random number. The initialization key is used for the key exchange during the generation of a link key.&lt;br /&gt;
&lt;br /&gt;
==== Secure Key Generation ====&lt;br /&gt;
Phase 4 (Link key calculation) of Secure Simple Pairing the link key will be established by using Elliptic Curve Diffie-Hellman public/private key pairs.&lt;br /&gt;
&lt;br /&gt;
=== Confidentiality of the data ===&lt;br /&gt;
The Bluetooth standard defines three encryption modes for data traffic, but only two of them actuals provide confidentiality. The modes are as follows: &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 1:&#039;&#039;&#039; The data traffic is unencrypted &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 2:&#039;&#039;&#039; Individually addressed traffic is encrypted based on individual link keys but broadcast traffic is not.&lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 3:&#039;&#039;&#039; Individually addressed traffic and broadcast traffic is encrypted using an encryption key based on the master link key.&lt;br /&gt;
For encryption mode 2 and 3 is either the AES-CCM or E0 stream cipher used. Bluetooth Security Mode 4 encrypts all data traffic, expect service discovery messages&lt;br /&gt;
&lt;br /&gt;
=== Trust Levels and Service Security Levels.=== &lt;br /&gt;
In addition to the security modes, exist different levels of service security and trust.&lt;br /&gt;
The trust levels can be differentiated into trusted and untrusted. A trusted device has an established relation ship to the device and has full access to all the services. The untrusted device doesn’t have a relationship to the other device and has only a restricted access to the services.&lt;br /&gt;
The Service security level depend on the used Security mode. There are no Service security levels defined for Security mode 1 and 3. Security mode 2 has the following Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Authentication required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Encryption required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Authorization required&#039;&#039;&#039;&lt;br /&gt;
Security mode 2 defines the following five Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Service Level 0:&#039;&#039;&#039; No MITM protection, encryption, or user interaction required.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 1:&#039;&#039;&#039; MITM protection and encryption not required. Minimal user interaction.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 2:&#039;&#039;&#039; Requires encryption only; MITM protection is not necessary.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 3:&#039;&#039;&#039; Requires MITM protection and encryption; user interaction is acceptable.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 4:&#039;&#039;&#039; Requires MITM protection and encryption with 128-bit strength; user interaction is acceptable.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Authentication ====&lt;br /&gt;
[[File:LABluetooth.PNG|400px|thumb|right|Legacy Authentication ]]&lt;br /&gt;
Legacy authentication uses a challenge-response scheme, in which a symmetric key is used to check the claimant’s key knowledge through a two-step protocol. In legacy authentication, the verifier is not required to be the master, the application indicates which device has to be authenticated. The second implies that the correct claimaint/verifier pair share the same secret keys. The verifier challenges the claimaint to authenticate a random input. Some applications only require a one-way authentication. Some peer-to-peer applications should use two authentication procedures in which each device is the challenger. In Figure is an example of a legacy authentication. The verifier has 3 input parameters, random input, bluetooth address and the link key the result is the SRES. The verifier sends the random message to the claimaint and does the same as the verifier and send back its SRES.&lt;br /&gt;
&lt;br /&gt;
==== Secure Authentication ====&lt;br /&gt;
[[File:SABluetooth.PNG|500px|thumb|right|Secure Authentication ]]&lt;br /&gt;
Secure Authentication follows the same principle but with two algorithms and several input parameters. Both devices act as a verifier and claimaint in the same sequence. Master Sends a random message to the Slave and vice verca. Both parties do their calculations and send each other their results.&lt;br /&gt;
The input parameter BD_ADDRm is the Bluetooth Address from the Master, BD_ADDRs is the bluetooth Address from the Slave, btdk is a secret string, Link Key is the shared key, AU_RANDm is the random message from the Master, AU_RANDs is the random message from the Slave, SRESm is the result of the Master, SRESs is the result of the Slave.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Low Energy security ==&lt;br /&gt;
Fundamentals of the BLE Standard can be found in the [[BLE Fundamentals]] documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bluetooth Low Energy security modes are similar to the Security Modes 2 and 4 of Bluetooth Classic, but each service can have its own security requirements.  Furthermore, Bluetooth Low Energy has two security modes with multiple security levels.&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 1 is associated with encryption&lt;br /&gt;
*Level 1 does neither use authentication nor encryption.  &lt;br /&gt;
*Level 2 uses unauthenticated pairing with encryption.&lt;br /&gt;
*Level 3 uses authenticated pairing with encryption.&lt;br /&gt;
*Level 4 which uses authenticated low energy Secure Connections pairing with encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 2 is associated with encryption data integrity&lt;br /&gt;
*Level 1 uses unauthenticated pairing with data signing.&lt;br /&gt;
*Level 2 uses authenticated pairing with data signing.&lt;br /&gt;
&lt;br /&gt;
Security Mode 1 Level 4 is considered to create the strongest connections because it uses AES-CMAC and P-256 elliptic curve for pairing and encryption.  Security Mode 1 Level 3 is less secure because it doesn’t use elliptical curve cryptography. Because Security Mode 2 does not provide encryption, it is strongly recommended to use Security Mode 1 Level 3 and 4.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic and Bluetooth Low Energy security differences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Key_Differences_Between_Bluetooth_BR_EDR_and_Low_Energy.png|600px|Key Differences Between Bluetooth BR/EDR and Low Energy ]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://csrc.nist.gov/publications/detail/sp/800-121/rev-2/final&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:SABluetooth.PNG&amp;diff=5322</id>
		<title>File:SABluetooth.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:SABluetooth.PNG&amp;diff=5322"/>
		<updated>2020-12-20T18:18:46Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: Secure Authentication of Bluetooth

Source: Bluetooth Core Specification https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=478726&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Secure Authentication of Bluetooth&lt;br /&gt;
&lt;br /&gt;
Source: Bluetooth Core Specification https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=478726&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:LABluetooth.PNG&amp;diff=5320</id>
		<title>File:LABluetooth.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:LABluetooth.PNG&amp;diff=5320"/>
		<updated>2020-12-20T18:17:19Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Legacy Authentication of Bluetooth&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
Bluetooth Core Specification&lt;br /&gt;
https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=478726&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:LABluetooth.PNG&amp;diff=5319</id>
		<title>File:LABluetooth.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:LABluetooth.PNG&amp;diff=5319"/>
		<updated>2020-12-20T18:15:21Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: Legacy Authentication of Bluetooth&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Legacy Authentication of Bluetooth&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5155</id>
		<title>Bluetooth Security Features</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Bluetooth_Security_Features&amp;diff=5155"/>
		<updated>2020-12-19T17:30:18Z</updated>

		<summary type="html">&lt;p&gt;SVeseli: /* Secure Simple Pairing (SSP) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This Page is work in progress please come back later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This documentation is a survey about the security features of Bluetooth Classic and Bluetooth Low Energy. &lt;br /&gt;
&lt;br /&gt;
== Basic Security Services ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Authentication:&#039;&#039;&#039; verifies the identity of communicating devices based on their Bluetooth address. User authentication is not provided by the Bluetooth Specification. &lt;br /&gt;
* &#039;&#039;&#039;Confidentiality:&#039;&#039;&#039; prevents eavesdropping of the transmitted data by an untrusted third person in the piconet. Confidentiality is created by data encryption.  &lt;br /&gt;
* &#039;&#039;&#039;Authorization:&#039;&#039;&#039; controls the access of the resources. It assures that only authorized devices get permitted to access a service.&lt;br /&gt;
* &#039;&#039;&#039;Message Integrity:&#039;&#039;&#039; checks if the data was altered during the transmission.&lt;br /&gt;
* &#039;&#039;&#039;Pairing/Bonding:&#039;&#039;&#039; creates shared secret keys to use them in subsequent connections.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic Security  ==&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-1.png|500px|thumb|right|BR/EDR/HS Security Modes ]]&lt;br /&gt;
&lt;br /&gt;
Bluetooth Classic defines encryption and authentication during two different stages of the communication setup. The stages can be differed in Link-level and Service-level. Link-level enforced security features occur before the Bluetooth physical link is fully established. Service-level enforced security features occur after the physical link is already established and while the logical link gets established.Security mode one to the three were defined before Bluetooth version 2.1 came out. Bluetooth version 2.1 added the fourth security mode.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 1  ===&lt;br /&gt;
This mode is considered as non-secure because it doesn’t use authentication nor encryption.  Security Mode 1 is only supported by today&#039;s Bluetooth devices to communicate with old devices that are not capable of the other security modes.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 2  ===&lt;br /&gt;
This mode establishes security at Link-level by using a local security manager that controls the access of supported services. It’s even possible to restrict access on a part of the services depending on the trust to the accessing device.  Bluetooth service discovery can be performed without any security challenges.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 3  ===&lt;br /&gt;
This security mode is a link level security mode and security procedures get initiated before the physical link is fully established. Authentication and Encryption is fully supported by security mode 3 connections. Furthermore, service discovery can only be performed with an authenticated device which encrypts its traffic.&lt;br /&gt;
&lt;br /&gt;
=== Security Mode 4  ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Table_3-2.png|500px|thumb|right|BR/EDR/HS Security Mode 4 Levels Summar]]&lt;br /&gt;
&lt;br /&gt;
Security mode 4 was introduced in Bluetooth version 2.1 and is a service level enforces security mode which security mechanisms get initiated after physical and logical link setup. Security mode takes advantage of the Secure Simple Pairing (SSP) Mechanism. SSP in Bluetooth version 4.1 uses the P-256 elliptic curve to generate the link key. Bluetooth 4.1 uses Hash Messages Authentication Codes Secure Hash Algorithm with 256-bit (HMAC-SHA-256) for integrity checks. For encryption the AES-Counter with CBC-MAC (AES-CCM) cypher is used. The P-256 elliptic curve, HMAC-SHA-256 and AES-CCM are security mechanisms which got approved by the Federal Information Processing Standard (FIPS). Security mode 4 gets differentiated into 5 different layers with different security levels.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer 0:&#039;&#039;&#039; Layer 0 is only used by the Service Discovery Protocol (SDP). This layer doesn’t have any security features.&lt;br /&gt;
* &#039;&#039;&#039;Layer 1:&#039;&#039;&#039; Layer 1 doesn’t use any security.&lt;br /&gt;
* &#039;&#039;&#039;Layer 2:&#039;&#039;&#039; Layer 2 uses an unauthenticated link key. &lt;br /&gt;
* &#039;&#039;&#039;Layer 3:&#039;&#039;&#039; Layer 3 required an authenticated link key.&lt;br /&gt;
* &#039;&#039;&#039;Layer 4:&#039;&#039;&#039; Layer 4 uses secure connection in addition to the authenticated link key&lt;br /&gt;
&lt;br /&gt;
Whether or not a link key is authenticated depends on the SSP association model used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Secure Simple Pairing (SSP)  ===&lt;br /&gt;
&lt;br /&gt;
Secure Simple Pairing was introduced with Security Mode 4 at Bluetooth Version 2.1 and got improved in Version 4.1. The main goal of secure simple pairing is to simplify the pairing process for users. The secondary goal is to maintain or enhance the security of Bluetooth. SSP has two security goals, passive eavesdropping protection and man-in-the-middle protection. SSP provide several association models suited for all input/output capability combinations. Some of these association models are protected against passive and active man-in-the-middle (MITM) attacks during pairing by using ECDH public key cryptography.&lt;br /&gt;
&lt;br /&gt;
[[File:Association models.png|500px|thumb|right|Association models]]&lt;br /&gt;
&lt;br /&gt;
==== Numeric Comparison ====&lt;br /&gt;
Numeric comparison was designed for devices, where both can display a six-digit number and allow a user input to accept and deny the connection. During the Paring both devices show a six-digit code on their displays. The user can accept the parring if the displayed numbers are the same. The connection is secure against MITM attacks and eavesdropping, if the paring was done correctly.  &lt;br /&gt;
&lt;br /&gt;
==== Passkey Entry ====&lt;br /&gt;
This model can be used where one device a has a display that sows a six-digit number and the other device has a digit input. Device a show a code that must be entered into the keyboard of the other device to establish the connection. This model is also secure against MITM attacks and eavesdropping.&lt;br /&gt;
&lt;br /&gt;
==== Out of Band (OOB) ====&lt;br /&gt;
The out of band model uses an additional wireless or wired technology like Near Field Communication (NFC) to exchange the needed cryptographic keys. This model’s security is only as secure as the out of band technology. Even though, this association model is associated to be secure against eavesdropping and MITM attacks.&lt;br /&gt;
&lt;br /&gt;
==== Just Works ====&lt;br /&gt;
The just works model is not secured against eavesdropping and MITM attacks. This model is designed for connection where both devices have no input or output capabilities.&lt;br /&gt;
&lt;br /&gt;
==== SSP Phases ====&lt;br /&gt;
Secure Simple Pairing consists of 5 phases:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public key exchange:&#039;&#039;&#039; Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair. Pairing starts when the initiating device sends its public key to the receiving device. The responding device replies with its own public key, when both devices support Secure Connections then P-256 elliptic curve will be used, if at least one device does not support Secure Connections the P-192 elliptic curve will be used.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 1:&#039;&#039;&#039; Phase 2 consist of three protocols: Numeric Comparison, Out-of-Band and Passkey Entry. The protocol is selected depending on the IO capabilities of the device.&lt;br /&gt;
* &#039;&#039;&#039;Authentication stage 2:&#039;&#039;&#039; Phase 3 confirms that the exchange between the two participants has been successfully completed. Both devices calculate a new confirmation value that takes into account the previously exchanged values and the new shared key. The initiator sends the new confirmations value to the responding device and is checked by it. If a failure occurs, the protocol should abort.&lt;br /&gt;
* &#039;&#039;&#039;Link key calculation:&#039;&#039;&#039; After both devices confirm the pairing, a link key is calculated using the shared key and the publicly exchanged data. The link key is used to maintain pairing.&lt;br /&gt;
* &#039;&#039;&#039;Link Manager Protocol Authentication and Encryption:&#039;&#039;&#039; Authentication and generation of the encryption key.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Pairing ===&lt;br /&gt;
With PIN / Legacy Pairing, the link keys are derived from a PIN entered by the user in one or both devices, depending on the configuration and device type. If the PIN is smaller than 16 bytes, the Bluetooth address of the initializing device is used for filling. After the key generation has been completed, the devices authenticate each other to ensure that both are using the same link key.This method only serves to mutually identify the devices and cannot prevent a man-in-the-middle attack. An attacker who knows the PIN can calculate the key from it.&lt;br /&gt;
&lt;br /&gt;
=== Key Generation ===&lt;br /&gt;
&lt;br /&gt;
==== Legacy Key Generation ====&lt;br /&gt;
The link key is a 128-bit random number, shared between two or multiple participants, and is the basis of all security transactions between these participants. The link key must be created and then distributed to the associated devices in order to be used for the authentication procedure. The initialization key is used temporarily during initialization and should be discarded afterwards. The initialization key is the result of the E22 algorithm the input parameters are a Bluetooth address, a PIN and a random number. The initialization key is used for the key exchange during the generation of a link key.&lt;br /&gt;
&lt;br /&gt;
==== Secure Key Generation ====&lt;br /&gt;
Phase 4 (Link key calculation) of Secure Simple Pairing the link key will be established by using Elliptic Curve Diffie-Hellman public/private key pairs.&lt;br /&gt;
&lt;br /&gt;
=== Confidentiality of the data ===&lt;br /&gt;
The Bluetooth standard defines three encryption modes for data traffic, but only two of them actuals provide confidentiality. The modes are as follows: &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 1:&#039;&#039;&#039; The data traffic is unencrypted &lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 2:&#039;&#039;&#039; Individually addressed traffic is encrypted based on individual link keys but broadcast traffic is not.&lt;br /&gt;
* &#039;&#039;&#039;Encryption Mode 3:&#039;&#039;&#039; Individually addressed traffic and broadcast traffic is encrypted using an encryption key based on the master link key.&lt;br /&gt;
For encryption mode 2 and 3 is either the AES-CCM or E0 stream cipher used. Bluetooth Security Mode 4 encrypts all data traffic, expect service discovery messages&lt;br /&gt;
&lt;br /&gt;
=== Trust Levels and Service Security Levels.=== &lt;br /&gt;
In addition to the security modes, exist different levels of service security and trust.&lt;br /&gt;
The trust levels can be differentiated into trusted and untrusted. A trusted device has an established relation ship to the device and has full access to all the services. The untrusted device doesn’t have a relationship to the other device and has only a restricted access to the services.&lt;br /&gt;
The Service security level depend on the used Security mode. There are no Service security levels defined for Security mode 1 and 3. Security mode 2 has the following Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Authentication required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Encryption required&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Authorization required&#039;&#039;&#039;&lt;br /&gt;
Security mode 2 defines the following five Service security levels:&lt;br /&gt;
* &#039;&#039;&#039;Service Level 0:&#039;&#039;&#039; No MITM protection, encryption, or user interaction required.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 1:&#039;&#039;&#039; MITM protection and encryption not required. Minimal user interaction.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 2:&#039;&#039;&#039; Requires encryption only; MITM protection is not necessary.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 3:&#039;&#039;&#039; Requires MITM protection and encryption; user interaction is acceptable.&lt;br /&gt;
* &#039;&#039;&#039;Service Level 4:&#039;&#039;&#039; Requires MITM protection and encryption with 128-bit strength; user interaction is acceptable.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Low Energy security ==&lt;br /&gt;
Fundamentals of the BLE Standard can be found in the [[BLE Fundamentals]] documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bluetooth Low Energy security modes are similar to the Security Modes 2 and 4 of Bluetooth Classic, but each service can have its own security requirements.  Furthermore, Bluetooth Low Energy has two security modes with multiple security levels.&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 1 is associated with encryption&lt;br /&gt;
*Level 1 does neither use authentication nor encryption.  &lt;br /&gt;
*Level 2 uses unauthenticated pairing with encryption.&lt;br /&gt;
*Level 3 uses authenticated pairing with encryption.&lt;br /&gt;
*Level 4 which uses authenticated low energy Secure Connections pairing with encryption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Low energy Security Mode 2 is associated with encryption data integrity&lt;br /&gt;
*Level 1 uses unauthenticated pairing with data signing.&lt;br /&gt;
*Level 2 uses authenticated pairing with data signing.&lt;br /&gt;
&lt;br /&gt;
Security Mode 1 Level 4 is considered to create the strongest connections because it uses AES-CMAC and P-256 elliptic curve for pairing and encryption.  Security Mode 1 Level 3 is less secure because it doesn’t use elliptical curve cryptography. Because Security Mode 2 does not provide encryption, it is strongly recommended to use Security Mode 1 Level 3 and 4.&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Classic and Bluetooth Low Energy security differences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Key_Differences_Between_Bluetooth_BR_EDR_and_Low_Energy.png|600px|Key Differences Between Bluetooth BR/EDR and Low Energy ]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://csrc.nist.gov/publications/detail/sp/800-121/rev-2/final&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>SVeseli</name></author>
	</entry>
</feed>