[Ajuda] Problema com Whrlpool.
#1

Olб.

Pessoal mudei o encriptaзгo do meu gamemode para Whirlpool.

Estou tentando adaptar mas nгo estou conseguindo, Apуs eu se registrar e verificar dentro do jogador a senha fica como NULL.

Nгo sei o motivo, agradeзo desde jб!

Criaзгo de contas
pawn Код:
format(String,sizeof(String),"InfoJogadores/Contas/%s.ini",Nome_Conta(playerid));

        DOF2_CreateFile(String);

        WP_Hash(INFO_P[playerid][SENHA_P], 129, password);

        DOF2_SetString(String,"Senha",INFO_P[playerid][SENHA_P]);
        DOF2_SetInt(String,"Tutorial",INFO_P[playerid][TUTO_P]);
        DOF2_SetInt(String,"Skin",INFO_P[playerid][SKIN_P]);
Logar contas
pawn Код:
new Hash[129];
    WP_Hash(Hash, 129, password);
    if(strcmp(Hash, INFO_P[playerid][SENHA_P]) == 0)
    {
        LimparChatBox(playerid, 100);

        INFO_P[playerid][TUTO_P] = DOF2_GetInt(String, "Tutorial");
        INFO_P[playerid][SKIN_P] = DOF2_GetInt(String, "Skin");

Salvar contas

pawn Код:
format(String,sizeof(String),"InfoJogadores/Contas/%s.ini",Nome_Conta(playerid));
    if(DOF2_FileExists(String))
    {
        if(JogadorLogado[playerid] == true)
        {
            DOF2_SetString(String,"Senha", INFO_P[playerid][SENHA_P]);
            DOF2_SetInt(String,"Tutorial",INFO_P[playerid][TUTO_P]);
            DOF2_SetInt(String,"Skin",INFO_P[playerid][SKIN_P]);
Reply
#2

Cara eu tava com esse problema ae eu tive que alterar a include DOF2, fico assim:

Код:
// The maximum length of a line (including key and value).
#if !defined MAX_LINE_SIZE
	#define MAX_LINE_SIZE       (150)
#endif
Reply
#3

Quote:
Originally Posted by SaDaN
Посмотреть сообщение
Cara eu tava com esse problema ae eu tive que alterar a include DOF2, fico assim:

Код:
// The maximum length of a line (including key and value).
#if !defined MAX_LINE_SIZE
	#define MAX_LINE_SIZE       (150)
#endif
Obrigado, esse era o problema. Percebe-se que o MAX_LINE_SIZE de DOF2 era de (12 e o Whrlpool й de +129.
Reply
#4

Quote:
Originally Posted by SaDaN
Посмотреть сообщение
Cara eu tava com esse problema ae eu tive que alterar a include DOF2, fico assim:

Код:
// The maximum length of a line (including key and value).
#if !defined MAX_LINE_SIZE
	#define MAX_LINE_SIZE       (150)
#endif
Poderia o seu Login, Registrar e logar?

Cara meu sistema de salvamento ta dando conflito e a senha dгo como NULL.
Reply
#5

Pelo cуdigo que vocк postou aqui nгo tem DOF2_SaveFile(); pode ser isso tenta por no final do dialogo de registro.
Reply
#6

Quote:
Originally Posted by SaDaN
Посмотреть сообщение
Pelo cуdigo que vocк postou aqui nгo tem DOF2_SaveFile(); pode ser isso tenta por no final do dialogo de registro.
Tem sim cara, Nгo sei o problema.

Estou atй desistindo.
Reply
#7

Tenta substituir
Код:
WP_Hash(INFO_P[playerid][SENHA_P], 129, password);
Por
Код:
WP_Hash(INFO_P[playerid][SENHA_P], 150, password);
Reply
#8

Desnecessбrio usar isso visto que o samp agora tem um nativo.
Reply
#9

Quote:
Originally Posted by PT
Посмотреть сообщение
Desnecessбrio usar isso visto que o samp agora tem um nativo.
Qual? poderia me dizer.
Reply
#10

Quote:
Originally Posted by Petrick™
Посмотреть сообщение
Qual? poderia me dizer.
A SA-MP API adquiriu esta nova funзгo padrгo para hashing :



https://sampwiki.blast.hk/wiki/SHA256_PassHash



Se comparar apenas os algoritmos Whirlpool e SHA-256, o primeiro tem a vantagem em seguranзa por trabalhar com um tamanho de hash de 512 bits, enquanto o segundo trabalha com somente 256 bits. Por outro lado, a funзгo SHA256_PassHash permite por padrгo o uso de salts, sendo superior а funзгo WP_Hash na proteзгo contra ataques por tabelas de hashes.



Espero ter ajudado .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)