Re: [fpc-pascal] Saving and reading TBlowfish crypted text

2015-03-18 Thread Ewald
On 17 Mar 2015, at 22:32, Graeme Geldenhuys wrote: > On 2015-03-17 18:49, Ewald wrote: >> The docs state that it is called automatically upon destruction: > > Correct, and I knew that. But I was explicitly looking at the code > Antonio supplied. > [...] > This is my interpretation of what is go

Re: [fpc-pascal] Saving and reading TBlowfish crypted text

2015-03-17 Thread Graeme Geldenhuys
On 2015-03-17 18:49, Ewald wrote: > The docs state that it is called automatically upon destruction: Correct, and I knew that. But I was explicitly looking at the code Antonio supplied. As I also mentioned, I normally use Read() and Write(), where he uses different methods. So looking at his code

Re: [fpc-pascal] Saving and reading TBlowfish crypted text

2015-03-17 Thread Ewald
On 17 Mar 2015, at 10:50, Graeme Geldenhuys wrote: > On 2015-03-16 20:05, Antonio Sanguigni wrote: >> en.WriteAnsiString(Memo1.Lines.Text); >> fs.WriteBuffer(Pointer(s1.DataString)^, length(s1.DataString)); >> en.Free; > > Maybe you decryption isn't working because the encrypted text you >

Re: [fpc-pascal] Saving and reading TBlowfish crypted text

2015-03-17 Thread Antonio Sanguigni
2015-03-17 10:50 GMT+01:00 Graeme Geldenhuys : > Maybe you decryption isn't working because the encrypted text you > created isn't complete. > > Normally you need to call Flush to write the remaining bytes before you > free the TBlowFishEncryptStream instance. That was the trick, Graeme. Thank yo

Re: [fpc-pascal] Saving and reading TBlowfish crypted text

2015-03-17 Thread Graeme Geldenhuys
On 2015-03-16 20:05, Antonio Sanguigni wrote: >en.WriteAnsiString(Memo1.Lines.Text); >fs.WriteBuffer(Pointer(s1.DataString)^, length(s1.DataString)); >en.Free; Maybe you decryption isn't working because the encrypted text you created isn't complete. Normally you need to call Flush to