https://github.com/lambdapioneer/sloth-ios
Synchronised RainbowSloth Swift package
https://github.com/lambdapioneer/sloth-ios
ios password-hashing sloth swift
Last synced: 9 months ago
JSON representation
Synchronised RainbowSloth Swift package
- Host: GitHub
- URL: https://github.com/lambdapioneer/sloth-ios
- Owner: lambdapioneer
- Created: 2023-11-20T13:37:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-24T20:32:47.000Z (about 2 years ago)
- Last Synced: 2025-09-13T11:46:12.221Z (10 months ago)
- Topics: ios, password-hashing, sloth, swift
- Language: Swift
- Homepage: https://github.com/lambdapioneer/sloth
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sloth: iOS
We have implemented the SE-backed key stretching scheme RainbowSloth for iOS 15+.
This folder gets synced into a designated repository to allow inclusion as a Swift package dependency.
For changes refer to the main repository here: https://github.com/lambdapioneer/sloth
## Setting up
Add this repository as a dependency to your `Package.swift` file like so:
```swift
dependencies: [
// ...
.package(url: "https://github.com/lambdapioneer/sloth-ios.git", from: "0.3.0"),
],
targets: [
.target(
name: "YourAppTarget",
dependencies: [
// ...
.product(name: "RainbowSloth", package: "sloth-ios")
],
// ...
)
// ...
]
```
## Using RainbowSloth
After adding the dependency you can import the library in the respective `.swift` files and use it:
```swift
import RainbowSloth
// create a new Sloth instance
let sloth = RainbowSloth(withN: 100) // see paper on how to choose `n`
// create a new key
let (storageState, key) = try sloth.keygen(
pw: "user-passphrase",
handle: "your-identifier",
outputLength: 32
)
// re-derive the same key later
let key = try sloth.derive(
storageState: storageState,
pw: "user-passphrase",
outputLength: 32
)
```