开发者

sending dgram messages between big and little endien with blowfish

I have working code to send dgram messages between computers, but I'm trying to encrypt them with Blowfish. It works fine when I'm trying to send a message between two little endien machines, but when I try sending little endien to big (or the other way around), it doesn't decrypt correctly.

Question 1: Does sendto() convert my message to network byte ordering before sending it?

Question 2: Is this an iss开发者_如何学运维ue with decrypting my message or is it elsewhere?

Thanks


  1. No it doesn't.

  2. Your blowfish code is likely not handling endianness properly, this could be encryption, decryption, or both. Without code we can't say.


If you are encoding integer data in the messages sent through the socket, you should convert this to network byte order too. If you don't do this, your program may fail when running on or talking to other kinds of machines.

from GNU document. http://www.gnu.org/s/libc/manual/html_node/Byte-Order.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜