Swiftpack.co -  gaetanomatonti/Uno as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
gaetanomatonti/Uno
A simple OTP generator written in Swift.
.package(url: "https://github.com/gaetanomatonti/Uno.git", from: "0.2.0")

Uno

A simple OTP generator written in Swift.

Installation

Currently this package supports Swift Package Manager only. More dependency managers may be supported in future releases.

Swift Package Manger

Swift Package Manager is a tool for managing the distribution of Swift Code. It's integrated in the Swift build system and can be used to automate the dependency management.

To add this package as a dependency of another Swift package you just need to add it to the dependencies value of your package manifest (the Package.swift file).

dependencies: [
  .package(url: "https://github.com/gaetanomatonti/Uno.git", from: "0.1.0"),
]

One-Time Password

An OTP (One-Time Password) is an authentication code that can only be used once. As such, it is often used in combination with a regular password to provide an extra layer of security (multi-factor authentication).

HMAC-based One-Time Password

A HOTP (where the "H" stands for Hash-based Message Authentication Code, or HMAC) is a one-time password generated from a cryptographic hash function and a static secret key. It also involves a moving factor that seeds into the generator function, usually a counter. Implementation follows the RFC-4226 specifications.

Time-based One-Time Password

A TOTP (Time-based One-Time Password) extends the HOTP by replacing the moving factor in the hashing function. While in the HOTP the counter is counter-based, in TOTPs it is time-based. This means that the OTP is only valid in a certain interval of time. The amount of time in which every OTP is valid is called timestep, and tends to be 30 seconds or 60 seconds in length. Implementation follows the RFC-6238 specifications.

Hashing Algorithms

While SHA1 is the most frequently used hash function to generate HMACs, SHA256 and SHA512 could also be used.

GitHub

link
Stars: 1
Last commit: 40 minutes ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

0.2.0
2 days ago

This release adds the following features:

  • Metadata type containing information about an OTP.
  • URIParser that parses otpauth URIs usually used in QR Codes to easily configure the OTP generator.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics