# Bluetooth Keyboard Encryption

## keyser_soze

Hi I am trying to set up my loverly new DiNovo Edge.

I have it connected OK at the moment but I wan't to make sure that I connect securely with it.

I don't know how to check if the encryption is enabled.

Here is my hcid.conf

```
#

# HCI daemon configuration file.

#

# HCId options

options {

   # Automatically initialize new devices

   autoinit yes;

   # Security Manager mode

   #   none - Security manager disabled

   #   auto - Use local PIN for incoming connections

   #   user - Always ask user for a PIN

   #

   security auto;

   # Pairing mode

   #   none  - Pairing disabled

   #   multi - Allow pairing with already paired devices

   #   once  - Pair once and deny successive attempts

   pairing multi;

   # Default PIN code for incoming connections

   passkey "12345678";

}

# Default settings for HCI devices

device {

   # Local device name

   #   %d - device id

   #   %h - host name

   name "BlueZ at %h (%d)";

   # Local device class

   class 0x000100;

   # Default packet type

   #pkt_type DH1,DM1,HV1;

   # Inquiry and Page scan

   iscan enable; pscan enable;

   # Default link mode

   #   none   - no specific policy 

   #   accept - always accept incoming connections

   #   master - become master on incoming connections,

   #            deny role switch on outgoing connections

   lm accept;

   # Default link policy

   #   none    - no specific policy

   #   rswitch - allow role switch

   #   hold    - allow hold mode

   #   sniff   - allow sniff mode

   #   park    - allow park mode

   lp rswitch,hold,sniff,park;

}

```

Any help would be appreciated.

----------

## Aysen

```
hcitool con
```

displays active bluetooth connections. For example, for me it displays

```
Connections:

        > ACL 00:01:02:03:04:05 handle 44 state 1 lm MASTER AUTH ENCRYPT

        > ACL 00:01:02:03:04:06 handle 41 state 1 lm MASTER

```

Those are my bluetooth keyboard and mouse, the keyboard uses encryption, the mouse doesn't.

hcitool is useful for general purpose bluetooth commands, you might also try hidd for input device oriented commands (if you use hidd at all, that is).

----------

## keyser_soze

I worked it out already. Thanks for responding.

----------

## Aysen

Oh, right... now I can see that your original post is from March. No wonder you've already solved it yourfself.

----------

## grooveman

Don't suppose you would mind documenting your solution...

----------

## keyser_soze

Actually it isn't working for me anymore. The new bluetooth system from bluez doesn't work very well with dinovo edge. I haven't managed to get the encryption working since the hidd driver was abandoned.

However when I had it working I edited the bluetooth init.d script to get the ecryption working because it didn't seem to work just by using the configuration files. I don't have that setup anymore so I am not sure what the exact commands were.

----------

## grooveman

Bummer  :Sad: 

----------

## gsra99

I was wondering how you managed to get the keyboard with encryption, and the mouse without. This is what I want to do, however, it seems to be all or nothing. So when I turn encryption on the mouse will not connect, but when I turn it off then the keyboard communication is not encrypted.

----------

## chojin

I have been struggeling and googling about this problem too the last few hours.. Due to last system update where the neest bluez was emerged.. I also lost my hidd daemon..and my Logitech DiNovo Laser Desktop stopped working...

At first I could only connect my mouse succesfully.. without encryption.. following these instructions: https://forums.gentoo.org/viewtopic-t-746087.html but whenever I typed something on my keyboard I received errors in /var/log/messages stating: hcid[7321]: Encryption link key not found

Finaly I managed to connect my keyboard by performing these actions:

I emerged bluez-gnome and started the bluetooth-applet to have a pin-agent

I made sure the keyboard was registered as an input service, which it was  (see again https://forums.gentoo.org/viewtopic-t-746087.html)

After finding out the MAC of my keyboard (using hcitool scan after pressing the connect button on my keyboard)

I started a pairing with:

```
dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter.CreateBonding string:00:07:61:34:A7:49
```

whereas hci0 is my hci0 device and 00:07:61.. is the MAC of my keyboard

At that point bluetooth-applet asks me a pin code and I entered a random few digits which I also typed on my DiNovo keyboard and then pressed enter.

Now bluetooth-applet tells me the pairing succeeded.

However the dbus-command said 'Connection timed out'..

I tried reconnecting to it with

```
dbus-send --system --type=method_call --print-reply --dest=":1.103" /org/bluez/input/keyboard0 org.bluez.input.Device.Connect
```

 whereas 1.103 the sender is, input/keyboard0 the registered input service for my keyboard

This however tels me the connection is refused..

But after some typing on my DiNovo keyboard.. it suddenly connected and was registered as a HID input device, so i'm not sure the last connection step is needed..

----------

