Oko hashanja passworda

Započeo LoOdaK, Mart 31, 2020, 07:55:23 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Problem(error/warning): Uhvatila me neka nostalgija i želio sam prebaciti svoj stari mod iz INI-a u MySql. Prvi put radim sa mysql pa se snalazim nekako ali imam jedan problem oko hashanja passworda.
Uradio sam registraciju sa SHA256 hashom i sve se lijepo sprema u bazu i salt i pass, međutim kada se želim logovati ne daje mi isti hash. Gledao sam po samp forumu i ne razumijem u čemu je problem.
Dio skripte: Evo provjera logina za početak, ako bude još šta trebalo napišite
[pawn]new hash[65], name[MAX_PLAYER_NAME], query[70];
           SHA256_PassHash(inputtext, PlayerInfo[playerid][pSalt], hash, 65);

         printf("Salt pri loginu je: %s", PlayerInfo[playerid][pSalt]);
         printf("Password pri loginu je: %s", PlayerInfo[playerid][pPass]);
         printf("Uneseni password/salt hash je: %s", hash);

           if(strcmp(hash, PlayerInfo[playerid][pPass]) == 0)
           {


            GetPlayerName(playerid, name, sizeof(name));

               mysql_format(handle, query, sizeof(query), "SELECT * FROM igraci WHERE ime = '%e' LIMIT 1", name);
               mysql_tquery(handle, query, "OnAccountLoad", "i", playerid);
         }
         else
         {
             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Prijava", "Pogresna lozinka. Unesite lozinku ponovo:", "Login", "Izlaz");
         }
      }[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): Evo debug salta i ostalog Salt pri loginu je: 25c{2QQ|y?
Password pri loginu je: B62C014E4CB29192B5B07272D6913C2E1F8D4B92250692F8C2F70D27D497B579
Uneseni password/salt hash je: ED181BB21026CA594B770378C85A534C3E66EA2F6DE529CB41F3F4B53BD6354E

Slika/video ingame problema(obavezno ako je ingame problem): //
Poslednja Izmena: Mart 31, 2020, 07:58:29 PRE PODNE od LoOdaK
CitatElectric Power is everywhere present in unlimited quantities and can drive the world's machinery without the need of coal, oil, gas, or any other of the common fuels!



RIJEŠENO. LOCK!
CitatElectric Power is everywhere present in unlimited quantities and can drive the world's machinery without the need of coal, oil, gas, or any other of the common fuels!