Fork me on GitHub

How Gradle-Fury does encryption

In your root gradle.build add apply from: 'https://raw.githubusercontent.com/gradle-fury/gradle-fury/develop/gradle/encryption.gradle'

  1. Create a master key. it's stored in your user profile/.gradle/fury.properties. It's an AES key that's used to encrypt all your stuff. Never check this in. Generate it with gradlew generateMasterKey
  2. Encrypt your password. It's project specific and stored in projectRoot/local.properties. Don't check this is, but if you do, it's not a big deal since it's encrypted. gradlew encryptPassword. This will print the cipher text to stdout. It make this more useful, try gradlew encryptPassword -PstoreField=NEXUS_PASSWORD whereby NEXUS_PASSWORD is the field within gradle.properties is that you want to encrypt. The cipher text is automatically added to local.properties
  3. When you build your project, local.properties is merged into the current context (which includes gradle.properties). The credentials are then decrypted when needed.

The cipher text is stored as key={CIPHERTEXT}. The opening and closing brackets are used internal to determine if something could be encrypted. "key" is the normal set of properties keys used by fury (and android)