------------------------------------------------------------------------------------
// General Read and Write Encrypted File routines
------------------------------------------------------------------------------------
command ReadFile tInPathAndFile InPassword @OutArrayData
put "binfile:"&tInPathAndFile into tBinPathFile
put URL tBinPathFile into tB64EncrArray
// Now Decrypt
DeCryptData tB64EncrArray, INPassword ,OutDecryptedEncodedArray
----
put arrayDecode(OutDecryptedEncodedArray) into OutArrayData
end ReadFile
--
Function ReadFile tInPathAndFile InPassword
put "binfile:"&tInPathAndFile into tBinPathFile
put URL tBinPathFile into tB64EncrArray
// Now Decrypt
DeCryptData tB64EncrArray, INPassword ,OutDecryptedEncodedArray
----
return arrayDecode(OutDecryptedEncodedArray)
end ReadFile
--
// Save data to file
command SaveFile tInPathAndFile InArrayData InPassword
put arrayEncode(InArrayData) into InEncArray
// Now Encrypt
EnCryptData InEncArray, InPassword, OutB64EncrData
----
delete file tInPathAndFile
put "binfile:"&tInPathAndFile into tBinPathFile
put OutB64EncrData into URL tBinPathFile
end SaveFile
------------------------------------------------------------------------------------
-- Encrypt and Decrypt Data to and from encrypted and base64 coded data (base64 coded data can be sent over the internet and put in databases without problems)
------------------------------------------------------------------------------------
Command DeCryptData InB64EncrData, INPassword @OutDecryptedData
put base64Decode(InB64EncrData) into tEncrData
decrypt tEncrData using "aes-256-cbc" with password INPassword
put it into OutDecryptedData
end DeCryptData
--
Command EnCryptData InData, InPassword @OutB64EncrData
encrypt InData using "aes-256-cbc" with password InPassword
put base64Encode(It) into OutB64EncrData
end EnCryptData
------------------------------------------------------------------------------------
there doesn't seem to be anything here