SwiftyCryptor is an encryption/decryption library for iOS applications, that helps you securely encrypt/decrypt the data.
SwiftyCryptor delivers a secure data encryption/decryption features contained inside the Cryptor
class which provides an easy-to-use interface (defined in CryptorProtocol
) for encrypting and decrypting the data.
SwiftyCryptor uses ChaCha20-Poly1305 cipher with a symmetric key of size 256 bits, that is securely stored in Keychain.
Swift
iOS 13.0 +
main
branch keeps the newest major - stable release.stable
branch keeps the newest minor - stable release.beta
branch keeps the newest minor - beta release.https://github.com/grikshka/Swifty-Cryptor
and click Next.1.0.0
..package(name: "SwiftyCryptor", url: "https://github.com/grikshka/Swifty-Cryptor/", from: "1.0.0")
import SwiftyCryptor
let cryptor: CryptorProtocol = Cryptor()
let secret = "secret"
do {
// Encrypt plain text
let encryptedSecret = try cryptor.encrypt(value: secret)
// Decrypt encrypted text
let decryptedSecret = try cryptor.decrypt(value: encryptedSecret)
} catch let error as CryptorError {
// Handle CryptorError
} catch let error {
// Fallback error
}
stable release
with a version number X¹.X².X³
then the latest version number of this library is the X¹.X².X³
.beta release
with a version number betaX¹.X².X³-Xⁿ
then the latest version number of this library is the X¹.X².X³
part of it.pre release
. If there is one or more pre releases
, each of them should be developed in a separate branch named vX¹.X².X³
where X¹.X².X³
is the version number of the pre release. In this case, the latest version number of the library is a version number of the pre release with the highest X¹.X².X³
number.X¹.X².X³
, your version number will be X¹.X².X³+1
X¹.X².X³
, your version number will be X¹.X²+1.0
X¹.X².X³
, your version number will be X¹+1.0.0
stable
branch and create a new branch named vX¹.X².X³
where X¹.X².X³
is a version number of your new release.vX¹.X².X³
branch that you created.vX¹.X².X³
branch that you created, to the beta
branch.
beta release
or a pre release
) Before merging the Pull Request you must ensure that the latest release already has a stable release
.beta release
or a pre release
) If the latest release does not have a stable release yet, then you have to wait for it before merging your Pull Request.beta release
or a pre release
) If the previous release does have a stable release now, then merge a stable
branch into the vX¹.X².X³
branch that you created and resolve the merge conflicts if there are any.beta
branch and name it betaX¹.X².X³-0
vX¹.X².X³
branch that you created.vX¹.X².X³
branch that you created, to the beta
branch.beta
branch and name it betaX¹.X².X³-Xⁿ
where the fourth section of the release number - Xⁿ
- should be incremented from your previous beta release.beta
branch contains the working version of the library with all your changes applied to it, create a Pull Request from the beta
branch to the stable
branch.stable
branch and name it X¹.X².X³
where X¹.X².X³
is a version number of your release.link |
Stars: 0 |
Last commit: 1 week ago |
• Update documentation
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics