• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Feature SHA256 instead of SHA1

kor

PHP ziom
Premium User
Joined
Jul 12, 2008
Messages
252
Solutions
13
Reaction score
410
Location
Bialystok, Poland
GitHub
rookgaard
YouTube
Rookgaard
Hello. Users who have worked with TFS 0.X probably remember that it was supporting more password hasing methods (Fir3element/3777 (https://github.com/Fir3element/3777/blob/master/src/tools.cpp#L107)) than SHA1 which is the only method in TFS 1.X (otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/src/iologindata.cpp#L95)).

I would like to share implementation I've found in the past and then added to mine server, which may be not as good as it was in 0.4 (multiple hasing methods), but for sure increase data security.

The only things are needed to change is:
  • add sha256.cpp and sha256.h files to sources directory
  • modify CMakeLists.txt so it would add files to compilation process
  • change both occurrences of transformToSHA1 to sha256 in iologindata.cpp

All these changes and files are available on PR here - Replace sha1 with sha256 by rookgaard · Pull Request #2675 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/2675)

Of course changes will be needed also in AAC's, but in most cases it will be replacing sha1($something) with hash('sha256', $something).
 
Back
Top