[Ajuda] Encriptar Senhas
#1

Bom Utilizei Esse sistema de parar Encriptar senhas do meu Gm Mas Quando vo Logar a Minha Senha Nгo Vai e Diz que Estб Errado
Code:
forward Encrypt(string[]);
public Encrypt(string[])
{
	for(new x=0; x < strlen(string); x++)
	  {
		  string[x] += (3^x) * (x % 15);
		  if(string[x] > (0xff))
		  {
			  string[x] -= 256;
		  }
	  }
	return 1;
}
Meio que utilizo ele
Code:
Encrypt(tmppass)
Reply
#2

Coloxo a parte onde verifica a password.
Reply
#3

seria isso ?
Code:
		logouagora[playerid] = 1;
				CheckOwner(playerid);
				//CheckAdmin(playerid);
				CheckOwnerb(playerid);
				CheckOwnerh(playerid);
				//CheckVip(playerid);
			}//end while
			fclose(UserFile);//close the file after everything has been read in the while
		}
		else
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Senha errada! - Se errar a senha 5 vezes terб o IP Banido!");
			new loginstring[256];
			new loginname[64];
			GetPlayerName(playerid,loginname,sizeof(loginname));
			format(loginstring,sizeof(loginstring),"{FFFFFF}Bem Vindo(a): {FFFF00}%s\n\n{FFFFFF}Status da Conta: {00FF00}Registrada\n\n{FFFFFF}Digite sua Senha Para Logar!\n\n www.{00FF00}br-{FFFF00}vice{4876FF}city{FFFFFF}.Forumeiros.Com",loginname);
			ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD,"{FFFF00}Brasil Vice City",loginstring,"Logar","Sair");
			fclose(UserFile);
			gPlayerLogTries[playerid] += 1;
			if(gPlayerLogTries[playerid] == 5)
			{
				new stri[64], tmp[20], tmp3[20], ip[16];
				GetPlayerIp(playerid, ip, sizeof ip);
				format(stri, sizeof(stri), "IPsBanidos/%s.ini",ip);
				getdate(Ano, Mes, Dia);
				format(tmp, 20, "%d/%d/%d", Dia, Mes, Ano);
				gettime(Hora, Minuto, Segundo);
				format(tmp3, 20, "%d:%d:%d", Hora, Minuto, Segundo);
				format(stri, sizeof(stri), "IPsBanidos/%s.ini",ip);
				DOF2_CreateFile(stri);
				DOF2_SetString(stri,"Motivo","Errou a senha 5 vezes");
				DOF2_SetString(stri,"Admin","Chuck_Norris");
				DOF2_SetString(stri,"Data",tmp);
				DOF2_SetString(stri,"Hora",tmp3);
				DOF2_SetString(stri,"Nick",PlayerName(playerid));
			}
			return 1;
		}
Reply
#4

Recomendo que use isto: https://sampforum.blast.hk/showthread.php?tid=65290

para encriptar as senhas.
Reply
#5

O erro nгo й de essa funзгo, provavelmente o erro esta algures quando й feito o login, onde й usado o string compare para comprar a palavra passe com que o jogador faz login e a palavra passe real da conta.
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=65290
Nгo Intendi Muito Pode Me da Um Exemplo o Topico do Whirpool Me deixo meio confuso
Reply
#7

Vocк deve usar o hash para registrar e para logar!

Deixo um exemplo abaixo de lуgica.
pawn Code:
#include <a_samp>

#define LOGIN_OK 3
#define LOGIN_ERROR 2

native WP_Hash(buffer[], len, const str[]);


public OnPlayerLogin(playerid, password[]){
    new dest[129];
    WP_Hash(dest, sizeof(dest), password);

    if( condiзгo para verificar a senha! ){
        LoadDataForPlayer(playerid);
        return LOGIN_OK;
    } else {
        // Mostrar dialog novamente, errou a senha!
        return LOGIN_ERROR;
    }
    return 1;
}

public LoadDataForPlayer(playerid){
    // Carregar os dados.
    return 0;
}
Reply
#8

Muito Obrigado Consegui
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)