Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

In this guide, we will implement improvements to the password security measures in your server's database system. By integrating SHA-256 encryption, we’ll fortify user accounts against unauthorized access. Follow these detailed steps to ensure your code is secure and efficient.

Step-by-Step Changes in db.cpp

  1. Open the file db.cpp located in the source_server/game/ directory. Look for this line:

     
  • This is the hidden content, please

     

  • Add the following includes directly below it:

     
  • This is the hidden content, please

     

  • Next, search for the function declaration:

     
  • This is the hidden content, please

     

  • Inside this function, locate the block that handles the login case:

     
  • This is the hidden content, please

     

  • Replace the entire block with the following enhanced code:

     
  1. This is the hidden content, please

     

Modifications in the Database

  1. Open your database management tool (like Navicat), and navigate to the account table.

  2. Choose the design view for the table. Find the password field and change its data type from VARCHAR(45) to VARCHAR(64).

Important Notes

  • New Password Hashing Algorithm: SHA-256
  • Hash Length: 64 characters
  • Example PHP Code: $hash = hash('sha256', "text");

 

By following the modifications outlined in this document, you'll significantly enhance the password security for user accounts in your system. Implementing SHA-256 hashing protects against unauthorized access, ensuring the integrity and safety of your users' data.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...