An open API service indexing awesome lists of open source software.

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.

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 files

keys {
// 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).