Nitrokey Storage and Open Keychain => Lack of power supply?

Hey PPL,

I just tried the following setup: Motorola Moto G3 + Nitrokey Storage 8GB + USB OTG Cable

Following the Tutorial on this page (GREAT NEWS: Nitrokey Pro is supported by OpenKeyChain on Android now!) I came to the point where Open Keychain wanted me to plug in the Nitroky (Smartcard). But unfortionally the Nitrokey Storage was not recognized, normal usb sticks and other usb devices are working (Keyboard or Mouse).
So I tried to connect it via a powered USB hub (elektron Overhub) and with the hub in between the Nitrokey Storage was recognized and the crypto processes succeded.

Do you have any ideas how to get the nitrokey to work with a mobile setup, without a powered usb hub? Is there a way to fix that issue?

PS: Just another experience: While the Nitrokey is plugged in, Android refuses to show the keyboard, cause the Nitrokey is registered as a Keyboard.

Thank you for sharing your experience. Unfortunately there is no way to reduce Nitrokey’s power consumption. (BTW: NK Storage uses way less power than allowed, so I guess your mobile phone doesn’t fulfill the USB specification in this regards.) Perhaps a power bank could help but may not be very practical.

Did your issue look like this one or does it behave differently?

This sounds like a major issue or did you find a way to work around it?

Thank you jan for your answer. It helped me to find out some more
information about the issue. Assuming that the power supply of my phone
is enough for the Nitrokey Storage (cause I were able to drive midi
keyboards etc. with it) I went on experimenting. It seems like the USB
hub is only required to etablish the connection between the phone and
the key. So maby this could be a problem with the USB protocoll that
would be fixed by the hub?

Experimental Setup:

  1. Connecting Nitrokey directly with OTG cable to Phone:

Nothing happens, Nitrokey is not detected by phone.

  1. Nitrokey connected to Hub, Hub connected to phone via OTG, no power
    supply:

Nothing happens, Nitrokey is not detected by phone.

  1. Nitrokey connected to Hub, Hub connected to phone via OTG, permanent
    power supply:

Everything works fine, Nitrokey is detected and is working with phone.

  1. Nitrokey connected to Hub, Hub connected to phone via OTG, power
    supply ONLY for connecting (less then 0.5 sec.)

After Nitrokey is detected and the power supply is removed, nitrokey
stays connected to the phone and works fine.

My own thoughts about this:

The nitrokey has problems to etablish the connections directly with the
phone (maby USB protocoll bug on any site). The overhub could fix it,
because he rebuilds the connection between phone and himself. To be
detected, the overhub needs power supply (thats why it also does not
work with “normal” USB sticks connected to it without power supply).
After that no more power supply is needed, so a lack of power is not the
reason for this to happen.

If anyone of you has an Idea, it would be verry nice if you could help
me. If you want me to perform more tests on this, I would help you with
pleasure.

@jan: this does not look like my issue, cause open keychain and nitrokey
are working perfect together. The workaround for the keyboard is to
enter the pin before connecting the nitrokey, wich works fine, but could
be a bit better (maby as an improvement).

1 Like

Which USB version does your elektron Overhub support (e.g. USB 2.0)?

The Hub supports USB 3.0.

Interesting. The Motorola Moto G4 supports USB 2.0 only.

Jeah, all other parts of this chain are USB 2.0, only he hub itself is 3.0, wich is compatible to 2.0 (also phone is Motorola Moto G3 Osprey)

Hi!
Have you tried to insert the stick first and then run the Open Keychain?
It detects the stick for me on Galaxy S6, shows the SN of the card and it tried even to import the key from the keyserver.
I wanted to generate the keys, but after issuing reset the OK was not allowing me to, asking instead for new user PIN with at least 6 digits (I tried both 9 and 6). Perhaps it was top-20 (Edit: it looks like this is some other, known issue). I will try later when phone will recharge (I was starting on low battery already).

@szszszsz Yeah, I’ve tried this. Open Keychain is detecting it then, but only if I previously run this “kickstarting process” with the use of the USB Hub, without it even Open Keychain itself has no change to get the stick working.

If I have time this weekend or later, I’ll try to build an USB OTG Cable with a capacitor to exclude the existence of a current peak at the connection process. If it works with this, the power supply at the beginning is the problem. If it doesn’t it should be protocoll. Let’s find out.

1 Like

This was my initial guess too, since it works on my phone. Fingers crossed!

Today I found the solution for my problem. When the nitrokey is connected to the Motorola Moto G3, the voltage is pulsing all few seconds. This might happen, if the phone has a protection circuit that is activated by the power need of the nitrokey. So maby the Nitrokey needs a higher amperage at the beginning of the connection.

Me (and my dad, who helped me with it) were able to rebuild the pulsing problem with a 50 microfarads capacitor (as a replacement for the Nitrokey). Because a capacitor has a big need of amperage in charging phase, this is what activates the protection circuit. Maby the Nitrokey has also such a capacity.
To limit the current we placed a resistance of 10 Ohm in the OTG Cable, and suddenly the Nitrokey is detected by the phone without any problem.

So if the Nitrokey is not detected by a OTG Device, this could be a problem, and it could be (provisionally) fixed by adding a resistance.

The OTG Cable is not USB conform anymore with this modification. The secondary voltage went down on 4V, but as long as I tested, everything works.

We tried 22 Ohms first, wich leades to a 3,1V secondary and wich was too less to let the storage of the Nitrokey storage work. However, the smartcard and the keyboard were still detected.

If you have any questions on this, don’t mind to ask me. I’ll answer with pleasure.

2 Likes