Dim ReadString As String
Dim EncryptedString As Object
Dim MyPhone As PhoneId
And...
EncryptedString = File.ReadString(File.DirRootExternal, "MyFolder/MyFile.txt")
ReadString = DecryptText(EncryptedString, MyPhone.GetDeviceId)
FileLoc = Regex.Split(CRLF, ReadString)
Msgbox(FileLoc(1), "The line of decoded array I need")
I'm getting an error "String cannot be cast to Byte". It seems like this should work. The error occurs for the decrypt line. I am saving the file using the reverse method (
File.WriteString(File.DirRootExternal, "MyFolder/MyFile.txt", EncryptedString)
I have tried so many different things and am completely stumped.
Sub DecryptText(EncryptedData() As Byte, password As String) As String
Dim c As B4XCipher
Dim b() As Byte = c.Decrypt(EncryptedData, password)
Return BytesToString(b, 0, b.Length, "utf8")
End Sub
Thanks! I actually was keeping up with that thread, that is why I asked for his code, since the error message would have made no sense with @Erel's code.
Thank you. This is finally working as it should. I was unaware my subs were different, but they were. This explains why I was having issues. All of you are great, thanks I can now complete this project.