ArticleslgStudy

computer science

Domain separation

Domain separation 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 Domain separation rather than just read about it. In short: In cryptography, domain separation is a construct used to implement multiple different functions using only one underlying template in an efficient way. The domain separation can be defined as partitioning of the domain of a function to assign separate subdomains to different applications of the same function.

Key takeaways

  • Domain separation 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 Domain separation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Domain separation from memory before moving on to harder problems.

Reference excerpt

In cryptography, domain separation is a construct used to implement multiple different functions using only one underlying template in an efficient way. The domain separation can be defined as partitioning of the domain of a function to assign separate subdomains to different applications of the same function. For example, cryptographic protocols typically rely on random oracles (ROs, functions that return a value fully determined by their input yet otherwise random). The security proofs for these protocols are based on the assumption that the random oracle is unique to the protocol: if two protocols share the same RO, the assumptions of the proof are not met anymore. Since creating a new cryptographic primitive from scratch each time an RO is needed is impractical, multiple ROs (say, RO1 and RO2) are produced by prepending unique domain separation tags (DSTs, also known as domain separators) to the input of a base oracle RO:

RO1(x) := RO("RO1" || x) RO2(x) := RO("RO2" || x) where "RO1" and "RO2" are the strings representing the unique DSTs and || is a concatenation operator. If the underlying RO function is secure (say, it is a cryptographic hash), RO1 and RO2 are statistically independent. The technique was originally proposed by Bellare & Rogaway in 1993.

Uses The domain separation construct can be used for multiple purposes:

providing independent ROs for protocols; extending the output size of an RO (for example, by using the RO multiple times (numbered from 1 to L), each time using a representation of oracle number as a DST. This technique is called "counter mode" due to its similarity to the counter mode of a block cipher; "keying" the oracle by using an encryption key as a DST. In the practical sense, the domain separation can provide "customization", an equivalent of the strong typing in programming: it enforces the use of independent calculations for different tasks, so an attacker that had learned a result of one calculation will get no information about another one.

Kinds of functions Domain separation can be used with functions implementing different cryptographic primitives.

Hash functions Domain separation is most commonly used with hash functions. The input domain of a hash function is practically unlimited, it is easy to partition it among any number of derived functions, for example, by prepending or appending of a DST to the message. Domain separation is used within the implementation of some hash functions to produce multiple different functions from the same design. For example, in SHA-3 the domain separation makes sure that the differently named functions (like SHA3-512 or SHAKE128) are independent.

Symmetric ciphers and MACs The security of symmetric ciphers and MACs critically depends on the key not being used for other purposes. If an application needs multiple keys but has only one source of keying material, it would typically employ a key derivation function to produce the keys. KDFs can usually produce output of arbitrary length, so they can be used to generate any number of keys. Also, just like hash functions, some symmetric ciphers and MACs use domain separation internally.

Signatures In many cases, it is desirable to use a single signing key to produce digital signatures for different purposes. If this is done, it is important to make sure that signed messages intended for one purpose cannot be used for the other. A simple way to achieve this is to add to each message an identifier specifying the purpose, and to reject a message if the identifier doesn't match.

References

Sources Bellare, Mihir; Rogaway, Phillip (1993). Random oracles are practical: a paradigm for designing efficient protocols (PDF). ACM Press. doi:10.1145/168588.168596. ISBN 978-0-89791-629-5. Bellare, Mihir; Bernstein, Daniel J.; Tessaro, Stefano (2016). "Hash-Function Based PRFs: AMAC and Its Multi-User Security". Advances in Cryptology – EUROCRYPT 2016. Vol. 9665. Berlin, Heidelberg: Springer Berlin Heidelberg. doi:10.1007/978-3-662-49890-3_22. ISBN 978-3-662-49889-7. Faz-Hernandez, A.; Scott, S.; Sullivan, N.; Wahby, R. S.; Wood, C. A. (August 2023). "RFC 9380: Hashing to Elliptic Curves". The RFC Series. 2.2.5. Domain Separation. ISSN 2070-1721. Hampiholi, Brinda; Alpár, Gergely; van den Broek, Fabian; Jacobs, Bart (2015). "Towards Practical Attribute-Based Signatures". Security, Privacy, and Applied Cryptography Engineering. Vol. 9354. Cham: Springer International Publishing. pp. 310–328. doi:10.1007/978-3-319-24126-5_18. ISBN 978-3-319-24125-8. Kelsey, John; Chang, Shu-jen; Perlner, Ray (2016). "NIST SP 800-185: SHA-3 Derived Functions: cSHAKE, KMAC, TupleHash, and ParallelHash". NIST Computer Security Resource Center. NIST. Retrieved 6 May 2024. Mittelbach, Arno; Fischlin, Marc (2021). The Theory of Hash Functions and Random Oracles: An Approach to Modern Cryptography. Information Security and Cryptography. Springer International Publishing. ISBN 978-3-030-63287-8. Retrieved 2023-06-22.

Worked examples

Example 1 — a first encounter with Domain separation

Start with the simplest possible case. Write down what Domain separation 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 Domain separation 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 Domain separation 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 Domain separation

In research
Domain separation 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 Domain separation 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
Domain separation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptography, so understanding it makes those chapters shorter.
In everyday life
Look for Domain separation 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 “Domain separation” →

How to study Domain separation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Domain separation 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 Domain separation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Domain separation in simple terms?

In cryptography, domain separation is a construct used to implement multiple different functions using only one underlying template in an efficient way. The domain separation can be defined as partitioning of the domain of a function to assign separate subdomains to different applications of the sa…

Why does Domain separation 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 Domain separation?

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 Domain separation.

Tags

  • Cryptography

Keep exploring