Wednesday 16 March 2011

Upgrade seed file

In DualShield, you may encounter a problem when importing a Deepnet token seed file which came with its previous version v3.x, as they changed the format of token seed file. If the file only contains a few tokens, you can modify it manually, however it is very hard labour if it contains hundred tokens.


Here is the utility to convert from v3x format to v5x format, also the source code, it utilizes pugixml to manipulate the xml file.


The command to run this utility is, seedupgrade infile outfile.




V3x Format



<tokenList>
<tokenInfo>
<method>PocketID</method>
<device>
<manufacturer>Deepnet Security</manufacturer>
<vendor>Deepnet Security</vendor>
<model>CB</model>
<serial>71358472</serial>
</device>
<token><![CDATA[<data>
<deviceID>71358472</deviceID>
<type>CB</type>
<counter>0</counter>
<digits>6</digits>
<secret enc="HEX">08E49538328BAE830E0DB14A82341100BC23B840</secret>
<description>71358472</description>
</data>
]]></token>
</tokenInfo>
</tokenList>



V5x Format



<?xml version="1.0"?>
<data>
<header>
<manufacturerCode>DN</manufacturerCode>
<productCode>ST</productCode>
<encode>HEX</encode>
<encrypt>NONE</encrypt>
</header>
<tokens>
<token>
<serial>71358472</serial>
<seed>08E49538328BAE830E0DB14A82341100BC23B840</seed>
</token>
</tokens>
</data>

No comments: