- Joined
- Jul 18, 2011
- Messages
- 23
- Reaction score
- 14
Hey Guys,
i don't liked the saved "plain-passwords" at the Database so i make some changes for a SHA512 Encryption.
1. Open the "TeraAPI\grails-4.0.3\TeraAPI\grails-app\controllers\com\tera\AccountController.groovy"
2. Find
Replace it with
3. Save the changes at AccountController.groovy File and then Delete TeraAPI\grails-4.0.3\TeraAPI the "build" Folder
4. Run your .bat file which includet "grailsw.bat run-app --port=8080" and the changes will be compiled.
5. Open "xampp\htdocs\81\reg\index_act.php" and find
Replace it
6. Open "xampp\htdocs\81\reg\config.php" and add
Feel free to give me any Feedback
i don't liked the saved "plain-passwords" at the Database so i make some changes for a SHA512 Encryption.
1. Open the "TeraAPI\grails-4.0.3\TeraAPI\grails-app\controllers\com\tera\AccountController.groovy"
2. Find
Code:
def accountInfo = accountList.get(0)
if (params.password != accountInfo.getAt('passWord')) {
Replace it with
Code:
def secret_salt = 'YOUR-SALT'
def pass_plain = params.password
def pwd_salt = secret_salt + pass_plain
def pass_sha512 = pwd_salt.digest('SHA-512')
def accountInfo = accountList.get(0)
if (pass_sha512 != accountInfo.getAt('passWord')) {
3. Save the changes at AccountController.groovy File and then Delete TeraAPI\grails-4.0.3\TeraAPI the "build" Folder
4. Run your .bat file which includet "grailsw.bat run-app --port=8080" and the changes will be compiled.
5. Open "xampp\htdocs\81\reg\index_act.php" and find
PHP:
$query="insert into AccountInfo (userName, passWord) values ('$id','$pass1')";
Replace it
PHP:
$pwdhash = hash('sha512',$secret_salt . $pass1);
$query="insert into AccountInfo (userName, passWord) values ('$id','$pwdhash')";
PHP:
$secret_salt = "YOUR-SALT";
Feel free to give me any Feedback
Last edited: