Buckets:

|
download
raw
30.4 kB
# Password-based authentication
## Name
Password-based authentication
## Summary
A subject proves they own a claimed identity by providing a correct identifier, such as a username or email address, and the corresponding password. This pattern relies on the assumption that only the actual owner of the claimed identity knows the correct password.
## Parent
- [Authentication](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/)
## Problem
- See [Authentication](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/)
## Solution
### Roles
- Subject (: [Entity](https://securitypatterns.distrinet-research.be/metamodel/#entity)) wants to login into the `System`
- Enforcer (: [Enforcement point](https://securitypatterns.distrinet-research.be/metamodel/#enforcement-point)) ensures the requested action is only performed if the `Subject` is successfully authenticated, this entity must be incorporated into the `System`
- Verification manager (: [Entity](https://securitypatterns.distrinet-research.be/metamodel/#entity)) is responsible to collect the inputs necessary to verify a `Subject`'s password
- Comparator (: [Decision point](https://securitypatterns.distrinet-research.be/metamodel/#decision-point)) compares the hash value of the received password against that provided by the `Password store`
- Hasher (: [Cryptographic primitive](https://securitypatterns.distrinet-research.be/metamodel/#cryptographic-primitive)) calculates the hash value for a given input
- Verification manager + Comparator + Hasher <- Authentication.Verifier
- Password store (: [Storage](https://securitypatterns.distrinet-research.be/metamodel/#storage)) keeps track of the hash values corresponding to each registered identity
- Password store <- Authentication.Evidence provider
- Pepper store (: [Storage](https://securitypatterns.distrinet-research.be/metamodel/#storage)) keeps track of the pepper value(s) used by the system
- Encrypter (: [Cryptographic primitive](https://securitypatterns.distrinet-research.be/metamodel/#cryptographic-primitive)) encrypts a given data element using a given cryptographic key
- System (: [Entity](https://securitypatterns.distrinet-research.be/metamodel/#entity)) contains the business logic corresponding to the requested action
- Registrar (: [Entity](https://securitypatterns.distrinet-research.be/metamodel/#entity)) handles the `Subject`'s registration and forwards the evidence to the `Password store`
- Resetter (: [Entity](https://securitypatterns.distrinet-research.be/metamodel/#entity) handles the reset of a `Subject`'s credential in case the current credential is lost
- Password policy (: [Information point](https://securitypatterns.distrinet-research.be/metamodel/#information-point)) contains the rules any password should satisfy in order to be valid, e.g. minimum and maximum number of characters
- Hash manager (: [Entity](https://securitypatterns.distrinet-research.be/metamodel/#entity)) is responsible to collect the necessary inputs to calculate the hash value for a new password
- SRNG (: [Cryptographic primitive](https://securitypatterns.distrinet-research.be/metamodel/#cryptographic-primitive)) a cryptographically secure random number generator
### Actions
- action (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) that the `Subject` wants to perform. For this pattern the requested action is most often a login request.
- action <- Authentication.action
- verify (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) the provided credential against the appropriate evidence
- get_pwd (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) retrieve the password as known by the `System`
- get_pwd <- Authentication.get_evidence
- get_pepper (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) retrieve the pepper value (for the provided id)
- calculate_hash (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) calculate the hash value of the provided data element(s)
- encrypt (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) compute the ciphertext corresponding to the given key and plaintext
- compare (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) check whether the provided data elements are identical to each other
- register (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) add a new credential to the system to allow future authentication
- add (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) add new evidence corresponding to a credential
- reset (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) change the current credential to the newly provided one
- update (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) update the credential, and corresponding evidence, to the newly provided values
- check (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) check whether the provided password is valid with respect to the system's password policy
- next (: [Action](https://securitypatterns.distrinet-research.be/metamodel/#action)) retrieve the a new randomly generated value
### Data elements
- id (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) identifies the identity claimed by the `Subject`
- id <- Authentication.principal
- [Tags](https://securitypatterns.distrinet-research.be/metamodel/#tags_1): Identifier, Untampered
- pwd (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) serves as the `Subject`'s proof-of-ownership of the claimed identity
- id + password <- Authentication.credential
- [Tags](https://securitypatterns.distrinet-research.be/metamodel/#tags_1): Secret, Untampered
- hash(x, y) (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) the hash value calculated from the concatenation of elements `x` and `y`
- [Tags](https://securitypatterns.distrinet-research.be/metamodel/#tags_1): Untampered
- {x}_k (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) the ciphertext resulting from encrypting `x` using key `k`
- [Tags](https://securitypatterns.distrinet-research.be/metamodel/#tags_1): Untampered
- stored_pwd (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) a `Subject`'s password as it stored persistently after registration
- stored_pwd <- Authentication.evidence
- salt (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) random value to ensure the hash value of each password is unique
- [Tags](https://securitypatterns.distrinet-research.be/metamodel/#tags_1): Untampered
- pepper (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) random value used as key to encrypt password hash values before storage as additional protection against an attacker cracking the passwords
- [Tags](https://securitypatterns.distrinet-research.be/metamodel/#tags_1): Secret, Untampered
- reply (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) from the `System` triggered by the requested action (optional)
- token <- Authentication.reply
- error (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) message informing the receiving some check failed or a request could not be successfully executed
- args (: [Data](https://securitypatterns.distrinet-research.be/metamodel/#data)) any additional arguments the `Subject` can provide as part of an action request (optional)
### Behaviour
A subject logging into a system and obtaining a token proving successful authentication boils down to nine interactions.
1. The `Subject` provides the `Enforcer` with its identifier and password as part of its action request.
2. The `Enforcer` forwards the identifier and password to the `Verification manager` for verification and blocks the login request awaiting an answer.
3. The `Verification manager` requests the stored hash value and salt from the `Password store`.
4. The `Verification manager` receives the requested hash value and salt from the `Password store`.
5. The `Verification manager` forwards the received salt and password to the `Hasher`.
6. The `Hasher` calculates the requested hash value and transmits the result back to the `Verification manager`.
7. The `Verification manager` requests the correct pepper value from the `Pepper store`.
8. The `Pepper store` replies with the corresponding pepper value.
9. The `Verification manager` forwards the received pepper along with the password's hash value to the `Encrypter`.
10. The `Encrypter` encrypts the received hash value using the pepper as cryptographic key and replies the resulting ciphertext to the `Verification manager`.
11. The `Verification manager` forwards the received ciphertext and the stored hash value to the `Comparator` for comparison.
12. The `Comparator` checks whether the newly calculated ciphertext is identical to the one that was retrieved from the `Password store` and informs the `Verification manager` of the result of the verification.
13. The `Verification manager` forwards the result of the password verification to the `Enforcer`.
14. If the `Enforcer` receives confirmation that the provided password is correct, the `Enforcer` forwards the login action request to the `System`. Otherwise the `Subject` is informed of the failure to login.
15. Optionally, the `System` replies to the `Subject` after receiving and/or executing the action request. This reply does not need to pass through the `Enforcer`.
## Role considerations
### Password store
Specialisation of [Authentication.Evidence provider](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#evidence-provider)
Passwords are typically stored in persistent storage, e.g. a database containing account information or a file containing valid user accounts. Passwords should at all times be stored in hashed form.[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd) See the section on [hashing algorithms](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#hashing-algorithm-hasher-password-store) for more information.
### Resource usage (Enforcer, Verification manager, Password store, Comparator, Hasher)
Specialisation of [Authentication.Resource usage](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#resource-usage-enforcer-verifier-evidence-provider)
In addition to prevent that an attacker can disrupt the authentication mechanism by using excessive resources, further measures should also be taken to protect the accounts associated the principals themselves. More specifically, it is advised to temporarily lock an account after a certain number of failed login attempts in order to prevent any further attempts.[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) This prevents that an attacker can try many different passwords in a short period of time. The exact lockout period as well as the allowed number of failed login attempts depend on the context of the system at hand, and should strike a balance between usability and security.
### Password policy
The security of a password-based authentication mechanism depends largely on the password remaining secret to anyone other than the `Subject`. Therefore, it should be hard for other parties to guess a `Subject`'s password through manual or automated means. A good password policy for choosing passwords, either by the `Subject` or the `Registrar`, can make it more challenging for attackers to guess correct passwords.[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) [6](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:schneier_pwd) Note that this policy also applies to passwords intended for limited use, e.g. a default account password set by the `Registrar` which the `Subject` is meant to change when logging in for the first time.
The most common advise for good for password policies:
- Set a minimum password length of 8 characters[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc) [8](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:ietf__pwd_store)
- Set a maximum length of 64 characters to 128 characters [2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc) [8](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:ietf__pwd_store)
- At the minimum allow all ASCII characters as well as white space[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc) [5](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:ms_pwd)
- Block common and previously breached passwords [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc) [2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) [8](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:ietf__pwd_store)
The appropriate maximum length for passwords may depend on the [hashing algorithm](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#hashing-algorithm-hasher-password-store) used, it is advised to consult the documentation of the used library for details.
In case a `Subject` provides a password that does not comply to the password policy at hand the `Subject` should merely be informed of this. The system should never (silently) modify the provided password to comply with its policy. For example, if a `Subject` provides a password during registration that exceeds the maximum length it should not be automatically truncated.[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc)
Some widespread practices are not good practice for password policies and should be avoided:
- Do not impose any further composition rules aside from the above common composition rules, for example do not require a certain number of non-alphanumeric characters or capital letters. Such additional rules decrease the number of possible passwords, making it easier for an attacker to guess a correct one.
- Do not arbitrarily, e.g. periodically, require subjects to change their password.[1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc) [5](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:ms_pwd) Such measures tend to drive (human) `Subject`s to choose related, predictable passwords[5](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:ms_pwd), e.g. the new password is a minor variation of the previous one. Only force password changes in case of password leaks or when (part of) the system was compromised.[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc)
Finally, if the `Registrar` selects the (initial) password, ensure this is randomly generated and not based on some (easily) obtainable information such as the `Subject`s username, the `Subject`'s social security number or a serial number associated with the `Subject`.
### Hashing algorithm (Hasher, Password store)
Passwords should be stored in the `Password store` in such a way that an attacker cannot obtain them even if the `Password store` is compromised[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd). To this end passwords should be hashed before they are stored, such that even if an attacker obtains the hash value it is not possible to (easily) derive the original password.[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd) [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc)
One should use well-known cryptographic libraries that provide support for modern hashing algorithms (e.g. Argon2id, bcrypt, and PBKDF2).[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd) [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc) The [References](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#references) section contains some pointers to possible libraries.
While designing a system it should always be considered that it is likely that the used hashing algorithm has to updated at some point in the future.[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd) It is advisable to design your system in such a manner to make such updates as easy as possible. Some possible strategies to deal with such updates are described by [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#upgrading-legacy-hashes).
#### Password salting (Hasher, SRNG, Password store)
In order to make cracking a password hash more difficult, a random string, unique for each `Subject`, typically called a salt, should be added before calculating the password's hash value.[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd) [1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc) The addition of such a salt is intended to ensure that the hash value for each `Subject` is unique irrelevant whether they use the same password (in multiple applications). Consequently, an attacker has to compute the hash value for each possible password individually instead of computing them all once and simply comparing the resulting hash values to those obtained from the application. Note, as the salt is needed each time a login request is received from a `Subject`, they are generally stored in plain text alongside the corresponding hash value in the `Password store`.
If one uses a modern hashing algorithm, as advised above, a salt is typically automatically generated and added during the calculation of a password's hash value. In case the used library allows for some configuration of the salt, one should take care its minimal length is 16 characters as advised by OWASP[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) or 32 bits as advised by NIST[1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc). If one uses a library that does not automatically add a salt, a [cryptographically secure generation function](https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#secure-random-number-generation) always be used to generate salts.
#### Password peppering (Encrypter, SRNG, Pepper store)
In order to further hinder attackers cracking any obtained hash values they can be peppered before storing them.[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd) The pepper is a random string that, similar to the above salt, should be generated using a cryptographically secure random generator where the advised minimal length is 32 characters[4](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_store_pwd) or 112 bits[1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc).
The same pepper is used for all password entries in the `Password store`, therefore the pepper should be treated as a cryptographic key and kept confidential at all times. Consequently, the pepper should not be added as input to the hash value calculation as this may leak its value. Instead the pepper should be used as key to compute an HMAC or symmetrically encrypted ciphertext of the hash value of the salted password. Furthermore, the pepper should not be stored in `Password store` but kept somewhere else to preserve its secrecy, e.g in a hardware security module.
As with any used cryptographic key, the pepper might have to be changed at some point in the future. Therefore, any system using password peppering should be designed to facilitate pepper rotation.
### Ciphertext comparison (Comparator)
The `Comparator` should use a secure comparison function to compare the calculated ciphertext with the stored one.[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) A secure comparison function should enforce a maximum input length to protect against denial of service attacks, and return in constant time to protect against timing attacks.
### Subject registration (Registrar)
Specialisation of [Authentication.Subject registration](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#subject-registration-registrar)
The goal of the registration procedure is that upon completion, the `Password store` contains the identifier, hash value of the salted password, and salt. Furthermore, the `Subject` should possess its identifier and password upon completion. These data elements can be determined in one of three ways:
- the `Subject` provides its identifier as well as password
- the `Subject` provides its identifier, the `Registrar` selects a password and provides this to the `Subject`
- the `Registrar` selects both identifier and password for the `Subject`
In the `Subject` provides any input data, i.e. identity and/or password, [additional security measures](https://securitypatterns.distrinet-research.be/contexts/04__receive_data/) should be considered to ensure secure processing of this data.
Note that in this pattern, the `Registrar` is always responsible for constructing the evidence, i.e. hash value, based the selected or received password. One should never rely on the `Subject` to provide the evidence corresponding to its password.
### Password change (Password store)
Specialisation of [Authentication.Credential change](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#Credential-change-evidence-provider)
Before a `Subject` can change its password it should be explicitly (re-)authenticated by requiring it to provide the current password.[2](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_authc) [7](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:ieee) Other proofs of authentication, e.g. a valid (session) token, should not be considered sufficient to perform such a sensitive operation. This way, even when attackers obtain a valid token they cannot permanently lock legitimate `Subject`s out of their accounts by changing the passwords.
### Password reset (Resetter)
Specialisation of [Authentication.Credential reset](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#credential-reset-resetter)
A `Subject` that requests to reset its password should be explicitly authenticated through a side-channel before being allowed to do so.[3](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_forgot_pwd) Such side-channel can, for example, consist of
- a URL token communicated via email or
- a PIN send to the `Subject` via SMS.
The methods available for the system at hand depend on the information that is gathered during [registration](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#subject-registration-registrar).
The token used during side-channel authentication must be chosen such that it is not easily guessable or enumerated by an attacker. In general it is advised to use a cryptographically secure random number generator to generate sufficiently long and random tokens.[3](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:owasp_cs_forgot_pwd)
Note, that the result of the side-channel authentication should not leak information about whether the provided information was valid, as this would allow an attacker to enumerate existing accounts. For instance, say that a `Subject` is required to provide an email address to initiate a password reset. If the system would present an error message in case the email address does not match a known `Subject`, an attacker could use this to determine for which email addresses an account exists in the system. This information could be useful in further, more targeted attacks on these accounts. Instead, the system should show a generic message, for example that a URL token was emailed to the provided email address, while actually sending this token only if the provided email address was known by the system.
Finally, a password reset mechanism as described here should always be used instead of "password hints" to help a `Subject` to remember his or her password.[1](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#fn:nist_dig_lfc)
### Error messages (Enforcer, Resetter)
Specialisation of [Authentication.Error messages](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#error-messages-enforcer-resetter)
Any error message shown to the `Subject` should be sufficiently generic as not to reveal whether is was caused by
- an unknown `id`; or
- an incorrect `pwd`.
For example, the `error` return when authentication failed should be something like "Incorrect username and/or password".
### Log authentication failures (Verification manager)
Specialisation of [Authentication.Log authentication failures](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#log-authentication-failures-verifier)
## Data considerations
### Selection of credential and evidence
Specialisation of [Authentication.Selection of credential and evidence](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#selection-of-credential-and-evidence)
The credential from the parent pattern is split into two parts, an identifier and a password, where the latter is crucial for security. Note that a password is considered a credential of the type something you know, with the underlying assumption that only the `Subject` knows the correct password for the given identifier. As evidence the hash value of the password is used, which will be kept in the [password store](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#password-store).
The correctness of the authentication mechanism should never rely on the secrecy of the identifier provided by the `Subject`. For example, identifiers such as email addresses, usernames, or hostnames are often rather easy to obtain by an attacker. Yet, it is advised to take measures to prevent that an attacker can easily obtain an overview of (all) valid identifiers for the system, e.g. by keeping [error messages](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#error-messages-enforcer-resetter) sufficiently generic. Having an overview of valid identifiers might help an attacker in mounting a successful attack against the system.
### id
Specialisation of [Authentication.principal](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#principal)
### pwd
Specialisation of [Authentication.credential](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#credential)
### stored_pwd
Specialisation of [Authentication.evidence](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#evidence)
### Hash values and ciphertext (hash(x, y), {x}_k, salt, pepper)
The password verification process involves calculating a hash value and cipher text to compare against the stored evidence, i.e. `stored_pwd`. For the integrity of the verification process it is important that an attacker cannot tamper with the results, or inputs of these calculations. In case any of these data elements are [transmitted over an uncontrolled channel](https://securitypatterns.distrinet-research.be/contexts/06__interact_over_an_uncontrolled_channel/) additional precautions to detect any tampering are necessary. Furthermore, the salt and pepper values are also [stored](https://securitypatterns.distrinet-research.be/contexts/07__data_storage/) in their respective storage entities and measures are needed to detect any unauthorised changes. Finally, the pepper should be treated as a cryptographic key and should be kept confidential at all times.
### Password scope
Specialisation of [Authentication.Credential scope](https://securitypatterns.distrinet-research.be/patterns/01_01_001__authentication/#credential-scope)
It is generally impossible to prevent a `Subject` from reusing a password (on other systems), even if the password is generated by the `Registrar`. Instead `Subject` can be made aware that they should avoid using the same password for different accounts. Note that checking a password against lists of commonly used or breached passwords, as suggested in [Password policy](https://securitypatterns.distrinet-research.be/patterns/01_01_002__authentication_pwd/#password-policy), does avoid `Subject`s such predictable passwords.
## Implementations
None

Xet Storage Details

Size:
30.4 kB
·
Xet hash:
43d7e538c4641e1f0eaba3ab032869475e8aa34d861c4e6e068adb6be28d5523

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.