go to post David Shambroom · Aug 28, 2017 You are UTF-8 encoding the binary ciphertext, which scrambles it, before Base64 encoding it: s ciphertext=$SYSTEM.Encryption.Base64Encode($ZCONVERT(enctext,"O","UTF8"),1) W !,"ciphertext: ",?12,ciphertext