Background InformationWelcome to the world of the citizen card: Full of magical numbers and strict data protection provisions. Here are the details:
Contents:
On the technical side, every citizen card action is a signature process - whether it's used with electronic banking or an online form. However, the citizen card never signs the entire text. The part that is actually being signed is a "hash value(?)", which is a number generated from the entire text. A primitive hash function works something like this: Each letter is replaced by its position in the alphabet. These numbers are then added together.
| Letter | S | C | H | M | E | T | T | E | R | L | I | N | G | Total |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Position in Alphabet | 19 | 3 | 8 | 13 | 5 | 20 | 20 | 5 | 18 | 12 | 9 | 14 | 7 | 153 |
In reality, much more complex algorithms are used for the citizen card (SHA-1(?), SHA-256(?) or RIPEMD-160 – depending on the application). SHA-256 would create a hash value with a 256 Bit length that is normally written as a 64-digit hexadecimal number. The hash value for Schmetterling
would be
d7e3dabc2c95c4c440ee57fb2883188e7f46a9cf51e94674f0e80f7d6db092c4 (calculated with the online hash generator)
Afterwards, this hash value is encrypted symmetrically.
Asymmetric encryption(?) works a little bit like magic: A different key is used to encrypt a text than is used to decrypt. The other method (symmetric encryption) is still relatively easy to understand: E.g., in order to encrypt the number 5 , the sender multiplies it by 3 (=key) and gets 15. The recipient divides 15 by the key and gets the number 5 again. Done.
In asymmetric encryption on the other hand, there is a keypair, which consists of two parts: the public key(?) (that everyone knows) and the private key(?) (which stays secret). In this case:
And here's the real mystery to it -- it even works in the other direction:
This algorithm is harder to understand because it's like nothing else you usually see in everyday life. This system is probably most comparable to a padlock: The padlock is the public key, since everyone can see and use it. If the padlock is locked, it can only be unlocked again with the right (private) key.
The asymmetric encryption algorithms used by the citizen card are ECDSA(?) (for qualified signatures(?)) and RSA(?) (for advanced signatures(?)). The RSA algorithm is better for explaining how it functions (for ECDSA see Wikipedia):
The level of secureness with RSA is based on the fact that it is much easier to multiply two numbers together than the opposite: breaking down large numbers into two "parts". Example: Choose two prime numbers, such as 5 and 23 and multiply them together. The result is easy to calculate. 115.
Now try it in the opposite direction. Break down e.g., 143 into both its prime numbers! That is much harder - the only thing you can do is try all the possibilities (btw, the answer is 11 times 13).
There is actually no more efficient method known for cracking the RSA algorithm than trying out all the possibilities one by one. Fast computers are able to find out the answer with smaller numbers, but with really large numbers they would need hundreds of years to work through all the possibilities.
Here is a detailed example using the prime numbers 3 and 7. We multiply them together and get 21 (this is referred to as the "RSA module"). It would be nice if we could use the key pair (3, 21) as the public key and (7, 21) as the private key. However, this would be too easy because everyone can calculate 7 from the key pair 3 and 21. In doing so, they would already have cracked the private key. So we will need to "hide" the 3 and 7. If we subtract 1 from both numbers, we get 2 and 6. Multiply them together and get 12. Now we choose any number smaller than 12 (and also prime) Let's take e.g. 5. The public key would then be (5, 21). The variable x of the private key is calculated according to the following equation: 5x + 12k = 1; this gives us x=17 as the solution (if k=–7). The private key is the (17, 21). We can forget the numbers 3, 7 and 12 in the meantime.
Now we want to encrypt a hash value, e.g. the value 4. (The hash value must be smaller than the RSA module 21.) We use the private key (17, 21) and calculate 417. This gives us 17,179,869,184. Now we divide this number by 21. This returns 818,089,008 -- but we are only interested in the remainder, which is 16. That is our result.
The recipient receives the value 16 and the public key (5, 21). First, he calculates 165, which gives him 1,048,576. This number is then divided by 21. This returns 49,932 (not needed), with a remainder of 4. Bingo!
Back to the citizen card. It uses asymmetric encryption, so it has a private and public key. With signatures, this principle is used in the other direction: Although the public key is used for encryption, the private key is used for the signature.
This seems backwards at first glance: anything that had been locked with the private key could be unlocked with the public key again. However, with signatures, the goal is not secrecy, but rather the authenticity (or integrity): If the text can be decrypted with the public key, this proves that the text was encrypted with the respective private key.
The recipient receives the actual text, a signed hash value and the sender's certificate. First, the authenticity of the certificate is determined by verifying the signature. Then the recipient decrypts the hash value using the public key. Next, the hash value is calculated from the text again. If both hash values match, then this proves that:
Before the e-card is activated, it has by default:
Upon activation, the following happens:
The most important thing in order for the citizen card to really be accepted and used as personal electronic identification is the ability to verify the user's identity beyond all doubt. Nothing would be worse than a mix-up (e.g. due to people having the same name). The identity link was invented in order to prevent this from happening. It is based on the CRR number(?), which is calculated into a source PIN.
An example of how this calculation works
Take the following CRR number(?) as an example: 000247681888. First, this number is converted to hexadecimal format. 000EC35360 (40 Bit). In order to encrypt the number using Triple-DES(?), it needs to be expanded to 128 Bit. To do this, a "seed" value is used as a "filler" (as follows: number seed number number).
The seed value must be 8 Bits long. It is secretly chosen by the SourcePIN Register Authority(?). (Deep in detail: for security reasons, the seed should be as short as possible. That's why 24 Bit seeds are not expanded to 64 Bit, but to 128 Bit instead.)
In our example, we choose FF as the seed and get back: 000EC35360 FF 000EC35360 000EC35360.
This value is then encrypted using Triple-DES (in CBC mode) (using the secret key from the SourcePIN Register Authority); the result is: 42 AD 37 74 FA E0 70 7B 31 DC 6D 25 29 21 FA 49. In order to save memory space, this number is coded as Base64(?): Qq03dPrgcHsx3G0lKSH6SQ==. This is the source PIN.
It is not possible to calculate the CRR number from the source PIN.
The source PIN is written together with the name, date of birth and public key of the qualified certificate in an XML file. The XML file is signed by the SourcePIN Register Authority, and the result is the actual identity link. This is saved directly on the e-card, or with mobile phones, on a high-security data server at A-Trust.
The Electronic Signature Act (SigG) defines an advanced electronic signature as follows:
As stated directly in the SigG: an electronic signature as used with the citizen card |
To fulfill requirements of the citizen card | |
|---|---|---|
| § 2. 3. a) | is uniquely linked to the signatory, |
The certificate is only issued to one person |
| § 2. 3. b) | capable of identifying the signatory, |
The name of the person is written in the certificate. |
| § 2. 3. c) | is created using means that the signatory can maintain
under his sole control; |
|
| § 2. 3. d) | is linked to the data to which it relates in such a manner that any subsequent change of the data is detectable and |
The hash value. |
and a qualified electronic signature:
| As stated directly in the SigG: | To fulfill requirements of the citizen card | |
|---|---|---|
| § 2. 3a. | is based on a qualified certificate and is created using technical components and procedures which comply with the security requirements of the present federal law and the orders issued on the basis thereof. |
|