GithubHelp home page GithubHelp logo

william-weng / fork-argon2swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tmthecoder/argon2swift

0.0 0.0 0.0 51.26 MB

An Argon2 Wrapper for Swift

Home Page: https://docs.tmthecoder.dev/Argon2Swift/

License: MIT License

Ruby 12.17% Objective-C 1.31% Swift 86.52%

fork-argon2swift's Introduction

Argon2Swift

Argon2Swift Swift License: MIT

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

Installation (Cocoapods)

Argon2Swift can be installed via Cocoapods by adding the following to your Podfile:

pod Argon2Swift

Installation (SPM)

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

.package(url: "https://github.com/tmthecoder/Argon2Swift.git", .branch("main"))

Usage

High-level hashing and verification (for direct hashing & verification of byte arrays, check the example)

import Argon2Swift

// Create a password and a salt
let password = "password"
let s = Salt.newSalt()
//Hash with pre-set params (iterations: 32, memory: 256, parallelism: 2, length: 32, type: Argon2Type.i, version: Argon2Version.V13)
let result = try! Argon2Swift.hashPasswordString(password: password, salt: s)

//Raw hash values available as int list, base 64 string, and hex string
let hashData = result.hashData()
let base64Hash = result.base64String()
let hexHash = result.hexString()

//Encoded hash values available as int list and encoded string
let encodedData = result.encodedData()
let encodedString = result.encodedString()

//Verify password (returns true/false), uses default type (Argon2Type.i)
let verified = try! Argon2Swift.verifyHashString(password: password, hash: stringEncoded);

Features and bugs

Please file feature requests and bugs at the issue tracker.

Licensing

fork-argon2swift's People

Contributors

tmthecoder avatar batonpiotr avatar vzsg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.