Ambience/Repertoire 202x supports encrypting sensitive data like passwords by using the prefix {enc:elx-2.0} in the configuration. Ambience/Repertoire 202x also supports user-pluggable encryption mechanisms.
You need to implement this Scala trait in your custom class if you want to use your own private key or custom mechanism:
// package com.elixirtech.arch
trait CryptSupplier {
def decrypt(s: String): Try[String]
}
And register your classes as follows in etc/application.conf of the Ambience/Repertoire Server installation (avoid using reserved elx prefix in any naming conventions):
elixir.crypt {
custom01 = “mypackage.MyCryptSupplier”
custom02 = “another.Supplier”
}
Based on the above, you can now use the following and they will be decoded by your custom CryptSupplier., e.g.:
- {enc:custom01}XXXX
- {enc:custom02}YYYYY
Note:
- You need to encrypt both XXXX and YYYY values yourself, the Ambience/Repertoire cli cannot be used to encrypt using the custom algorithms.
- The custom mechanism only works one way - the Ambience/Repertoire 202x instance only handles decrypt, not encrypt.