Dave C
03-04-2014, 02:33 PM
Part of my setup has the user entering information for an email server. For obvious reasons I'd rather not save their password in plaintext, but have no real need for strong encryption. Base64 encoding does the job and SB conveniently has functions to handle it. However, they don't seem to work as well as I'd hoped.
Example 1: http://i.imgur.com/gr3za0G.png
Encoding a string (%EMAILPASSWORD%, "pass") into another string (%TMPINI%, initialized to "") results in the correct encoded string ("cGFzcw=="), but with "=%EMAILUSERNAME%" added onto the end of it, which gets parsed and converted to "=dave" when saved in the INI file.
Example 2: http://i.imgur.com/M6NdB4I.png
Decoding a string (%EMAILPASSCRYPT%, "cGFzcw==") into another string (%EMAILPASSWORD%, initialized to "") results in the correct decoded string ("pass") but overlaid on the original encoded string, leaving the excess encoded characters ("cw==").
In another test, which I don't have a screenshot of, the result string was placed over an unrelated variable in a similar manner to example 2. Any ideas as to what could be causing this behavior? Is there a proper way to handle these functions that I'm missing or some sort of workaround?
Thanks,
Dave
Example 1: http://i.imgur.com/gr3za0G.png
Encoding a string (%EMAILPASSWORD%, "pass") into another string (%TMPINI%, initialized to "") results in the correct encoded string ("cGFzcw=="), but with "=%EMAILUSERNAME%" added onto the end of it, which gets parsed and converted to "=dave" when saved in the INI file.
Example 2: http://i.imgur.com/M6NdB4I.png
Decoding a string (%EMAILPASSCRYPT%, "cGFzcw==") into another string (%EMAILPASSWORD%, initialized to "") results in the correct decoded string ("pass") but overlaid on the original encoded string, leaving the excess encoded characters ("cw==").
In another test, which I don't have a screenshot of, the result string was placed over an unrelated variable in a similar manner to example 2. Any ideas as to what could be causing this behavior? Is there a proper way to handle these functions that I'm missing or some sort of workaround?
Thanks,
Dave