| Method Summary |
| |
__init__(self,
dbasefile)
|
| |
authenticate(self,
algo,
username,
bytestring)
authenticate() takes the username and passphrase hash it receives
(presumably from a client) and checks it against the expected OTP in the
dbase. |
| |
convertBytesToHex(self,
bytestring)
Convert a bytestring to a string of hex characters. |
| |
convertBytesToLong(self,
bytestring)
Converts an 8 byte bytestring to a long |
| |
convertBytesToWords(self,
bytestring)
Converts a bytestring to a string containing a worded encoding of the
bytes. |
| |
convertHexToBytes(self,
hexstring)
This method converts a 16 character hex string to a bytestring. |
| |
convertLongToBytes(self,
hashlong)
Converts a long to an 8 byte bytestring |
| |
convertWordsToBytes(self,
wordstring)
Converts a series of words to the bytestring the words have
encoded. |
| |
createHash(self,
username,
algo,
seed,
passphrase,
sequence)
Create a hash of a passphrase based on the sequence number and
seed. |
| |
createOTP(self,
username,
algo,
seed,
passphrase,
sequence)
createOTP() should be used if you want to get all the relevent
information using your own user interface and just use the hash
generation code within this library. |
| |
generateHash(self,
algo,
data)
Generate a hash of the data. |
| |
getChallenge(self,
username)
getChallenge() looks up the username in the OTP dbase and builds the
appropriate OTP challenge string. |
| |
promptAndGenerate(self)
A testing method used to create an OTP from values entered at the
command line. |
| |
validateAlgorithm(self,
algo)
Check that the algorithm is supported. |
| |
validatePassphrase(self,
passphrase)
Check that a passphrase is a valid length. |
| |
validateSeed(self,
seed)
Check that a seed is a valid length and doesn't contain any invalid
characters. |
| |
validateSequence(self,
seq)
Check that the sequence number is valid. |
| |
validateUsername(self,
username)
Check to make sure a username hasn't already been used. |
| Inherited from OTPdbase |
| |
retrieveDBEntry(self,
username)
Retrieve a user entry from the database that corresponds to the
supplied username. |
| |
storeDBEntry(self,
dbEntry)
storeDBEntry() stores a single OTPUserEntry in the database file set
at initialisation. |