OATH Seed Conversion

From Swivel Knowledgebase
Revision as of 11:08, 5 April 2019 by DCroft (talk | contribs) (Created page with "Category:Sentry == Introduction == This article explains how to convert the OATH Hard Token seeds from Base16 Hexadecimal to Base 32. This can provide ultimate flexibili...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Introduction

This article explains how to convert the OATH Hard Token seeds from Base16 Hexadecimal to Base 32. This can provide ultimate flexibility for your Hardware token investment, if you intend to import the OATH tokens to other systems in conjunction with using them on the Swivel Secure platform.

Pre-requisites

  • Some ability to use Python scripts
  • Python version 3.7.3
  • Python IDLE

Python Script

import base64
import codecs
import csv

with open('C:\\Users\\admin\\Desktop\\seeds.txt','rt') as input, open('C:\\Users\\admin\\Desktop\\seeds32.txt','w') as output:

    csvin = csv.reader(input, delimiter=' ')
    csvout = csv.writer(output, delimiter=',')

    for row in csvin:
        hex = row[1]
        b32 = base64.b32encode(codecs.decode(hex, 'hex'))
        b32decoded = b32.decode("utf-8")
        csvout.writerow([row[0]] + [b32decoded])