Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Bob Sneidar via use-livecode
OIC. Well I am using the non-blocking method using with message. I don't read 
from until. All the data should come through then send the message. It may be 
that there is some kind of limit on the length of the data, but that would 
suck. Also it doesn't explain why when the client and the server are both 
running on the Mac, it works flawlessly. A socket is a socket. 

Bob S


> On Jul 1, 2022, at 18:23 , Phil Davis via use-livecode 
>  wrote:
> 
> I don't know about newer LC versions, but some older ones don't do "read from 
> socket  until EOF" correctly. Because of that, I added a data header 
> containing the length of the data in bytes. On the receiving end, something 
> like this happens:
> 
>   read from socket  for 1 line
>   put it into tLength
>   read from socket  for tLength
>   put it into tData
>   close socket 
> 
> I add error-checking of course.
> 
> HTH -
> Phil
> 
> 
> On 7/1/22 6:10 PM, Phil Davis via use-livecode wrote:
>> I was about to suggest that - you beat me to it. My client/server apps use 
>> base64 encode/decode as the final "envelope" for the data before network 
>> transfer. But I have LC on both ends of the transfer, and you may not. But 
>> ultimately it shouldn't matter.
>> 
>> Phil Davis
>> 
>> 
>> On 7/1/22 6:05 PM, Bob Sneidar via use-livecode wrote:
>>> Okay so I base64Encoded the encrypted string before sending over the wire, 
>>> and base64Decoded on the receiving end. Same thing coming back. I am still 
>>> getting the error. It's not a problem with sending data over the wire.
>>> 
>>> Bob S
>>> 
>>> 
 On Jul 1, 2022, at 17:55 , Bob Sneidar via use-livecode 
  wrote:
 
  That's supposed to be Binary Encoding
 
> On Jul 1, 2022, at 17:08 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Also when I was running it on my Mac, the client in the server we’re 
> running on the same Macintosh. On the windows machine however I’m going 
> over the wire. Should I buy Ineri encoded or something?
> 
> Sent from my iPhone
> 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your 
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> -- 
> Phil Davis
> (503) 307-4363
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Phil Davis via use-livecode
I don't know about newer LC versions, but some older ones don't do "read 
from socket  until EOF" correctly. Because of that, I added a 
data header containing the length of the data in bytes. On the receiving 
end, something like this happens:


   read from socket  for 1 line
   put it into tLength
   read from socket  for tLength
   put it into tData
   close socket 

I add error-checking of course.

HTH -
Phil


On 7/1/22 6:10 PM, Phil Davis via use-livecode wrote:
I was about to suggest that - you beat me to it. My client/server apps 
use base64 encode/decode as the final "envelope" for the data before 
network transfer. But I have LC on both ends of the transfer, and you 
may not. But ultimately it shouldn't matter.


Phil Davis


On 7/1/22 6:05 PM, Bob Sneidar via use-livecode wrote:
Okay so I base64Encoded the encrypted string before sending over the 
wire, and base64Decoded on the receiving end. Same thing coming back. 
I am still getting the error. It's not a problem with sending data 
over the wire.


Bob S


On Jul 1, 2022, at 17:55 , Bob Sneidar via use-livecode 
 wrote:


 That's supposed to be Binary Encoding

On Jul 1, 2022, at 17:08 , Bob Sneidar via use-livecode 
 wrote:


Also when I was running it on my Mac, the client in the server 
we’re running on the same Macintosh. On the windows machine however 
I’m going over the wire. Should I buy Ineri encoded or something?


Sent from my iPhone


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




--
Phil Davis
(503) 307-4363
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Bob Sneidar via use-livecode
I do. The server agent was written in LC and I am running it in a community 
version. Just to eliminate the possibility that things are different between 
Community 9.5 and Pro 9.6.8, I am DL'ing the latest (which I am running on the 
Mac). I'll try with that. 

Basically I encrypt and decrypt using aes256 and a key and salt value I store 
as constants in both the client and the server. I'm really stumped. This should 
work as advertised. 

Bob S


> On Jul 1, 2022, at 18:10 , Phil Davis via use-livecode 
>  wrote:
> 
> I was about to suggest that - you beat me to it. My client/server apps use 
> base64 encode/decode as the final "envelope" for the data before network 
> transfer. But I have LC on both ends of the transfer, and you may not. But 
> ultimately it shouldn't matter.
> 
> Phil Davis


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Phil Davis via use-livecode
I was about to suggest that - you beat me to it. My client/server apps 
use base64 encode/decode as the final "envelope" for the data before 
network transfer. But I have LC on both ends of the transfer, and you 
may not. But ultimately it shouldn't matter.


Phil Davis


On 7/1/22 6:05 PM, Bob Sneidar via use-livecode wrote:

Okay so I base64Encoded the encrypted string before sending over the wire, and 
base64Decoded on the receiving end. Same thing coming back. I am still getting 
the error. It's not a problem with sending data over the wire.

Bob S



On Jul 1, 2022, at 17:55 , Bob Sneidar via use-livecode 
 wrote:

 That's supposed to be Binary Encoding


On Jul 1, 2022, at 17:08 , Bob Sneidar via use-livecode 
 wrote:

Also when I was running it on my Mac, the client in the server we’re running on 
the same Macintosh. On the windows machine however I’m going over the wire. 
Should I buy Ineri encoded or something?

Sent from my iPhone


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


--
Phil Davis
(503) 307-4363


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Bob Sneidar via use-livecode
Okay so I base64Encoded the encrypted string before sending over the wire, and 
base64Decoded on the receiving end. Same thing coming back. I am still getting 
the error. It's not a problem with sending data over the wire. 

Bob S


> On Jul 1, 2022, at 17:55 , Bob Sneidar via use-livecode 
>  wrote:
> 
>  That's supposed to be Binary Encoding
> 
>> On Jul 1, 2022, at 17:08 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> Also when I was running it on my Mac, the client in the server we’re running 
>> on the same Macintosh. On the windows machine however I’m going over the 
>> wire. Should I buy Ineri encoded or something?
>> 
>> Sent from my iPhone
>> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Bob Sneidar via use-livecode
 That's supposed to be Binary Encoding

> On Jul 1, 2022, at 17:08 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Also when I was running it on my Mac, the client in the server we’re running 
> on the same Macintosh. On the windows machine however I’m going over the 
> wire. Should I buy Ineri encoded or something?
> 
> Sent from my iPhone
> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Bob Sneidar via use-livecode
Also when I was running it on my Mac, the client in the server we’re running on 
the same Macintosh. On the windows machine however I’m going over the wire. 
Should I buy Ineri encoded or something?

Sent from my iPhone

> On Jul 1, 2022, at 16:57, Bob Sneidar  wrote:
> 
> Hmmm... I think I see what is happening. I compared the encrypted string 
> from the server to the string from the client after it received it via the 
> socket connection. I am only getting the last part of the encrypted string! 
> 
> So it looks like the socket connections using with message is losing data 
> somehow. 
> 
> Bob S
> 
> 
>> On Jul 1, 2022, at 16:49 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> Hi all. 
>> 
>> As I may have mentioned I wrote an SQL Server agent that uses sockets to 
>> listen for data from a client. The client first arrayEncodes an array, then 
>> encrypts the result using an encryption library I wrote. Then it sends the 
>> data to the Server Agent. 
>> 
>> The Agent receives the encrypted stream, decrypts it using the exact same 
>> library, arrayDecodes the data, then performs a query against the database 
>> and retrieves th data as an array. All that works. 
>> 
>> The agent then arrayEncodes the array and re-encrypts it using THE SAME 
>> LIBRARY. It then sends the data back to the client which of course, decrypts 
>> it and arrayDecodes it producing the resultant array. All fine and good. But 
>> wait there's more! 
>> 
>> When I run the Server Agent on my Macintosh all works as expected. I get an 
>> array of the queried data. When I run it on a Windows desktop however, the 
>> data coming back is corrupted somehow! The decryption command produces an 
>> error: ERROR: (SSL error: wrong final block length)
>> 
>> How can that be? It's the same file I just copy it to the windows machine 
>> from the Mac along with the encryption library. Everything should be exactly 
>> the same! 
>> 
>> Bob S
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Bob Sneidar via use-livecode
Hmmm... I think I see what is happening. I compared the encrypted string from 
the server to the string from the client after it received it via the socket 
connection. I am only getting the last part of the encrypted string! 

So it looks like the socket connections using with message is losing data 
somehow. 

Bob S


> On Jul 1, 2022, at 16:49 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Hi all. 
> 
> As I may have mentioned I wrote an SQL Server agent that uses sockets to 
> listen for data from a client. The client first arrayEncodes an array, then 
> encrypts the result using an encryption library I wrote. Then it sends the 
> data to the Server Agent. 
> 
> The Agent receives the encrypted stream, decrypts it using the exact same 
> library, arrayDecodes the data, then performs a query against the database 
> and retrieves th data as an array. All that works. 
> 
> The agent then arrayEncodes the array and re-encrypts it using THE SAME 
> LIBRARY. It then sends the data back to the client which of course, decrypts 
> it and arrayDecodes it producing the resultant array. All fine and good. But 
> wait there's more! 
> 
> When I run the Server Agent on my Macintosh all works as expected. I get an 
> array of the queried data. When I run it on a Windows desktop however, the 
> data coming back is corrupted somehow! The decryption command produces an 
> error: ERROR: (SSL error: wrong final block length)
> 
> How can that be? It's the same file I just copy it to the windows machine 
> from the Mac along with the encryption library. Everything should be exactly 
> the same! 
> 
> Bob S
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Is LC encryption different for Mac than for Windows??

2022-07-01 Thread Bob Sneidar via use-livecode
Hi all. 

As I may have mentioned I wrote an SQL Server agent that uses sockets to listen 
for data from a client. The client first arrayEncodes an array, then encrypts 
the result using an encryption library I wrote. Then it sends the data to the 
Server Agent. 

The Agent receives the encrypted stream, decrypts it using the exact same 
library, arrayDecodes the data, then performs a query against the database and 
retrieves th data as an array. All that works. 

The agent then arrayEncodes the array and re-encrypts it using THE SAME 
LIBRARY. It then sends the data back to the client which of course, decrypts it 
and arrayDecodes it producing the resultant array. All fine and good. But wait 
there's more! 

When I run the Server Agent on my Macintosh all works as expected. I get an 
array of the queried data. When I run it on a Windows desktop however, the data 
coming back is corrupted somehow! The decryption command produces an error: 
ERROR: (SSL error: wrong final block length)

How can that be? It's the same file I just copy it to the windows machine from 
the Mac along with the encryption library. Everything should be exactly the 
same! 

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: sorting datagrids

2022-07-01 Thread Hershel F via use-livecode
this is more what i’m concerned. i’ll give it a shot and let you know. 
thanks.

> On Jun 30, 2022, at 7:26 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> 
> put the dgText of group "myDataGrid" into tText
> set the itemDelimiter to tab
> 
> repeat with i = 1 to the number of lines of tText
>   put item i of tText into tLine
>   sort items of tLine ascending
>   put tLine into line i of tText
> end repeat
> 
> set the dgText of group "myDataGrid" to tText

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode