A high-performance White Box Cryptography (WBC) framework designed to secure cryptographic keys and operations in a way that prevents attackers from extracting or reverse-engineering them, even when the code and memory are fully exposed. This framework implements cryptographic algorithms in a manner that resists various side-channel and reverse-engineering attacks.
- Secure Key Management: Protects cryptographic keys from extraction or analysis.
- Encryption Algorithms: Provides implementations for a variety of cryptographic algorithms in a white-box secure fashion.
- Side-Channel Attack Resistance: Built with techniques that prevent leaking sensitive data during execution.
- Cross-Platform Support: Compatible with iOS and macOS applications.
- Optimized Performance: Designed to provide a balance between security and efficiency.
To integrate the White Box Cryptography framework into your Xcode project using Swift Package Manager, follow these steps:
- Open your Xcode project.
- Go to File > Swift Packages > Add Package Dependency.
- Enter the repository URL for this framework:
https://github.com/DrDijkstra/WhiteboxCryptography
. - Choose the version range or tag for the release you want to use.
- Add the following to your
Podfile
:
pod 'WhiteBoxCryptography', '~> 1.0.5'
-
Run
pod install
in the terminal. -
Open the
.xcworkspace
file in Xcode.
To integrate White Box Cryptography with Carthage, add the following to your Cartfile
:
github "DrDijkstra/WhiteboxCryptography" ~> 1.0.0
Then run carthage update
to build the framework.
To use the White Box Cryptography framework, simply import it into your project:
import WhiteBoxCryptography
// Example of how to use the encryption and decryption functionalities
// Encrypting data
let data = "Sensitive data".data(using: .utf8)!
let encryptedData = WhiteBoxCryptography.encrypt(data: data)
// Decrypting data
let decryptedData = WhiteBoxCryptography.decrypt(data: encryptedData)
let decryptedString = String(data: decryptedData, encoding: .utf8)
print("Decrypted String: \(decryptedString ?? "Failed to decrypt")")
The following cryptographic algorithms are available in this implementation:
-
AES (Advanced Encryption Standard): A symmetric key encryption standard used for securing data.
- Supports different key sizes (
AESKeySize
) and modes of operation (AESMode
).
- Supports different key sizes (
-
DES (Data Encryption Standard): A symmetric-key block cipher, formerly a widely-used method of data encryption.
-
Triple DES (3DES): An enhancement of DES that applies the DES algorithm three times to each data block.
-
CAST: A family of symmetric-key block ciphers designed for strong encryption.
-
RC2 (Ron's Code 2): A block cipher designed for use in hardware or software environments, often used for file encryption.
The framework supports encryption, decryption, and hashing for these algorithms in a white-box cryptographic fashion.
This framework is licensed under the MIT License. See the LICENSE file for more details.
We welcome contributions to improve the framework! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
For questions or support, please contact us at:
Email: [email protected]
GitHub: https://github.com/DrDijkstra/WhiteboxCryptography