{"componentChunkName":"component---src-templates-tag-js","path":"/tags/password/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":2,"edges":[{"node":{"fields":{"slug":"/engineering/password-security-best-practices-compliance/"},"html":"<p>Application Security is one of the primary concerns for a software developer. People trust your application and share sensitive or personal information. As a software developer, you need to take care of your application user information security. Authentication and authorization both play critical roles in application security. They confirm the identity of the user and grant access to your website or application.</p>\n<p>The process in which confirm the user's identity and provides access to sensitive information is called authentication. Generally, authentication is done through the email/username/password. Authentication using the password is the older and common way, so passwords are a critical component of user's identity security. Password policy is the front line of defense to protect user identity. However, weak passwords may violate compliance standards. A simple or common password could be reversed engineered back to plaintext and sold on the dark web, or result in a costly data breach if compromised.</p>\n<h3 id=\"why-we-needed-password-policy--compliance\" style=\"position:relative;\"><a href=\"#why-we-needed-password-policy--compliance\" aria-label=\"why we needed password policy  compliance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why We needed Password Policy &#x26; Compliance</h3>\n<p>Password policies and compliance are rules and methods that enforce the user for using a secure and robust password. A billion credentials were stolen last year from multiple data breaches. According to <a href=\"https://enterprise.verizon.com/resources/reports/2017_dbir.pdf\">Verizon's Data Breach Report</a>, 81% of data breaches are caused by compromised, weak, and reused passwords. According to <a href=\"https://www.bbc.com/news/technology-47974583\">National Cyber Security Centre (NCSC)</a> recent analysis, millions of peoples are using easy to guess passwords like <code>123456</code>. Recently a security researcher <a href=\"https://techcrunch.com/2020/10/22/dutch-hacker-trump-twitter-account-password/\">claimed</a> he hacked President Trump's tweeter account by guessing his password <code>maga2020!</code> so now we can understand the need for Password Policy &#x26; Compliance. You can check the top worst passwords list <a href=\"https://www.loginradius.com/blog/identity/worst-passwords-list-2019/\">here</a>.</p>\n<h4 id=\"1-minimum-password-age-policy\" style=\"position:relative;\"><a href=\"#1-minimum-password-age-policy\" aria-label=\"1 minimum password age policy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Minimum Password Age policy</h4>\n<p>The Minimum password age policy is to decide how many days minimum users must keep a password before changing it. This password policy.</p>\n<h4 id=\"2-enforce-password-history-policy\" style=\"position:relative;\"><a href=\"#2-enforce-password-history-policy\" aria-label=\"2 enforce password history policy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Enforce Password History policy</h4>\n<p>The \"Enforce password history\" policy is used to make sure the number of unique passwords a user must set before reusing an old password. This is an important policy because password reuse is a common issue – the user feels more comfortable with the old passwords. Using the same password for a long duration for a particular account, it will create a strong chance for the password compromised in some way, such as in a brute force attack. Password age policy shouldn't be efficient until the password history policy. Users must change their password, but they can reuse an old password; the effectiveness of a password age policy is greatly reduced.</p>\n<h4 id=\"3-minimum-password-length-policy\" style=\"position:relative;\"><a href=\"#3-minimum-password-length-policy\" aria-label=\"3 minimum password length policy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Minimum Password Length policy</h4>\n<p>The Minimum Password Length policy decides the minimum number of characters needed to create a password. Minimum Password Length should be at least eight characters or more. Longer passwords are generally more secure and harder to crack than short ones. For even greater security, you could set the minimum password length to 14 characters.</p>\n<h4 id=\"4-passwords-must-meet-complexity-requirements-policy\" style=\"position:relative;\"><a href=\"#4-passwords-must-meet-complexity-requirements-policy\" aria-label=\"4 passwords must meet complexity requirements policy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. Passwords Must Meet Complexity Requirements policy</h4>\n<p>The Passwords Complexity Requirements policy make sure user shouldn't use basic passwords. Passwords should be a combination of uppercase, lowercase, and numbers also include some special characters. We can set the following policies in the password Complexity Requirements.</p>\n<ul>\n<li>The Passwords shouldn’t contain the user name or name and basic profile fields, such as their first name.</li>\n<li>\n<p>The Password must use following characters combinations </p>\n<ul>\n<li>Uppercase letters </li>\n<li>Lowercase letters </li>\n<li>Non-alphanumeric characters </li>\n<li>(special characters): (~!@#$%^&#x26;*_-+=`|(){}[]:;\"'&#x3C;>,.?/) </li>\n<li>Numberaic characters</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"5-common-password-protection\" style=\"position:relative;\"><a href=\"#5-common-password-protection\" aria-label=\"5 common password protection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>5. Common Password Protection</h4>\n<p>The users shouldn't use the common passwords, so Restrict the use of common passwords. You can refer to this <a href=\"https://www.loginradius.com/docs/authentication/concepts/common-password/\">document</a> for a common password list maintained by LoginRadius and this list is dynamic, and it gets updated from time to time.</p>\n<h4 id=\"6-dictionary-password-prevention\" style=\"position:relative;\"><a href=\"#6-dictionary-password-prevention\" aria-label=\"6 dictionary password prevention permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>6. Dictionary Password Prevention</h4>\n<p>A Password dictionary is a file that contains a list of potential passwords. This feature prevents your user's from setting a password available in the dynamic password dictionary. We are using this dynamic <a href=\"https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt\">Password Dictionary</a> in the LoginRadius to prevent the use of dictionary passwords.</p>\n<h4 id=\"7-password-audit-policy\" style=\"position:relative;\"><a href=\"#7-password-audit-policy\" aria-label=\"7 password audit policy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>7. Password Audit policy</h4>\n<p>Enabling the Password Audit policy allows you to track all password changes. By monitoring the modifications that are made, it is easier to track potential security problems. This helps to ensure user accountability and provides evidence in the event of a security breach.</p>\n<h4 id=\"password-compliance\" style=\"position:relative;\"><a href=\"#password-compliance\" aria-label=\"password compliance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Password Compliance</h4>\n<p>Password compliance is a set of rules to enhance user's data security by encouraging users to use strong passwords and use them properly.</p>\n<h4 id=\"1-fda-us-food-and-drug-administration\" style=\"position:relative;\"><a href=\"#1-fda-us-food-and-drug-administration\" aria-label=\"1 fda us food and drug administration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. FDA (U.S. Food and Drug Administration)</h4>\n<p>The FDA regulates the set of rules for the food, drugs, biologics, medical devices, electronic products, cosmetics, veterinary products, and tobacco products Industries.</p>\n<p>Passwords for FDA Industry Systems accounts must meet ALL of the following requirements:</p>\n<ul>\n<li>It should be at least 8, but no more than 32 characters.</li>\n<li>It should contain one UPPERCASE letter.</li>\n<li>It should contain one lowercase letter.</li>\n<li>It should contain at least one special character: ~ ! @ # $ % ^ * ( ) _ - + = { } [ ] | : ; \" , ?. Do not use &#x3C;> &#x26; or '.</li>\n<li>It should contain one number digit (numbers).</li>\n</ul>\n<h4 id=\"2-hipaa-health-insurance-portability-and-accountability-act\" style=\"position:relative;\"><a href=\"#2-hipaa-health-insurance-portability-and-accountability-act\" aria-label=\"2 hipaa health insurance portability and accountability act permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. HIPAA (Health Insurance Portability and Accountability Act)</h4>\n<p>The Health Insurance Portability and Accountability Act (HIPAA) enforce a set of rules for sensitive patient data protection. Companies that deal with protected health information (PHI) must ensure HIPAA compliance.</p>\n<ul>\n<li>It should contain both upper and lower case characters (e.g., a-z, A-Z);</li>\n<li>It should contain digits (numbers) and other non-letter characters such as <code>!@#$%^&#x26;*()_+|~-=\\'{}[]:\";&#x3C;>?,./</code>;</li>\n<li>It should be at least 8 characters long;</li>\n<li>It should not be a word in any language, slang, dialect, jargon, etc.; and</li>\n<li>It should not be easily ascertained from the research of publicly available information, such as names of family members, school names, addresses, etc.</li>\n</ul>\n<h4 id=\"3-pci-dss-payment-card-industry-data-security-standard\" style=\"position:relative;\"><a href=\"#3-pci-dss-payment-card-industry-data-security-standard\" aria-label=\"3 pci dss payment card industry data security standard permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. PCI DSS (Payment Card Industry Data Security Standard)</h4>\n<p>PCI is the set of rules or guidelines for the businesses that are dealing with payment card data.</p>\n<ul>\n<li>It should be at least eight characters long.</li>\n<li>It should contain both numeric and alphabetic characters.</li>\n<li>Users should change passwords once every 90 days.</li>\n<li>used to make the sure number of unique passwords a user must set before reusing an old password Password parameter are set to require that new passwords cannot be the same as the four previously used passwords.</li>\n<li>First-time passwords for new users and reset passwords for existing users are set to a unique value for each user and changed after first use</li>\n<li>User accounts are temporarily locked-out after not more than six invalid access attempts.</li>\n<li>Once a user account is locked out, it remains locked for a minimum of 30 minutes or until a system administrator resets the account.</li>\n<li>System/session idle time out features have been set to 15 minutes or less.* Passwords are protected with strong cryptography during transmission and storage.</li>\n</ul>\n<h4 id=\"4-nist-national-institute-for-standards-and-technology\" style=\"position:relative;\"><a href=\"#4-nist-national-institute-for-standards-and-technology\" aria-label=\"4 nist national institute for standards and technology permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. NIST (National Institute for Standards and Technology)</h4>\n<p>NIST creates a set of rules or guidelines for the businesses that are providing services to the federal government. These guidelines to help federal agencies meet the requirements of the FISMA; however, other organizations reference NIST for strong security standards. </p>\n<ul>\n<li>It should be a minimum of eight characters and a maximum length of at least 64 characters </li>\n<li>It may use all special characters but no special requirement to use them</li>\n<li>It should restrict sequential and repetitive characters (e.g., 12345 or aaaaaa)</li>\n<li>It should Restrict context-specific passwords (e.g., the name of the site, etc.)</li>\n<li>It should Restrict commonly used passwords (e.g., p@ssw0rd, etc.) and dictionary wordsRestrict passwords obtained from previous breach corpuses</li>\n</ul>\n<h3 id=\"summary\" style=\"position:relative;\"><a href=\"#summary\" aria-label=\"summary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Summary</h3>\n<p>I have explained why we needed a strong password policy &#x26; compliance. It doesn't matter how strong a password you are using, but bad guys are using new methods or technologies for exposing the user data.\nMost of the data breaches are happing because of Common or weak passwords. MFA, passwordless, or one-time password are providing additional security for a user account.  </p>\n<h3 id=\"source\" style=\"position:relative;\"><a href=\"#source\" aria-label=\"source permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Source</h3>\n<p>https<span></span>://www.fda.gov/food/online-registration-food-facilities/random-password-generator-fda-industry-systems</p>\n<p>https<span></span>://uwm.edu/hipaa/security-guidelines/#password</p>\n<p>https<span></span>://pcipolicyportal.com/blog/pci-compliance-password-requirements-best-practices-know/</p>\n<p>https<span></span>://spycloud.com/new-nist-guidelines/</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"November 12, 2020","updated_date":null,"title":"Password Security Best Practices & Compliance","tags":["Security","Password","Compliance","Passowrd Policy"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/f1b48d682872b6c2f7aee16ea458d6ad/14b42/password-security.jpg","srcSet":"/static/f1b48d682872b6c2f7aee16ea458d6ad/f836f/password-security.jpg 200w,\n/static/f1b48d682872b6c2f7aee16ea458d6ad/2244e/password-security.jpg 400w,\n/static/f1b48d682872b6c2f7aee16ea458d6ad/14b42/password-security.jpg 800w,\n/static/f1b48d682872b6c2f7aee16ea458d6ad/47498/password-security.jpg 1200w,\n/static/f1b48d682872b6c2f7aee16ea458d6ad/ec6c5/password-security.jpg 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Vijay Singh Shekhawat","github":"code-vj","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/password-secure/"},"html":"<p>When we start thinking about authentication in any kind of software (it can be web, mobile, desktop, or even console), the first thing that comes to mind is username/password, this is an older but still effective technique to protect and identify users. Securing these passwords is not an easy task we require better techniques to secure these passwords from attackers. Generally, passwords stored in databases, so we can secure passwords by traditional techniques to prevent access to databases like firewalls, role definitions, etc. but just to prevent database intrusions is not a fully secured way, we require further password protections by converting them into non-readable (encrypted) formats. To understand encrypting passwords we have to understand plain text passwords and how these kinds of passwords are insecure.</p>\n<p><strong>Let's start our journey</strong></p>\n<h1 id=\"plain-text-passwords-never-store-plain-text-passwords\" style=\"position:relative;\"><a href=\"#plain-text-passwords-never-store-plain-text-passwords\" aria-label=\"plain text passwords never store plain text passwords permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Plain text passwords [Never Store Plain text Passwords]</h1>\n<p>Plain text passwords are stored directly in a database without any encryption. These passwords are very insecure because:\n- If someone hacks your database he can access any account and do anything possible after login.\n- Developers or employees who are working on a project commonly misuse the password and spread these passwords to other people for misuse.</p>\n<p>  As a hard and fast rule plain text passwords should NOT be accepted in any case or used for any project or product.</p>\n<h1 id=\"encrypted-passwords-not-recommended\" style=\"position:relative;\"><a href=\"#encrypted-passwords-not-recommended\" aria-label=\"encrypted passwords not recommended permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Encrypted passwords [Not recommended]:</h1>\n<p>Encryption helps us by protecting data from hackers. In network communication, the same techniques can be used in saving passwords. Any encryption algorithm can be used to protect passwords. So on registration plain text passwords are encrypted and saved to your database.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">```</span>\n<span class=\"grvsc-line\">EncryptedPassword = Encrypt ( Password, Key);</span>\n<span class=\"grvsc-line\">```</span></code></pre>\n<p>Get this encrypted password from database then de-crypt and match\n<code>Password = Decrypt ( EncryptedPasword, Key);</code></p>\n<p>Match with user entered password.</p>\n<p>But passwords will still not be fully secured because encrypted data can be always be de-crypted with the encryption key if someone get the key then they can de-crypt your password.</p>\n<h1 id=\"hashed-passwords-recommended\" style=\"position:relative;\"><a href=\"#hashed-passwords-recommended\" aria-label=\"hashed passwords recommended permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Hashed passwords [Recommended]</h1>\n<p>Hashing is a method of encryption to get original data from hash. Hashing algorithms are used in network data communications. The encryption encrypts the data but hashing protects tampering with the encrypted data. Hashing algorithms are widely used in securing passwords.</p>\n<p>In case of hashing validation of password performed refer to the following pseudo-code:</p>\n<p>On registration</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">PasswordHash = HASH(Password);</span></code></pre>\n<p>Some of the hashing algorithms support salts(a set of characters that is appended to your hash) like HMAC</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">PasswordHash = HASH(Password, salt);</span></code></pre>\n<p>On login the same process happens, get hash from users entered password</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">  inputPasswordHash = HASH(inputPassword);</span></code></pre>\n<p>And compare with the saved password</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">  If(SavedPassworHash == inputPasswordHash){</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">  //user get login</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">  }</span></code></pre>\n<p>For making a strong hash from non-salted hash algorithms, salt is appended or prepended to your password string. Appending and prepending also has two kinds of implementations one is a universal salt and the second is per password random salt, let us understand one by one.</p>\n<p><strong>Universal salt :</strong> in this implementation every password has one salt.</p>\n<ul>\n<li>\n<p>Universal salt prepend</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">PasswordHash = Hash(Salt+Password);</span></code></pre>\n</li>\n<li>\n<p>Universal salt append</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">PasswordHash = Hash(Password+Salt);</span></code></pre>\n<p><strong>Per password salt :</strong></p>\n</li>\n</ul>\n<p>In this implementation every password has it's own random salt, but the question is how we preserve salt for a password? Answer is the salt is appended with password by a separator. And on login split that saved string by separator and get hashed password and salt.</p>\n<p>On registration when we save password</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">  Salt = RandomString();</span>\n<span class=\"grvsc-line\">  PasswordHashWithSalt = Hash(Password+Salt) + &quot;:&quot; + Salt;</span></code></pre>\n<p>On login when compare password : first split salt and password hash</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">  StringArray = Split(PasswordHashWithSalt , &quot;:&quot; );</span>\n<span class=\"grvsc-line\">  Salt = StringArray\\[1\\];</span>\n<span class=\"grvsc-line\">  PasswordHash = StringArray\\[0\\];</span></code></pre>\n<p>Than get hash of user entered password by salt</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">inputPasswordHash = Hash(inputPassword + Salt);</span></code></pre>\n<p>Then compare both password hash</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">If(PasswordHash == inputPasswordHash){</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">//user get login</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<p><strong>Some popular encryption methods :</strong> Most of people use following algorithms for hashing passwords, explaining all algorithms is out of scope of this blog. I am adding reference URLs for more reading. I am adding only strong hashing algorithms </p>\n<ol>\n<li><a href=\"http://en.wikipedia.org/wiki/PBKDF2\">PBKDF2</a></li>\n<li><a href=\"http://en.wikipedia.org/wiki/Bcrypt\">bcrypt</a></li>\n<li><a href=\"http://www.tarsnap.com/scrypt.html\">scrypt</a></li>\n<li><a href=\"https://en.wikipedia.org/wiki/Argon2\">Argon2</a></li>\n</ol>\n<h2 id=\"hash-cracking-techniques\" style=\"position:relative;\"><a href=\"#hash-cracking-techniques\" aria-label=\"hash cracking techniques permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Hash cracking techniques</h2>\n<p><strong>Brute force:</strong> It is the most popular password cracking technique, in this loop every combination of numbers and alphabets are tried. Suppose one system have password minimum length is 6 digits then</p>\n<p>000000, 000001,000002……………….111111,111112……..AAAAAA etc.</p>\n<p>In any case user have set simple password like 123123, it will be cracked simply. How to prevent this kind of scenarios</p>\n<ol>\n<li>Enforce to user to use at-least one number, one symbols, one capital letter and one small letter in password.</li>\n<li>On login form if someone entered more than three time wrong password for one username then ask for human verification by captcha, it will be prevented by automatic brute force password generator.</li>\n</ol>\n<p><strong>Dictionary attacks:</strong></p>\n<p>In crypt-analysis and computer security, a dictionary attack is a technique for defeating a cipher or authentication mechanism by trying to determine its decryption key or pass-phrase by trying hundreds or sometimes millions of likely possibilities, such as words in a dictionary. (<a href=\"http://en.wikipedia.org/wiki/Dictionary_attack\">Wikipedia</a>)</p>\n<p>it is just extended version of brute force attack, in this attacker attack by dictionary words, most of time people set their password as meaningful name to keep easily in mind. And in this attack.</p>\n<p><strong>Rainbow tables</strong></p>\n<p>A rainbow table is a precomputed table for reversing cryptographic hash functions, usually for cracking password hashes. Tables are usually used in recovering a plain text password up to a certain length consisting of a limited set of characters. It is a practical example of a space/time trade-off, using less computer processing time and more storage than a brute-force attack which calculates a hash on every attempt, but more processing time and less storage than a simple look-up table with one entry per hash. Use of a key derivation function that employs a salt makes this attack unfeasible. (<a href=\"http://en.wikipedia.org/wiki/Rainbow_table\">Wikipedia</a>)</p>\n<h2 id=\"migrating-hashing-algorithm\" style=\"position:relative;\"><a href=\"#migrating-hashing-algorithm\" aria-label=\"migrating hashing algorithm permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Migrating Hashing algorithm</h2>\n<p>Sometimes people realize that their Hashing algorithm is weak so they think to migrate system to one algorithm to another but hashing algorithms are one way so getting original password is not possible so the question becomes how to make this possible. There are two ways to do this.</p>\n<p><strong>Reset all passwords:</strong> In this approach just migrate your algorithm from one to another but keep password hash same, but password will not be matched because hash of one algorithm doesn't match with hash of another algorithm, so email to user about it that our system has improved security system and send link with this email for resetting password, so user will reset password.</p>\n<p><strong>Migrate on login:</strong> this approach is tricky in this case maintain one parameter for checking is password upgraded to new algorithm, set false for all user by default and when use come for login check this check if it is false then compare password with old algorithm and if password get matched then start user's session and get newer hash from plain text password and saved to database and update is password upgraded check to true. Now from next time user's password will be checked by newer algorithm.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"May 14, 2015","updated_date":null,"title":"Password Security","tags":["Security","Password"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/e7bb89604f85c7699b36ea7c43eab30e/7d145/password-security.png","srcSet":"/static/e7bb89604f85c7699b36ea7c43eab30e/69585/password-security.png 200w,\n/static/e7bb89604f85c7699b36ea7c43eab30e/497c6/password-security.png 400w,\n/static/e7bb89604f85c7699b36ea7c43eab30e/7d145/password-security.png 610w","sizes":"(max-width: 610px) 100vw, 610px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}}]}},"pageContext":{"tag":"Password"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}