i need help about Xor checksum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akahhor
    New Member
    • Oct 2008
    • 2

    i need help about Xor checksum

    Hi
    i have problem
    i make byte message in c# and send with sokect to server.
    but server abort connection, this message.
    `SC`00541.00TJ1 23456PPC 00000000DLGLGN 00000001TXBEG
    Login:user=a, pswd=a 9afb81c7
    "9afb81c7" this checksum of this message.
    how to create checksum.
    this 8 bytes, which is negative value of the result of an exclusive or
    operation of message in 32-digit format.
    can you help how to create this check sum.
    thank you...
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Read the documentation of the protocol you are using, it will tell you how the checksum is created.

    In general an xor checksum is done in unsigned arithmatic, you have 4 bytes not 8 (8 digits = 4 bytes) so it will be something along the lines of treating the buffer as an array of 32 bit unsigned integers and xoring them all together. Of course the protocol must be assuming something if the packet is not a multiple of 4 bytes in length (probably either pad with 0x00 or pad with 0xFF for the purposes of calculating the checksum).

    It then becomes important that you make sure you match the endianess of the protocol (probably big endian over an IP protocol) or you will calculate the value incorrectly (or at least with the bytes reversed).

    Comment

    • akahhor
      New Member
      • Oct 2008
      • 2

      #3
      http://www.epay.tj/img/MML-Packets.jpg
      this detail info howto create checksum
      we ask server about info they do not give any other info.

      Comment

      Working...