textInputStream should be string or memBlock ?

When I read an encrypted text from a textfile… I’m reading with textinputstream… and then from there… I do a

string1 as string = trim(t.readAll)

Should I be reading into a string or a memory block ?

On Windows currently the way i’m doing it reading into a string is fine… but… on mac… i’m getting intermittent cryptoException errors… wondering if its the encoding that is the problem ?

String is fine. I would suspect the use of Trim here as the culprit.

I left the trim, because i needed it in case a user typed a space, or copied in a space accidentally. I kept things consistent in multiple methods with memory blocks instead of strings, and it seemed to work fine now on mac. I never had a problem on windows, but mac was obviously removing or adding some character as a result of encoding due to storing and retrieving a string in a text file.

[code]Dim t As TextOutputStream = TextOutputStream.Create(KeySecret)

      Dim secretKey as memoryBlock = trim(bittrexApiSecretField.text)
      //RSA encryption starts here
      dim encryptedDataSecret As MemoryBlock = crypto.RSAEncrypt(secretKey, DecodeBase64(pubKey))
      //RSA encryption end[/code]

So, while I’m no expert by any means, my suggestion for those who are storing data which needs to be stored and retrieved with accuracy down to the bit level, use memory block, as it fixed my problem. (on Mac)