Argon2Kit

main

An Argon2 wrapper written in Swift.
rkreutz/Argon2Kit

Argon2Kit

Swift 5.2 Swift Package Manager License: MIT GitHub tag Run Tests

Swift wrapper for the C implementation of Argon2, the winner of the Password Hash Competition.

Installation (SPM)

Argon2Swift can be installed via SPM (Swift Package Manger) by adding the following to your depencencies:

.package(url: "https://github.com/rkreutz/Argon2Kit.git", .upToNextMajor(from: "0.1.0"))

Usage

High-level hashing and verification:

import Argon2Kit

let password = "password"
let salt = Data.random(bytes: 16)

let digest = try! Argon2.hash(password: password, salt: salt)

let rawData = digest.rawData // 32 bytes of the hash
let encodedData = digest.encodedData // the Argon2 encoded data
let encodedString = digest.encodedString // the Argon2 encoded string

let isVerified = try! Argon2.verify(password: password, encodedHash: encodedString)

Features and bugs

Please file feature requests and bugs at the issue tracker.

Licensing

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Oct 20 2024 14:09:58 GMT-0900 (Hawaii-Aleutian Daylight Time)