SwiftSSL is an Elegant crypto toolkit in Swift, based on CommonCrypto.
How To Get Started
Add SwiftSSL as submodule
git submodule add https://github.com/SwiftP2P/SwiftSSL.git SwiftSSL
Add SwiftSSL.xcodeproj as subproject
Configure your project
- Add relative path for file module.map in your project Build Settings / Swift Compiler - Search Paths / Import Paths
SwiftSSL try to do things in swift way, so it doesn't just transfor code from openssl or other lib.
If you wanna digest String or NSData, you can do it just like this:
import SwiftSSL let plainText: String = "This is plain text." var digestString = plainText.digest(SwiftSSL.DigestAlgorithm.MD5)
Just that simple!
Wanna sign a message?
import SwiftSSL let message: String = "This is your message." let passphrase: String = "Your passphrase" var signature = message.sign(SwiftSSL.HMACAlgorithm.SHA512, key: passphrase)
SwiftSSL is still on the way. It has provided:
Cypraea is released under the MIT license. See LICENSE for details.