Windows – Finding Bluetooth link key in Windows 7, to double pair a device on dualboot computer

bluetoothmulti-bootwindows 7

How can I dig up the Bluetooth link key for a paired device in Windows 7? Is this something that is dependent on the Bluetooth stack I'm using (Toshiba), or is there a generic place to store these in Windows 7?

Note: I'm not talking about the six-digit code usually typed by the user during pairing – that is worthless since it's discarded after pairing process. What I mean is the 128-bit link key that the devices exchange during pairing, and use thereafter to encrypt all their Bluetooth traffic.

Background:

I dualboot Windows 7 / Ubuntu on my laptop, and I would like to have my phone paired to both OS's. Since the dualbooting computer has only one Bluetooth adapter and thus only one Bluetooth address, I cannot do two pairings to the phone, since on the second pairing (Windows) the phone just replaces the previous pairing (Linux) to the same Bluetooth address.

A thread on Ubuntu forums pointed me to what I have to do – pair first on Linux, then on Windows, and then replace the link key on Linux side with the one Windows negotiated.

I can find the Linux side pairing key from /var/lib/Bluetooth/[BD_ADDR]/linkkeys – no problems there.

However, on Windows side I can't find the key. According to the forum post, on Windows side the key should be in SYSTEM\ControlSet002\services\BTHPORT\Parameters\Keys\[BD_ADDR] but while that registry key does exist, it has no subkeys. (And a similar registry path in ControlSet001 didn't have any subkeys either.)

One thing I've been instructed to do is to capture all events during pairing with Sysinternals Process Monitor. I did this, but I haven't been able to find any useful information from the captured events, not even by exporting the data to a huge XML and grepping that with the BD_ADDRs (with or without colons).

So how could I find the link key for a paired device in Windows 7?

Some reference information: Wikipedia: Bluetooth, Security Now: Bluetooth security

Best Answer

The registry key you should use is :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys.

On my computer, it refused to let me access this key. I had to change the owner to Administrators before I could see the sub-key.

If you are using the Toshiba Bluetooth stack, its keys are stored somewhere else. One can either find where, or simply return to the Microsoft stack. In the later case, the Bluetooth keys will be stored in the registry as above.

This thread describes the process :

  1. Uninstall Toshiba Bluetooth (Add/Remove programs),
  2. Reboot,
  3. Windows should now detect the "new" Bluetooth device and install its own drivers for it.

Caution: Create a system restore point first, and ensure you have the installation media for the Toshiba driver for going back (just in case). Test well the functionality of the paired phone before crying victory.

Related Question