SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
CUIDANDO
BEM DAS
SENHAS
SENHA É UMA FORMA DE
GARANTIR QUE O USUÁRIO É
QUEM DIZ QUE É, MEDIANTE A
ALGO QUE ELE SABE.
A política de senha é um conjunto de regras
destinadas a aumentar a segurança de computadores,
"forçando" os usuários a utilizarem senhas fortes e
usá-las corretamente.
ELAS INCLUEM:
Uso de caracteres especiais ($#!%...) na composição
da senha
Senhas extensas
Troca da senha a cada x período
A MAIORIA
DELAS SÃO
INEFICAZES!
O QUE
FAZER?
NUM MUNDO IDEAL?
TAMANHO MINIMO
if (mb_strlen($senha) < 10) {
throw new Exception("Escolha uma senha com mais de 10 digitos")
}
NÃO FAÇA VALIDAÇÃO DE
SENHA SOMENTE NO CLIENTE
O cliente pode desligar o javascript, ou utilizar outros
meios para tentar acessar seu login
PROTEJA-SE CONTRA CSRF
(CROSS-SITE REQUEST
FORGERY)
)
https://www.owasp.org/index.php/Cross-
Site_Request_Forgery_(CSRF
GUARDE TENTATIVAS DE LOGIN
NO BANCO DE DADOS
Quando atingir um certo número de tentativas, joga
um captcha, bloqueie o acesso por x tempo...
USE UMA LISTA DE SENHAS
"FRACAS"
http://weakpass.com/
USE A BIBLIOTECA DE SENHAS!
$hash = password_hash($senha, PASSWORD_BCRYPT);
// $hash = $2y$10$NEbyGmm00VREYhxGUnas3.vvmfGEQh5kXzxb3RP4FFQZr2xW
VERIFICAR A SENHA!
if (password_verify($senha, $hash)) {
echo "senha correta";
}
CUSTO!
$hash = password_hash($senha, PASSWORD_BCRYPT, [
'cost' => 12 // Valor padrão é 10
]);
VERIFICAR SE NECESSÁRIO FAZER HASH
NOVAMENTE
if (password_verify($senha, $hash)) { // Verifica a senha
if (password_needs_rehash($hash, PASSWORD_BCRYPT, ['cost' => 14]
$novo_hash = password_hash($senha, PASSWORD_BCRYPT, ['cost' =>
}
}
USE AUTENTICAÇÃO EM DUAS
ETAPAS
Você pode mandar um email para o cliente, sms ou
telefone.
(Authy)
http://www.totalvoice.com.br/autenticacao-em-2-
fatores/
https://www.twilio.com
Gerenciadores de senhas:
PHP
Imagens:
https://www.dashlane.com/
https://1password.com/
https://lastpass.com/
http://keepass.info/
http://php.net/manual/en/function.mb-strlen.php
http://php.net/manual/en/book.password.php
https://xkcd.com/936/
https://www. ickr.com/photos/formalfallacy/205716
OBRIGADO
Telegram: @vanildo_souto
Email: vanildo.toneladas@gmail.com
Blog: http://blog.toneladas.com.br

Mais conteúdo relacionado

Último

Assessement Boas Praticas em Kubernetes.pdf
Assessement Boas Praticas em Kubernetes.pdfAssessement Boas Praticas em Kubernetes.pdf
Assessement Boas Praticas em Kubernetes.pdf
Natalia Granato
 

Último (6)

Assessement Boas Praticas em Kubernetes.pdf
Assessement Boas Praticas em Kubernetes.pdfAssessement Boas Praticas em Kubernetes.pdf
Assessement Boas Praticas em Kubernetes.pdf
 
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docxATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
 
Boas práticas de programação com Object Calisthenics
Boas práticas de programação com Object CalisthenicsBoas práticas de programação com Object Calisthenics
Boas práticas de programação com Object Calisthenics
 
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docxATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
 
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docxATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
 
Padrões de Projeto: Proxy e Command com exemplo
Padrões de Projeto: Proxy e Command com exemploPadrões de Projeto: Proxy e Command com exemplo
Padrões de Projeto: Proxy e Command com exemplo
 

Destaque

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Destaque (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Cuidando bem das senhas