Whatever you are doing is right. It is pub.string.base64Decode followed by pub.string:byteToString. Is that encoded base64 being decoded properly on https://www.base64decode.org/?
Please provide the example or string you have taken for decoding/encoding. Procedure you are trying is 100% correct.
May be you can pass the encoding type while encoding and decoding the string.
another option to check is PSUtilities-Package, which also contains a base64decode service.
This package can be downloaed from the download section of the SAG community.
Advantage over build in service is that you can test it in IS Admin UI or Designer directly instead of creating a wrapper to map the string to the object input.
Thank you for your quick response. There was some issue in the encoding from client side, which they corrected.
Is there a way to find the image size from the Base64 string?
Please help.