ArticleslgStudy

computer science

Cryptographically Generated Address

Cryptographically Generated Address 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 Cryptographically Generated Address rather than just read about it. In short: A Cryptographically Generated Address (CGA) is an Internet Protocol Version 6 (IPv6) address that has a host identifier computed from a cryptographic hash function. This procedure is a method for binding a public signature key to an IPv6 address in the Secure Neighbor Discovery Protocol (SEND).

Key takeaways

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

Reference excerpt

A Cryptographically Generated Address (CGA) is an Internet Protocol Version 6 (IPv6) address that has a host identifier computed from a cryptographic hash function. This procedure is a method for binding a public signature key to an IPv6 address in the Secure Neighbor Discovery Protocol (SEND).

Characteristics A Cryptographically Generated Address is an IPv6 address whose interface identifier has been generated according to the CGA generation method. The interface identifier is formed by the least-significant 64 bits of an IPv6 address and is used to identify the host's network interface on its subnet. The subnet is determined by the most-significant 64 bits, the subnet prefix. Apart from the public key that is to be bound to the CGA, the CGA generation method takes several other input parameters including the predefined subnet prefix. These parameters, along with other parameters that are generated during the execution of the CGA generation method, form a set of parameters called the CGA Parameters data structure. The complete set of CGA Parameters has to be known in order to be able to verify the corresponding CGA. The CGA Parameters data structure consists of:

modifier: a random 128-bit unsigned integer; subnetPrefix: the 64-bit prefix that defines to which subnet the CGA belongs; collCount: an 8-bit unsigned integer that must be 0, 1, or 2; publicKey: the public key as a DER-encoded ASN.1 structure of the type SubjectPublicKeyInfo; extFields: an optional variable-length field (default length 0). Additionally, a security parameter Sec determines the CGA's strength against brute-force attacks. This is a 3-bit unsigned integer that can have any value from 0 up to (and including) 7 and is encoded in the three leftmost bits of the CGA's interface identifier. The higher the value of Sec, the higher the level of security, but also the longer it generally takes to generate a CGA. For convenience, the intermediate Sec values in the pseudocode below are assumed to be stored as 8-bit unsigned integers that cannot have a value greater than 7.

CGA generation method The following piece of pseudocode represents the CGA generation method, which is used to create a new Cryptographically Generated Address.

1 procedure generateCGA(Sec, subnetPrefix, publicKey, extFields): 2 modifier := random(0x00000000000000000000000000000000, // 16 octets (128 bits) 3 0xffffffffffffffffffffffffffffffff) 4 5 label1: 6 concat := concatenate(modifier, 0x000000000000000000, // 9 zero octets 7 publicKey, extFields) 8 9 digest := SHA1(concat) 10 Hash2 := digest[0:14] // 14*8 = 112 leftmost bits 11 12 if Sec ≠ 0 and Hash2[0:2*Sec] ≠ 0: // 2*Sec*8 = 16*Sec leftmost bits 13 modifier := modifier + 1 14 goto label1 15 end if 16 17 collCount := 0x00 // 8-bit collision count 18 19 label2: 20 concat := concatenate(modifier, subnetPrefix, collCount, 21 publicKey, extFields) 22 23 digest := SHA1(concat) 24 Hash1 := digest[0:8] // 8*8 = 64 leftmost bits 25 26 intID := Hash1 // Hash1 becomes interface identifier... 27 intID[0] := intID[0] binary and 0x1c binary or (Sec << 5) // ...after writing Sec and u/g bits 28 29 CGA := concatenate(subnetPrefix, intID) // concatenate to form the CGA 30 31 if duplicate(CGA): 32 collCount := collCount + 1 33 34 if collCount = 3: 35 abort 36 end if 37 38 goto label2 39 end if 40 41 return [CGA, [modifier, subnetPrefix, collCount, publicKey, extFields] ] 42 end procedure

The CGA's interface identifier is largely formed by Hash1, which is taken from the first 64 bits of the digested CGA Parameters data structure (lines 20 to 24). On line 27, the first three bits are overwritten by the Sec value and the reserved "u" and "g" bits (the seventh and eighth bits) are set to 0. The Sec parameter implements a hash extension by enforcing the first 16 times Sec bits of another hash, Hash2, to be 0. This hash is the result of the digested CGA Parameters data structure with subnetPrefix and collCount essentially set to 0. A brute-force search is performed to find a suitable Hash2, incrementing the modifier by 1 each iteration (lines 6 to 15). Because more bits need to be 0 with a higher Sec value, the average time required to perform the search increases exponentially with the value of Sec. After concatenating the subnet prefix and the generated interface identifier to create the CGA, duplicate address detection may be performed. If the address is already in use, then the collision counter collCount is incremented by 1 and a new interface identifier is generated (lines 20 to 39). Because collCount is not used in calculating Hash2, it is not necessary to search for a new Hash2 when an address collision occurs. For a similar reason, subnetPrefix is not used either so that if the subnet prefix of the address changes but the host's public key does not, then the same modifier could be reused and there is no need to search for a new Hash2. On line 41 the CGA is returned, along with the CGA Parameters data structure.

CGA verification method A Cryptographically Generated Address is used to verify that received signed messages were sent by the host to which that address has been assigned. This is done by verifying that the key pair used for signing has been bound to the CGA. Because the authenticity of the public key can be verified this way, there is no need for a public key infrastructure. If the host itself is required to be authenticated as well, however, then the CGA itself needs to be authenticated beforehand since the bound public key cannot be trusted if the address is not trusted in such a case (assuming it has not been verified by other methods than CGA). The CGA verification method, in which a public key is verified to be bound to a CGA, requires the corresponding CGA Parameters data structure as input and can be implemented as follows.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Cryptographically Generated Address

Start with the simplest possible case. Write down what Cryptographically Generated Address 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 Cryptographically Generated Address 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 Cryptographically Generated Address 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 Cryptographically Generated Address

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

How to study Cryptographically Generated Address in 20 minutes

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

Frequently asked questions

What is Cryptographically Generated Address in simple terms?

A Cryptographically Generated Address (CGA) is an Internet Protocol Version 6 (IPv6) address that has a host identifier computed from a cryptographic hash function. This procedure is a method for binding a public signature key to an IPv6 address in the Secure Neighbor Discovery Protocol (SEND).

Why does Cryptographically Generated Address 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 Cryptographically Generated Address?

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 Cryptographically Generated Address.

Tags

  • Cryptographic protocols
  • IPv6

Keep exploring