Skip to content
Architecture > Encryption

Properties Files

Values in properties files can be encrypted. Let's say you have a property myurl in your which depends on a password and you would like to encode the password Password123456.

  1. Under the scripts directory, use the (tools.bat for Windows) to create a 256-bit strength key (feel free to adjust the strength).

    ./ --aes_generate /opt/ami/secret.aes 256
    ./tools.bat --aes_generate /opt/ami/secret.aes 256
  2. Add this option to your so that AMI knows where the secret key for decoding encrypted properties is located
  3. Using the same, Encode the password and copy the output text into your clipboard

    ./ --aes_encrypt /opt/ami/secret.aes Password123456
    ./tools.bat --aes_encrypt C:/ami/amione/secret.aes Password123456

    Example encoded password:

  4. Change your file to use the encrypted value instead, by enclosing with ${CIPHER: ... }

  5. Restart AMI

In the AmiOne.log you'll see that the value for the myurl property is substituted with ***** for security purposes.

You can see the password listed in the user interface by going to Dashboard -> Session Variables. You can also decrypt using by running:

./ -aes_decrypt /opt/ami/secret.aes fYjHz8Dr4o7XjZcOd1BhtKzV9U5MpZMpTyGlu-mpheL4qV-ZX-yUads Password123456
./tools.bat -aes_decrypt C:/ami/amione/secret.aes fYjHz8Dr4o7XjZcOd1BhtKzV9U5MpZMpTyGlu-mpheL4qV-ZX-yUads Password123456


If you see the following error: Error: Could not find or load main class please modify the tools script to point to com.f1.utils.encrypt.EncrypterTool or com.f1.encrypt.EncrypterTool