private String encryptAndDecoratePropertyValue(String propertyValue) {
    final String encrypted = encryptionService.encrypt(propertyValue, TextEncoding.BIN_HEX);
    return String.format(Encryptor.ENCRYPTED_PROPERTY_SCHEME, encrypted);
  }
A common base class for various encryptor implementations
ambari-server/src/main/java/org/apache/ambari/server/security/encryption/PropertiesEncryptor.java