[NK3 Mini] Unable to register OTP secret

I am unable to register the OTP for Amazon, a 52-character long string. I get the following error:

$ nitropy nk3 secrets register Amazon XXXXXX.........
Command line tool to interact with Nitrokey devices 0.4.36
Critical error:
An unhandled exception occurred
	Exception encountered: Error('Incorrect padding')

I have been able to register other OTPs.

Currently, nitropy expects the secret to be padded to a multiple of 8 characters. We will change this in an upcoming release to automatically add the padding (issue). Until then, you can avoid this issue by manually adding the padding. In your case, it should be sufficient to append four = characters to the secret so that it has a length of 8 * 7 = 56 characters.

1 Like