To run the example project, clone the repo, and run
pod install from the Example directory first.
ios >= 13.0 swift >= 5.1
Thinbus-SRP is available through CocoaPods. To install it, simply add the following line to your Podfile:
Step 0: Generate a new verifier v for the user identity I and password P with salt s.
//register s and v send to server let srp = Client.init(config: Config(prime: N, generator: g, key: key, algorithm: .sha256)) let verifier = client.enroll(identity: _identity, password: _password, salt: salt)
Step 1: Generates a one-time client key A encoded as a hexadecimal.
let userA = client.identify(identity: _identity, password: _password, salt: salt)
Step 2: Create challenge response to server's public key challenge B with a proof of password M1.
let message = try! srp.challenge(B: userB, salt: salt) //confirm server's proof of shared key message M2 against srp.confirm(proof: serverPoof) //calc 256 bit share key srp.session()
Thinbus-SRP is available under the MIT license. See the LICENSE file for more info.