public static void main(String[] args) {
    if (args.length < 1 || (!"encryption".equals(args[0]) && !"decryption".equals(args[0] ))){
      LOG.error("The action parameter (\"encryption\" or \"decryption\") is required");
      System.exit(-1);
    }
    boolean encrypt = "encryption".equals(args[0]);
    SensitiveDataEncryption sensitiveDataEncryption = null;
    try {
      Injector injector = Guice.createInjector(new EncryptionHelperControllerModule(), new EncryptionHelperAuditModule(), new LdapModule());
      sensitiveDataEncryption = injector.getInstance(SensitiveDataEncryption.class);
      sensitiveDataEncryption.startPersistenceService();
      sensitiveDataEncryption.doEncryption(encrypt);
    } catch (Throwable e) {
      LOG.error("Exception occurred during config encryption/decryption:", e);
    } finally {
      if (sensitiveDataEncryption != null) {
        sensitiveDataEncryption.stopPersistenceService();
      }
    }
  }
Iterates thought all configs and encryption/decryption sensitive properties according to action
using the default configured masterkey
@param args "encryption" or "decryption" action expected
ambari-server/src/main/java/org/apache/ambari/server/security/encryption/SensitiveDataEncryption.java