A Swift library for cryptographic operations using encryption algorithms.
- Support for encrypting strings using common encryption algorithms.
- Simplified API for easy encryption operations.
To integrate SwiftStrideIO into your Xcode project using Swift Package Manager, follow these steps:
- Open your project in Xcode.
- Navigate to the menu bar and click
File
>Swift Packages
>Add Package Dependency...
. - In the search bar of the new window that appears, paste the following URL:
https://github.com/rayhaanalykhan/CipherEncryption.git
- Follow the on-screen instructions to choose the package options and the version you want to integrate.
- Once completed, Xcode will download the package and add it to your project navigator.
To use CipherEncryption in your project, you will typically follow these steps:
-
Encrypt using computed properties:
Encrypt the string using one of encryption algorithm eg: SHA-256.
let someString = "someString" if let encryptedString = someString.ce.SHA256 { // ce = CipherEncryption print(encryptedString) } else { print("Could not encrypt this: '\(someString)' in SHA256") }
-
Encrypt using encrypt function:
Similary you can use the encrypt function to encrypt the string.
let someString = "someString" if let encryptedString = someString.encrypt(.SHA1) { print(encryptedString) } else { print("Could not encrypt this: '\(someString)' in SHA256") }
Using function is more feasible in some cases, you can use the enum defined on String class extension and pass it in a function. Example, here it is used in a different module, using function will provide the user with any future cases.
CipherEncryption is released under the MIT License. See the (LICENSE) file for further details.
Contributors are welcomed to fork the project and submit pull requests. Please include unit tests if possible for any new or existing functionality. Also, update the README accordingly.
For further information, contact rayhaanalykhan at their GitHub profile.