Hi,
I'm currently using PB2017R3 and attempting to utilize the new CrypterObject and CoderObject functionality.
I have a text file that contains encoded / encrypted information. I wish to open the file, read the file contents and decode/decrypt various data elements. I'm able to successfully open and read the contents of the file. For some data elements within the file, I need to decode and/or decrypt the current values. After performing a Base64Decode on a specific value (results in a Blob), I eventually end up with a value that appears to be a different character set than expected (extended ASCII?).
I currently do the following:
Integer li_File_Return
Long ll_File_Read_Return
String ls_Raw_IV_Value, ls_IV_Value
Blob lblb_Decoded_IV_Value
CoderObject lcode_CoderObject
lcode_CoderObject = CREATE CoderObject
li_File_Return = FileOpen(as_in_file, TextMode!, Read!, Shared!, Append!, EncodingANSI!)
ll_File_Read_Return = FileReadEx(li_File_Return, ls_In_File_Contents)
//The following variable contains a base64 encoded value
ls_Raw_IV_Value = "4efJzlmwEH73IEP/ljoKlA=="
lblb_Decoded_IV_Value = lcode_CoderObject.Base64Decode(ls_Raw_IV_Value)
ls_IV_Value = String(lblb_Decoded_IV_Value, EncodingANSI!)
//The ls_IV_Value is now populated with: áçÉÎY°~÷ Cÿ–:”
Looking to see how to get the resulting decode value be regular text. I had expected to see a 16-digit alphanumeric value representing an initialization vector that will later be used for AES/CBC decryption. Not sure what I'm doing wrong.
Thanks in advance for any guidance / suggestions.
Jason Schultz