ArticleslgStudy

computer science

Salted Challenge Response Authentication Mechanism

Salted Challenge Response Authentication Mechanism is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Salted Challenge Response Authentication Mechanism rather than just read about it. In short: In cryptography, the Salted Challenge Response Authentication Mechanism (SCRAM) is a family of modern, password-based challenge–response authentication mechanisms providing authentication of a user to a server. As it is specified for Simple Authentication and Security Layer (SASL), it can be used for password-based logins to services like LDAP, HTTP, SMTP, POP3, IMAP and JMAP (e-mail), XMPP (chat), or MongoDB and Po…

Key takeaways

  • Salted Challenge Response Authentication Mechanism belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Salted Challenge Response Authentication Mechanism to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Salted Challenge Response Authentication Mechanism from memory before moving on to harder problems.

Reference excerpt

In cryptography, the Salted Challenge Response Authentication Mechanism (SCRAM) is a family of modern, password-based challenge–response authentication mechanisms providing authentication of a user to a server. As it is specified for Simple Authentication and Security Layer (SASL), it can be used for password-based logins to services like LDAP, HTTP, SMTP, POP3, IMAP and JMAP (e-mail), XMPP (chat), or MongoDB and PostgreSQL (databases). For XMPP, supporting it is mandatory.

Motivation Alice wants to log into Bob's server. She needs to prove she is who she claims to be. To solve this authentication problem, Alice and Bob have agreed upon a password, which Alice knows, and which Bob knows how to verify. Now Alice could send her password over an unencrypted connection to Bob in a clear text form for him to verify, but that would make the password accessible to Mallory, who is wiretapping the line. Alice and Bob could try to bypass this by encrypting the connection. However, Alice doesn't know whether the encryption was set up by Bob, and not by Mallory by doing a man-in-the-middle attack. Therefore, Alice sends a hashed version of her password instead, like in CRAM-MD5 or DIGEST-MD5. As it is a hash, Mallory doesn't get the password itself. As the hash is salted with a challenge, Mallory could use it only for one login process. However, Alice wants to give some confidential information to Bob, and she wants to be sure it's Bob and not Mallory. To address this, Bob has registered himself with a certificate authority (CA), which signed his certificate. Alice could solely rely on that signature system, but she knows it has weaknesses. To give her additional assurances that there is no man-in-the-middle attack, Bob creates a proof that he knows the password (or a salted hash thereof), and includes his certificate into this proof. This inclusion is called channel binding, as the lower encryption channel is 'bound' to the higher application channel. Alice has been able to authenticate Bob, and Bob has authenticated Alice. Taken together, they have mutual authentication. DIGEST-MD5 already enabled mutual authentication, but it was often incorrectly implemented. When Mallory runs a man-in-the-middle attack and forges a CA signature, she could retrieve a hash of the password. But she couldn't impersonate Alice even for a single login session, as Alice included into her hash the encryption key of Mallory, resulting in a login-fail from Bob. To make a fully transparent attack, Mallory would need to know the password used by Alice, or the secret encryption key of Bob. Bob has heard of data breaches of server databases, and decided that he doesn't want to store the passwords of his users in clear text. He has heard of the CRAM-MD5 and DIGEST-MD5 login schemes, but he knows that to offer these login schemes to his users, he would have to store weakly hashed, un-salted passwords. He doesn't like that idea, and therefore he chooses to demand the passwords in plain text. Then he can hash them with secure hashing schemes like bcrypt, scrypt or PBKDF2, and salt them as he wants. However Bob and Alice would then still face the problems described above. To solve this problem, they use SCRAM, where Bob can store the password in a salted format using PBKDF2. During login, Bob sends Alice his salt and the iteration count of the PBKDF2 algorithm, and then Alice uses these to calculate the hashed password that Bob has in his database. All further calculations in SCRAM are based on this value which both participants know.

Protocol overview Although all clients and servers have to support the SHA-1 hashing algorithm, SCRAM is, unlike CRAM-MD5 or DIGEST-MD5, independent from the underlying hash function. Any hash function defined by the IANA can be used instead. As mentioned in the Motivation section, SCRAM uses the PBKDF2 mechanism, which increases the strength against brute-force attacks, when a data leak has happened on the server. Let H be the selected hash function, given by the name of the algorithm advertised by the server and chosen by the client. 'SCRAM-SHA-1' for instance, uses SHA-1 as hash function.

Password-based derived key, or salted password The client derives a key, or salted password, from the password, a salt, and a number of computational iterations as follows:

SaltedPassword = H(password, salt, iteration-count) = PBKDF2(HMAC, password, salt, iteration-count, output length of H).

Messages RFC 5802 names four consecutive messages between server and client:

client-first The client-first message consists of a GS2 header (comprising a channel binding flag, and optional name for authorization information), the desired username, and a randomly generated client nonce c-nonce. server-first The server appends to this client nonce its own nonce s-nonce, and adds it to the server-first message, which also contains a salt used by the server for salting the user's password hash, and an iteration count iteration-count. client-final After that the client sends the client-final message containing channel-binding, the GS2 header and channel binding data encoded in base64, the concatenation of the client and the server nonce, and the client proof, proof. server-final The communication closes with the server-final message, which contains the server signature, verifier.

Proofs The client and the server prove to each other they have the same Auth variable, consisting of:

Auth = client-first-without-header + , + server-first + , + client-final-without-proof (concatenated with commas) More concretely, this takes the form:

= n=username,r=c‑nonce,[extensions,]r=c‑nonce‖s‑nonce,s=salt,i=iteration‑count,[extensions,]c=base64(channel‑flag,[a=authzid],channel‑binding),r=c‑nonce‖s‑nonce[,extensions] The proofs are calculated as follows:

ClientKey = HMAC(SaltedPassword, 'Client Key') ServerKey = HMAC(SaltedPassword, 'Server Key') ClientProof = p = ClientKey XOR HMAC(H(ClientKey), Auth) ServerSignature = v = HMAC(ServerKey, Auth) where the XOR operation is applied to byte strings of the same length, H(ClientKey) is a normal hash of ClientKey. 'Client Key' and 'Server Key' are verbatim strings. The server can authorize the client by computing ClientKey from ClientProof and then comparing H(ClientKey) with the stored value. The client can authorize the server by computing and comparing ServerSignature directly.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Salted Challenge Response Authentication Mechanism

Start with the simplest possible case. Write down what Salted Challenge Response Authentication Mechanism claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Salted Challenge Response Authentication Mechanism before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Salted Challenge Response Authentication Mechanism ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Salted Challenge Response Authentication Mechanism

In research
Salted Challenge Response Authentication Mechanism appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Salted Challenge Response Authentication Mechanism in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Salted Challenge Response Authentication Mechanism is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptographic protocols, so understanding it makes those chapters shorter.
In everyday life
Look for Salted Challenge Response Authentication Mechanism outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Salted Challenge Response Authentication Mechanism” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Salted Challenge Response Authentication Mechanism in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Salted Challenge Response Authentication Mechanism means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Salted Challenge Response Authentication Mechanism out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Salted Challenge Response Authentication Mechanism in simple terms?

In cryptography, the Salted Challenge Response Authentication Mechanism (SCRAM) is a family of modern, password-based challenge–response authentication mechanisms providing authentication of a user to a server. As it is specified for Simple Authentication and Security Layer (SASL), it can be used f…

Why does Salted Challenge Response Authentication Mechanism matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Salted Challenge Response Authentication Mechanism?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Salted Challenge Response Authentication Mechanism.

Tags

  • Cryptographic protocols

Keep exploring