https://github.com/nekocode/bangcle-crypto-wrapper
Encrypt your keys at build time using the Bangcle WhiteCrypto tools.
https://github.com/nekocode/bangcle-crypto-wrapper
android gradle-plugin
Last synced: 3 months ago
JSON representation
Encrypt your keys at build time using the Bangcle WhiteCrypto tools.
- Host: GitHub
- URL: https://github.com/nekocode/bangcle-crypto-wrapper
- Owner: nekocode
- License: apache-2.0
- Created: 2018-04-04T10:12:45.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-18T08:09:21.000Z (about 7 years ago)
- Last Synced: 2025-03-20T17:23:17.595Z (3 months ago)
- Topics: android, gradle-plugin
- Language: Java
- Homepage:
- Size: 307 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This project mainly does the following things:
- Integrate the java and so files generated by [Bangcle WhiteCrypto](http://www.bangcle.com.hk/WhiteboxCryptography.html) System
- Generate the [`CryptoUtils.java`](generated_files_examples/CryptoUtils.java) and [`Keys.java`](generated_files_examples/Keys.java) files automatically
- The `CryptoUtils.java` is a simplified wrapper of Bangcle's crypto tools
- The `Keys.java` contains the encrypted keys which are encrypted **at build time**### Starting
After you clone this repostory, you need to copy the java and so files generated by Bangcle WhiteCrypto System into the corresponding directory in `lib-exported` module. And then you need to configure the generator-plugin in the [`lib-exported/build.gradle`](lib-exported/build.gradle).
```gradle
apply plugin: 'bangcle'
bangcle {
aesKeyHex = ... // Hex string of your AES key
ivHex = ... // Hex string of your AES iv
bangcleKey1 = ... // WhiteCrypto encryption key
bangcleKey2 = ... // WhiteCrypto decryption key
genPackage = ... // Target package of the generated java fileskeys {
// key ConstantFiledName, SecretKeyValue
key ..., ...
}
}
```Note that the generator-plugin will use `AES/ECB/PKCS5Padding` encryption algorithm to encrypt the keys if you don't provide the `ivHex`. Otherwise will use `AES/CBC/PKCS5Padding` encryption algorithm. You can generate random AES keys and ivs at [https://asecuritysite.com/encryption/keygen](https://asecuritysite.com/encryption/keygen).