Jump to content

stream_socket_recvfrom problem


kjm

Recommended Posts

I've been using stream_socket-recvfrom to receive short plain text ascii packets from some internet enabled remote devices. So the letter I for example arrives as a 49 which is the ascii code for same & the socket puts out an I.

However when I set the remotes into AES encrypted mode they not only encrypt but they switch to sending in hex instead of ascii. So after the I has been encrypted it might arrive as a C4.

This is a real problem because the socket listener puts out strange characters (like Ä for C4 or ‰ for 89). If the characters are printable I can use an ascii to hex converter after the socket listener to get the original hex back but many ascii representations of hex values just won't convert back to the original hex.

So to successfully use mycrypt or similar to decode the encrypted packets I need a socket listener that can handle hexadecimal strings.

Seems simple enough but I'm stumped on how to do it. Any ideas from you learned practitioners of the art?

Link to comment
https://forums.phpfreaks.com/topic/161465-stream_socket_recvfrom-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.