A pure implementation of the Argon2 hash function algorithm in Swift.
Note: For the Blake2b parts of the algorithm a C implementation of Blake2b is used.
Based on Argon2 RFC 9106: https://www.rfc-editor.org/rfc/rfc9106.pdf.
Inspired by https://github.com/bwesterb/argon2pure.
You can run PureArgon2Swift as executable in your terminal, by following these steps:
-
Make sure Xcode is installed.
-
Make sure the Command Line Utilities are installed:
xcode-select --install
-
Then run following:
git clone https://github.com/sp4c38/PureArgon2Swift.git
cd PureArgon2Swift
make
-
Now you've got the
argon2
executable file. To get the help message run./argon2 -h
An example for testing:
echo -n "Password" | ./argon2 Salt1234 -p 3 -k 2048 -t 1
You can import PureArgon2Swift in your project using the Swift Package Manager.
-
Add in Package.swift:
Append following to your dependencies:
.package(url: "https://github.com/sp4c38/PureArgon2Swift", from: "1.0.0")
Append following to your targets dependencies:.product(name: "Argon2", package: "PureArgon2Swift")
-
Add in Xcode project:
In the menu go to File > Add Packages... > in search bar type https://github.com/sp4c38/PureArgon2Swift > Add Package > Checkmark "Argon2" > Add Package