]> de.git.xonotic.org Git - xonotic/d0_blind_id.git/blob - d0_blind_id.txt
fix build of rijndael lib
[xonotic/d0_blind_id.git] / d0_blind_id.txt
1 Blind-ID library for user identification using RSA blind signatures
2 Copyright (C) 2010  Rudolf Polzer
3
4 Cryptographic protocol description
5
6 Each user identifies by an ID, signed by a certificate authority owning a
7 private key.
8
9 Common parameters:
10         - a security parameter k (sized to be viable for a RSA modulus)
11         - a small parameter k0 (for Schnorr identification)
12         - a prime p of size k-1, where (p-1)/2 is a prime too
13         - a generator g of a cyclic multiplicative subgroup of G of Z_p (i.e. a
14           square in Z_p); in our implementation, this is always 4; this group has
15           order (p-1)/2
16         - a hash function h: bitstring -> bitstring of short output; in our
17           implementation, this is SHA-1
18         - for each n, a hash function h': Z_n -> Z_n; in our implementation, this
19           is given below
20         - for each n > p, a canonical injection I from Z_p to Z_n
21
22 A public key consists of:
23         - a RSA modulus n of size k, where n > p
24         - a RSA public key e; in our implementation, we always choose 65537
25         - the "fingerprint" is base64(SHA1("n || e"))
26
27 A private key additionally consists of:
28         - a RSA private key d
29
30 A public ID consists of:
31         - a value S in G
32         - a value H = h'(I(S)) in Z_n
33         - the "fingerprint" is base64(SHA1("S"))
34
35 A private ID additionally consists of:G
36         - a value s in [0, |G|[, with S = g^s in G
37
38
39
40 ID generation protocol:
41         - Client generates s in [0, |G|[ at random
42         - Client calculates S = g^s in G
43         - Client generates a camouflage value c in Z*_n at random
44         - Client sends x = c^e * h'(I(S)) in Z_n
45         - Server receives x
46         - Server sends y = x^d in Z_n
47         - Client receives y
48         - Client calculates H = y * c^-1 in Z_n
49
50 Note that this is a RSA blind signature - the value the server receives is
51 distributed uniformly in Z*_n, assuming h'(I(S)) is member of Z*_n which we can
52 assume it is (otherwise we can find a factorization of the RSA modulus n).
53 H obviously fulfills H = h'(I(S)) in Z_n. The goal of this is to make it
54 impossible for the server to know the ID that has been signed, to make the ID
55 not traceable even if the server identifies the user performing the signing.
56
57
58
59 Authentication protocol:
60         Client provides a message m that is to be signed as part of the protocol
61         "start":
62         - Client sends S, H if this is the first round of the protocol
63         - Client generates r in [0, |G|[ at random
64         - Client sends x = h("g^r || m || g^r")
65         - Client sends m in plain
66         "challenge":
67         - Server receives S, H if this is the first round of the protocol
68         - Server verifies H = h'(I(S))
69         - Server receives x, m
70         - Server generates c in [0, 2^k0[ at random
71         - Server generates R in [0, |G|[ at random
72         - Server sends c and g^R
73         "response":
74         - Client receives c and g^R
75         - Client verifies that the received values are in the allowed ranges
76         - Client sends y = r + s * c mod |G|
77         - Client calculates K = (g^R)^r
78         "verify":
79         - Server receives y
80         - Server calculates z = g^y S^-c
81         - Server calculates x' = h("z || m || z")
82         - Server verifies x == x'
83         - Server calculates K = z^R
84
85 Protocol variant: g and G can be also part of the public ID. In this case, g
86 and G are sent as part of this protocol additionally to S, H.
87
88 The protocols executed here are RSA signature, Schnorr identification and a
89 Diffie Hellmann key exchange at the same time. The DH key exchange generates
90 the same values on both sides only if the Schnorr identification scheme
91 succeeds. If the protocol succeeds, the authenticity of m has been verified
92 too.
93
94
95
96 Low level protocol:
97         - "VLI" are sent in the format:
98           - a sequence of bytes <cont> <b0..b6> in little endian order (one
99             continuation bit + 7 bits per byte)
100           - terminated by cont == 0
101         - "packets" are sent in the format:
102           - VLI length
103           - data
104         - "numbers" are sent in the format:
105           - packet of the number's digits in big endian order, preceded by a sign
106         byte (0x03 = negative, 0x01 = positive, 0x00 = zero)
107         - all values are sent as "numbers", except for x which is sent raw
108         - strings (m) are sent as "packets"
109         - the || operation inside double quotes is defined in terms of this
110           protocol, so h(z || m || z) actually encodes z as a "number" and m as a
111           "packet"
112         - a value in double quotes is also defined in terms of this protocol, i.e.
113           the length is preceded