Finally I didn't user mariadb function, but I created a single jar file with a main function that called the textEncryptor.encrypt() method on the input string passed to main.
So, when calling "java -jar myFile.jar myKey mySalt myInputString" I'm sure that the result string is exactly encrypted as I want to.
Ciao everybody !