BNLS Checksum Algorithm

The BNLS checksum algorithm calculates the checksum of a password using the 32-bit server code received in 0x0E BNLS_AUTHORIZE.

You should create the BNLS checksum as follows:

  1. Create an ANSI string whose length is the length of the password + 8 characters.
  2. Copy the password to the beginning. (Note that the password is case sensitive.)
  3. In the last 8 characters, store the hexadecimal representation of the server code, in uppercase, padded with zeroes on the left.
  4. Calculate the standard CRC-32 checksum (using the standard polynomial 0xEDB88320) of the string.

The result is the BNLS checksum, to be sent in BNLS_AUTHORIZEPROOF (0x0f).

Source code for this procedure is available in VB6, C++, C#, and RB, provided by Sixen and Caaaaarrrrlll.

In the sample code, the checksum for BNLS_AUTHORIZEPROOF (0x0f) is the return value of BNLSChecksum(AuthPassword, ServerCode), where ServerCode is the value from BNLS_AUTHORIZE (0x0e).

These sample checksums can be used to check the correctness of your code:

BNLSChecksum("Sample", 0x0123ABCD)    == 0x12FDED88
BNLSChecksum("Checksums", 0xBAADF00D) == 0x0098F911
| Edited: Sixen

Comments

Kyro

Suggestion: in the future, move any referenced data to BNETDocs. This way we don't have to worry about broken links. Make sure to place the referenced data in a text file and pop it in the archives directory. For example, look at this:

http://www.bnetdocs.org/?op=doc&did=12

You can see DevCode and HDX's code was stored on BNETDocs and archived for reference purposes-- no worrying about broken links. =)

So-- yea, move the realbasic code from pastebin to a locally stored file in archives and update links.

Caaaaarrrrlll

I have the pastebin links I post set to never expire, and they're tied to my pastebin account.

I can, at my own will, edit or delete them, without having to make a new pastebin link.

Plus pastebin provides a neat syntax highlighting for 100s of languages :)

Kyro

Make backups of the files then and pop the backup in bnetdocs archives. Would suck if pastebin went down and your precious code went buh-bye, now wouldn't it? ;)

Caaaaarrrrlll

I have my precious code on my hard drive in REALbasic project files. If pastebin goes down, I can just re-upload it. I never delete good code.

Caaaaarrrrlll

I have added the sample code as attachments to this document.