one-time-password-3.0.0.0: HMAC-Based and Time-Based One-Time Passwords
Safe HaskellSafe-Inferred
LanguageGHC2021

OTP.HOTP

Synopsis

Documentation

data OTP Source #

Since: 3.0.0.0

Instances

Instances details
Show OTP Source #

Since: 3.0.0.0

Instance details

Defined in OTP.Commons

Methods

showsPrec :: Int -> OTP -> ShowS #

show :: OTP -> String #

showList :: [OTP] -> ShowS #

Eq OTP Source #

Since: 3.0.0.0

Instance details

Defined in OTP.Commons

Methods

(==) :: OTP -> OTP -> Bool #

(/=) :: OTP -> OTP -> Bool #

Ord OTP Source #

Since: 3.0.0.0

Instance details

Defined in OTP.Commons

Methods

compare :: OTP -> OTP -> Ordering #

(<) :: OTP -> OTP -> Bool #

(<=) :: OTP -> OTP -> Bool #

(>) :: OTP -> OTP -> Bool #

(>=) :: OTP -> OTP -> Bool #

max :: OTP -> OTP -> OTP #

min :: OTP -> OTP -> OTP #

Display OTP Source #

Since: 3.0.0.0

Instance details

Defined in OTP.Commons

HMAC-SHA-1

newSHA1Key :: IO AuthenticationKey Source #

Create an new random key to be used with the SHA-1 functions

Since: 3.0.0.0

hotpSHA1 Source #

Arguments

:: AuthenticationKey

Shared secret

-> Word64

Counter value

-> Digits

Number of digits in a password. MUST be 6 digits at a minimum, and possibly 7 and 8 digits.

-> OTP

HOTP

Compute HMAC-Based One-Time Password using secret key and counter value.

Since: 3.0.0.0

hotpSHA1Check Source #

Arguments

:: AuthenticationKey

Shared secret

-> (Word64, Word64)

Valid counter range, before and after ideal

-> Word64

Ideal (expected) counter value

-> Digits

Number of digits provided

-> Text

Digits entered by user

-> Bool

True if password is valid

Check presented password against a valid range.

Since: 3.0.0.0

HMAC-SHA-256

newSHA256Key :: IO AuthenticationKey Source #

Create an new random key to be used with the SHA256 functions

Since: 3.0.0.0

hotpSHA256 Source #

Arguments

:: AuthenticationKey

Shared secret

-> Word64

Counter value

-> Digits

Number of digits in a password. MUST be 6 digits at a minimum, and possibly 7 and 8 digits.

-> OTP

HOTP

Compute HMAC-Based One-Time Password using secret key and counter value.

Since: 3.0.0.0

hotpSHA256Check Source #

Arguments

:: AuthenticationKey

Shared secret

-> (Word64, Word64)

Valid counter range, before and after ideal

-> Word64

Ideal (expected) counter value

-> Digits

Number of digits provided

-> Text

Digits entered by user

-> Bool

True if password is valid

Check presented password against a valid range.

Since: 3.0.0.0

HMAC-SHA-512

newSHA512Key :: IO AuthenticationKey Source #

Create an new random key to be used with the SHA512 functions

Since: 3.0.0.0

hotpSHA512 Source #

Arguments

:: AuthenticationKey

Shared secret

-> Word64

Counter value

-> Digits

Number of digits in a password

-> OTP

HOTP

Compute HMAC-Based One-Time Password using secret key and counter value.

Since: 3.0.0.0

hotpSHA512Check Source #

Arguments

:: AuthenticationKey

Shared secret

-> (Word64, Word64)

Valid counter range, before and after ideal

-> Word64

Ideal (expected) counter value

-> Digits

Number of digits in a password

-> Text

Password entered by user

-> Bool

True if password is valid

Since: 3.0.0.0