1
I’m having a question here, I ran some tests on the local server, and I was wondering if anyone has done anything like this, and if the database supports that many characters.
The idea of merging various types of encryption, is to increase the security level of the site, if it is possible to use in this way.
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Gerador de senhas</title>
</head>
<body>
<!-- o objetivo desse estudo é fazer um script de senhas criptografadas com autenticação-->
<?php
$a = 'umasenhaBemforteparaserqueBrada135';//senha do usuario
//esse foi outro teste, só que deixa com muitos caracteres ->$cripto = md5($string).sha1($string).md5($string).base64_encode($string).sha1($string).base64_encode($string);
$senhacodificada = sha1(md5($a).sha1(md5($a)).md5(sha1($a).base64_encode($a)).base64_encode($a)).md5(base64_encode($a).sha1(md5($a).base64_encode(sha1($a)))).base64_encode(sha1(md5($a)));
//echo $senhacodificada;
if(isset($_POST['acao'])){
if($_POST['senha'] !='' ){
$c = $_POST['senha'];
$compara = sha1(md5($c).sha1(md5($c)).md5(sha1($c).base64_encode($c)).base64_encode($c)).md5(base64_encode($c).sha1(md5($c).base64_encode(sha1($c)))).base64_encode(sha1(md5($c)));
if($compara == $senhacodificada){
echo '<br>';
echo 'senha igual';
echo '<hr>';
echo $compara;
}else{
echo '<hr>';
echo 'a senha é diferente';
}
}else{
echo 'campos vazios nao sao permitidos';
}
}
?>
<form method="post">
<input type="text" name="senha">
<input type="submit" name="acao" value="logar">
</form>
</body>
</html>
Leandro no one takes downvote, because of duplicate signage.
– Maury Developer
I recommend counting the characters and confirm that the amount is within the limits of VARCHAR, TEXT or SMALLTEXT fields in sql. Remember that password size does not guarantee security since your code may be flawed and allow INJECTIONS. Anyway, this is up to you already! good luck!
– Renan Perillo
Oops, blah, I’ll count the characters and check the boundaries. Sql to with script protected and with checks on all site url, the question was even whether this encryption method is used. Thank you
– Leandro