Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I configure a Yubikey slot as static, it's not documented or obvious how the static password yielded by a press relates to the AES key I set. For example:

me@mine:~$ ykpersonalize -1 -ostatic-ticket -ofixed=cccccccccccc -a00000000000000000000000000000000             
Firmware version 2.3.3 Touch level 1795 Program sequence 9

Configuration data to be written to key configuration 1:

fixed: m:cccccccccccc
uid: 000000000000
key: h:00000000000000000000000000000000
acc_code: h:000000000000
ticket_flags: APPEND_CR
config_flags: STATIC_TICKET

Commit? (y/n) [n]: y

me@mine:~$ cat >/dev/null  # and do a short press...

Where does the key-based part (ncejelrjvjvvciclerknrlihnteljrcb) come from?

share|improve this question

The password is the result of encrypting the fields used for OTP, but with fixed values:

me@mine:~$ ykparse 00000000000000000000000000000000 ncejelrjvjvvciclerknrlihnteljrcb
  token: ncejelrjvjvvciclerknrlihnteljrcb
          b0 38 3a c8 f8 ff 07 0a 3c 9b ca 76 bd 3a 8c 01 
  aeskey: 00000000000000000000000000000000
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
          00 00 00 00 00 00 ff ff ff ff ff ff ff ff 0f 2e 

  uid: 00 00 00 00 00 00 
  counter: 65535 (0xffff)
  timestamp (low): 65535 (0xffff)
  timestamp (high): 255 (0xff)
  session use: 255 (0xff)
  random: 65535 (0xffff)
  crc: 11791 (0x2e0f)

  cleaned counter: 32767 (0x7fff)
  modhex uid: cccccccccccc
  triggered by caps lock: yes
  crc: F0B8
  crc check: ok

This can be reproduced with OpenSSL:

me@mine:~$ key=00000000000000000000000000000000
me@mine:~$ fixed='\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0f\x2e'
me@mine:~$ modhex -h $(echo -ne "$fixed" | openssl enc -aes128 -nopad -K $key -iv "" \
                       | hexdump -v -e '/1 "%02x"')

You can't quite reproduce it with ykgenerate because that tool always includes a genuinely unpredictable random: field.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.