Hi André,
The functions of the Cryptographic Module have been updated with the latest snapshot [1]: crypto:encrypt will now return an item of type xs:base64Binary. In addition, all data and key arguments can now be strings or binary items. Feel free to check out the latest snapshot [2].
Best, Christian
[1] http://docs.basex.org/wiki/Cryptographic_Module#crypto:decrypt [2] http://files.basex.org/releases/latest/
On Sun, Aug 11, 2019 at 9:57 AM Andre Bovy andre.bovy@gmail.com wrote:
Dear all,
I try to make the result of the encryption readable by converting the result either in Base64 or in Hex. Yet I am not able to convert it back to be able to decrypt.
Could you help me ?
André Bovy
let $encrypted := crypto:encrypt('message', 'symmetric','keykeyke','DES’) let $base64 := string(convert:string-to-base64($encrypted)) let $encrypted := convert:binary-to-string(xs:base64Binary($base64)) (: generates invalid characters :) return crypto:decrypt($encrypted, 'symmetric','keykeyke','DES')