OTPKit 0.1.6

OTPKit 0.1.6

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Chris Amanse.



OTPKit 0.1.6

OTPKit

OTPKit is a Swift framework containing implementations of one-time password algorithms.

Supported Algorithms

Usage

Generating a time-based one-time password

// Shared unique secret (usually represented by a Base 32 string)
let base32String = "V3ZMBGAETLLSXRJZ6QZD42Z33O3DK3R7"

let secret = try! Base32.decode(base32String)

let passwordGenerator = TOTPGenerator(key: secret, period: 30, digits: 6, hashFunction: .sha1)

let now = Date()
try? passwordGenerator.password(for: now) // Password for current time
try? passwordGenerator.password(for: now + 30) // Password for 30 seconds from now

License

Copyright © 2016 Joe Christopher Paul Amanse

This software is distributed under the MIT License.