<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="https://forum.yubico.com/feed.php?f=16&amp;t=436" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2009-11-20T19:52:11+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=16&amp;t=436</id>
<entry>
<author><name><![CDATA[btimby]]></name></author>
<updated>2009-11-20T19:52:11+01:00</updated>
<published>2009-11-20T19:52:11+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=436&amp;p=1875#p1875</id>
<link href="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1875#p1875"/>
<title type="html"><![CDATA[Re: Yubikey public ID (and sticker)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1875#p1875"><![CDATA[
OK, so I figured this out, here is the python code. What I was missing was the byte order.<br /><br />--<br />&gt;&gt;&gt; otp = 'ccccccccfckduehjhceenjluteviurncvivulgecfjbj'<br />&gt;&gt;&gt; id = otp[:-32]<br />&gt;&gt;&gt; id = yubikey.modhex_decode(id)<br />&gt;&gt;&gt; id<br />'\x00\x00\x00\x00@\x92'<br />&gt;&gt;&gt; struct.unpack('&lt;HHH', id)<br />(0, 0, 37440)<br />&gt;&gt;&gt; struct.unpack('&gt;HHH', id)<br />(0, 0, 16530)<br /># eureka, there is my id as an integer!<br /># now pad that guy with NULL word to expand it to 64 bits, then convert to long long.<br />&gt;&gt;&gt; struct.unpack('&gt;Q', struct.pack('H', 0) + id)<br />(16530,)<br />--<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=646">btimby</a> — Fri Nov 20, 2009 7:52 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[btimby]]></name></author>
<updated>2009-11-20T17:11:08+01:00</updated>
<published>2009-11-20T17:11:08+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=436&amp;p=1874#p1874</id>
<link href="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1874#p1874"/>
<title type="html"><![CDATA[Re: Yubikey public ID (and sticker)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1874#p1874"><![CDATA[
Thank you. However, I need to do this programatically. I have found examples on how to encode/decode modhex, but how do I go from the result to the int?<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=646">btimby</a> — Fri Nov 20, 2009 5:11 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[network-marvels]]></name></author>
<updated>2009-11-20T07:46:23+01:00</updated>
<published>2009-11-20T07:46:23+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=436&amp;p=1873#p1873</id>
<link href="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1873#p1873"/>
<title type="html"><![CDATA[Re: Yubikey public ID (and sticker)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1873#p1873"><![CDATA[
Yubico provides the ModHex calculator for converting the data into various formats including converting the integer into the ModHex format. The ModHex calculator is available at the following link:<br /><br /><!-- m --><a class="postlink" href="http://www.yubico.com/developers/modhex/">http://www.yubico.com/developers/modhex/</a><!-- m --><br /><br />We hope this helps!<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=280">network-marvels</a> — Fri Nov 20, 2009 7:46 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[btimby]]></name></author>
<updated>2009-11-19T17:12:20+01:00</updated>
<published>2009-11-19T17:12:20+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=436&amp;p=1872#p1872</id>
<link href="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1872#p1872"/>
<title type="html"><![CDATA[Yubikey public ID (and sticker)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=436&amp;p=1872#p1872"><![CDATA[
My understanding is that the number printed on the sticker stuck to the plastic envelope is the public ID assigned to the yubikey.<br /><br />I need to know how to translate from this integer value to the modhex version the yubikey spits out.<br /><br />For example, I ask a customer to read the number from the sticker, I want to locate that key in my database, how is this conversion from integer to 48 bit modhex value performed?<br /><br />I can find no example of this.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=646">btimby</a> — Thu Nov 19, 2009 5:12 pm</p><hr />
]]></content>
</entry>
</feed>