Skip to content

匿名凭证 (Anonymous Crendials)


1. 由来

一般认为匿名凭证来自上世纪80年代 Chuam 提出的一个构想1,一直到 1999 年,首次出现假名系统2 (pseudonym system) 这个概念。真正意义上的实现,应该是在 2001 年 Jan Camenisch 等人在欧密会上发表的一篇文章3,这个方案是基于强RSA假设的。 提出的 anonymous credentials,中文翻译过来即匿名凭证。

2 构造

2.1 CL 2001

Quote

(1): We give the first practical solution that allows a user to unlinkably demonstrate possession of a credential as many times as necessary without involving the issuing organization.

(2): To prevent misuse of anonymoity, our scheme is the first to offer optional anonymity revocation for particular transactions.

(3): Our scheme offers separability: all organizations can choose their cryptographic keys independently of each other.

这个构造方案使用了大量的 零知识证明。首先,简单说下 零知识证明 的基本表示方法:4

PK\{(\alpha, \beta, \gamma):y=g^\alpha h^\beta \wedge \tilde{y}=\tilde{g}^{\alpha}\tilde{h}^{\gamma}\wedge (u\leq \alpha \leq v) \}

这个式子表明对 \alpha, \beta, \gamma 满足 y=g^\alpha h^\beta\tilde{y}=\tilde{g}^{\alpha}\tilde{h}^{\gamma} 的零知识证明,其中 u\leq \alpha \leq v

这里的 \alpha, \beta, \gamma 就是知识y, g, h 都属于公开的信息。

通过使用 Fiat-Shamir heuristic 5,可以将一个 零知识证明协议 转换成一个 签名机制。可以简单记作:

SPK\{(\alpha):y=g^\alpha\}(m)

如何实现零知识证明:PK\{(\alpha):y=g^\alpha\}
  1. P chooses v\leftarrow_R \mathbb{Z}_q^*, sends t=g^v to V.
  2. V chooses c\leftarrow_R \mathbb{Z}_q^*, sends c to P.
  3. P computes r=v-cx(\mbox{mod}\ q), sends r to V.
  4. V accepts iff t=g^ry^c.

Fiat-Shamir heuristic

在最初的零知识证明体系中,第二步中的 c 是由 V 选取的。Fiat-Shamir heuristic 的核心就是利用哈希函数让 P 给出 c,这样可以减少交互次数9

  1. P chooses v\leftarrow_R \mathbb{Z}_q^*, computes t=g^v, c=H(t).
  2. P computes r=v-cx(\mbox{mod}\ q), sends (t,r) to V.

如果要签名一个消息 m 的话,只需要令 c=H(t,m) 即可。

大致有这么三类实体:

  • users (签名者,凭证的使用者,signer)
  • organizations (用来签发凭证, 也称为 issuer)
  • verifiers (可以看做服务提供商,service provider)

user U 拥有自己的私钥 x_U,其从 organization O 处获得的假名为 N_{(U,O)}

Step1. 初始化

Organization O_i 选择 p_{O_i},q_{O_i},并将其作为私钥 SK_{O_i} 保存。然后可以生成公钥 PK_{O_i}:=(n_{O_i},a_{O_i},b_{O_i},d_{O_i},g_{O_i},h_{O_i})

Note

公钥 PK_{O_i} 中,除了 n_{O_i}=p_{O_i}q_{O_i},其它四个都是随机生成的。

Step2. 生成假名

User U 可以从 O 那里获取假名 N_{(U,O)} 以及相对应的 tag P_{(U,O)}, 其中 P_{(U,O)}=a_O^{x_U}b_O^{s_{(U,O)}}

这里 x_UU 的私钥,而 s_{(U,O)} 则是由 UO 共同生成的,但只有 U 知道 s_{(U,O)} 的值。最后 O 将保存 用户假名 N_{(U,O)}P_{(U,O)} 以及 P_{(U,O)}^2U 将会得到 N_{(U,O)}P_{(U,O)}^2P_{(U,O)}s_{(U,O)}

Protocol 1
  1. U chooses N_1r_1,r_2,r_3, and sets C_1:=g_O^{r_1}h_O^{r_2}, C_2:=g_O^{x_U}h_O^{r_3}. Then U sends N_1, C_1, C_2 to V.
  2. U serves as the prover to verifier O in PK\{(\alpha, \beta, \gamma, \delta): C_1^2=(g_O^2)^\alpha (h_O^2)^\beta \wedge C_2^2=(g_O^2)^\gamma (h_O^2)^\delta\}
  3. O chooses r, N_2, and sends r, N_2 to U.
  4. U sets pseudonym N_{(U,O)}:=N_1||N_2. U computes s_{(U,O)}=(r_1+r_2 mod l'). Then U sets the tag P_{(U,O)}:=a_O^{x_U}b_O^{S_{(U,O)}} and sends P_{(U,O)} to O.
  5. U proves the values in 4 were chosen correctly by using PK{(...):...}

Step3. 生成凭证

用户可以凭借假名和tag来获取凭证 (c,e), 并且其满足 P_{(U,O)}d_{O}=c^e

Protocol 2

1. 2. 3.

Step4. 使用凭证

用户使用一个凭证如 (P_{(U,O)},c_{(U,O)},e_{(U,O)}), 并向 V 证明其拥有的凭证是合法的。

Protocol 3

1. 2.

Step5. 证明其是某个凭证的拥有者

用户向 O 证明其拥有的凭证 (P_{(U,O)},c_{(U,O)},e_{(U,O)}) 对应的假名是 N_{(U,O)}

Protocol 4

1. 2.

此方案可以看做第一个真正意义上实现匿名凭证相关协议的方案。在该方案提出一年后 (2002年), Camenisch 等人设计出了基于该协议的原型,即 Idmix 系统。这种方案使用了大量的零知识证明,后来的许多方案也延续了这种模式。


2.2 Blanton 2008

这篇文章6的目的是构造一个匿名获取在线服务的方案,没有直接提及 anonymous credential。此方案使用了 Camenisch-Lysyanskaya (CL) signature scheme7,这种签名机制依赖于双线性对 (bilinear pairing)。

CL-Signature
  1. KeyGen: Generate (q,\mathbb{G},\mathbb{G_T},g,e). Choose s,u\leftarrow_R\mathbb{Z_q}. Set secret key sk=(s,u), public key pk=(q,\mathbb{G},\mathbb{G_T},g,e,g^s,g^u).
  2. Sign: For a message m, choose \alpha\leftarrow_R\mathbb{Z_R} and set a=g^\alpha. The signature \sigma=(a_1,a_2,a_3)=(a,a^u,a^{s+sum}).
  3. Verify: To verify a signature (a_1,a_2,a_3) on message m,check:
    • e(a_1,g^u)=e(a_2,g)
    • e(a_1,g^s)e(a_2,g^s)^m=e(a_3,g)

在介绍其具体的机制之前,我们先回顾一下 承诺机制 (commitment scheme):

  • Pedersen Commitment: Com(x,r)=g^xh^r
    • perfectly hiding, computationally binding
  • ElGamal Commitment: Com(x,r)=(g^xh^r,g^r)
    • computationally hiding, perfectly binding

Step1. 初始化

服务商 (server) S 初始一个双线性对 (q,\mathbb{G},\mathbb{G}_T,g,e),随机生成 s,u,z_1,z_2,z_3。那么私钥 sk=(s,u,z_1,z_2,z_3),公钥为pk=(q,\mathbb{G},\mathbb{G_T},g,e,g^s,g^u,g^{z_1},g^{z_2},g^{z_3})

Step2. 订阅 (Subscribe)

  1. 用户 U 与 服务商 S 首先协商好服务的类型 (subscriptio type) t 与 失效的日期 (expiration date) d
  2. 用户 U 随机选取 m_U,r,并把对 m_U 的承诺结果发送给 S,且利用零知识证明其确实拥有 m_U,r。即 PK\{(\alpha,\beta):M=g^\alpha(g^{z_1})^\beta\}
  3. S 选取 m_S,将其发送给 U,并计算 M'=Mg^{mS}。可以看出,M' 就是 m=m_U+m_S的承诺值。Mg^{m_S}=g^\alpha(g^{z_1})^{\beta}g^{m_S}=g^{m_U+m_S}(g^{z_1})^\beta
  4. S 利用 CL-signature,生成对 m,t,d的签名 \sigma=(a_1,a_2,a_3,a_4,a_5,a_6,a_7,a_8,a_9)

生成对 m 的签名

这里生成对 m 的签名,但 S 实际上并不知道 m 的具体内容。但它可以利用 m 的承诺值 M 来计算出签名的结果。(盲签名??)

Step3. 访问 (Access)

U 需要做的两件事:

  • 一是证明 \sigma 确实是对 m,t,d 的合法签名
  • 二是证明 d\geq t_{curr}

S 需要完成两件事:

  • 一是 m 没有被使用过
  • 二是 帮助 U 生成一个新的 token

token

这里的 token 指的就是 mm 只能用一次,每用完一次需要重新生成。而 m 是由 m_Um_S 共同组成的,因此这个过程需要与 server 交互。

总结

这个方案虽然只讨论 user 与 server 之间的交互,但由于其具备匿名性等特点,也可以用来构造匿名凭证系统。单纯使用签名机制虽然可以满足可验证性,但是不具备匿名的特点。如果在签名方案的基础上结合零知识证明,可以构造出一个匿名凭证的方案。


2.3 AMO 2008

同样是2008年的文章8,它是基于 Okamoto 提出的签名方案12

Okamoto Signature Scheme

两个同构的群 \mathbb{G_1},\mathbb{G_2},且 \psi(g_2)=g_1

Setup: Choose g_2,u_2,v_2\leftarrow_R \mathbb{G_2},set g_1\leftarrow\psi(g_2),u_1\leftarrow\psi(u_2),v_1\leftarrow\psi(v_2); Choose x\leftarrow_R\mathbb{Z}_p^* as the private key, w_2=g_2^x is the public key, public paprameter is (\mathbb{G_1},\mathbb{G_2},\mathbb{G_T}),\psi,e,g_1,g_2,u_2,v_2

Sign: choose r,s\leftarrow_R\mathbb{Z}_p^*, compute \sigma=(g_1^mu_1v_1^s)^{1/(x+r)}.

Verify: check e(\sigma,w_2g_2^r)=e(g_1,g_2^mu_2v_2^s)


Step1. Issue

User U 与 authority Auth 进行交互,其实可以看做是签名的过程。 UAuth 发送了信息 m,然后收到 Auth 返回的签名 (\sigma,r,s)。此签名过程为上面提到的 Okamoto Signature 方案,即 \sigma=(g_1^mu_1v_1^s)^{1/(x+r)}

为了方便说明,记 \alpha=w_2g_2^r, \beta=g_2^mu_2v_2^s,因此只要验证 e(\sigma,\alpha)=e(g_1,\beta) 是否成立。


Step2. Prove

User U 与 verifier V 的交互。那么什么是凭证?

如果把 (\sigma,r,s) 看做是 对 m 的一个凭证。U 要做的就是确保在不告诉 \sigma 的情况下,通过验证。

U 首先随机选取两个数 t,\theta\leftarrow_R\mathbb{Z}_p^*,把 (\sigma,\alpha,\beta) 变成 (\sigma',\alpha',\beta'),即

\sigma'=\sigma^{t/\theta}, \alpha'=\alpha^{\theta}, \beta'=\beta^{t}

然后发送 (\sigma',\alpha',\beta')V

另外, U 需要使用 ZPK 来证明 \alpha' 确实是 \alpha\theta 次方, \beta'\betat 次方,即

PK\{(\theta,r\theta): \alpha'=w_2^\theta g_2^{r\theta},\theta\neq0\}, PK\{(t,st): \beta'=(g_2^m)^tu_2^gv_2^{st},t\neq0\}

这个构造非常简洁,可以保证一些基本的性质 (Unforgeability, Anonymoity, Unlinkability),但是没有 revocation 。下面给出了提供 Revocation 的方案。


Quote

One of the most efficient existing anonymous credential systems is the CamenischLysyanskaya system7 that is secure under the LRSW assumption for groups with bilinear maps. However, this system lacks a credential revoking protocol. ...

这篇文章主要着重于 撤销,大致把撤销方式分为了两类:

  • Blacklisting
  • Identity Revealing

上面提到的第一个构造方案 (CL 2001) 就是采取 identity revealing,使用 blakclist 的方式最早可见 2007年的这篇文章10

两种方案的区别

最大的区别在于 ID-Reveal 的方案引入了一个新的第三方 Opener (在CL013这篇文章中称作revocation manager),这个第三方可以还原出用户的真实身份。

Blacklisting

进行验证时,V 检查 P 是否在黑名单列表中,如果是,直接拒绝。

Identity revealing

V 发现了恶意用户时,向 Opener 提交信息,然后 Opener 可以还原出用户的 ID,CA 可以通过 ID 废除该用户的公钥。


方案二.Step1. Keygen

Auth 选择 h,\hat{h},a_2\leftarrow_R\mathbb{G_2},提供证明 PK\{x:w_2=g_2^x\} 来获取一个证书。

向谁证明?

这里获取证书,应该是向 CA 证明

由于需要带上 revication 的特性,因此 UO 都需要自己一对密钥。

U 的私钥 sk_Uq\leftarrow_R\mathbb{Z}_p^*,公钥 pk_Ug_2^q

O 的私钥为 \xi_1,\xi_2\leftarrow_R\mathbb{Z}_p^*,公钥为 \mathcal{U}=g_2^{\xi_1},\mathcal{V}=g_2^{\xi_2}


方案二.Step2. Issue

UAuth 获取凭证,首先对自己的公钥进行签名,发送 (g_2^q,sig_U(g_2^q),m)Auth

Auth 使用 g_2^q 验证签名的正确性,并对发送过来的 m 进行签名,得到 (\sigma,r,s) 作为 凭证 发送给 U

U 只要通过验证 e(\sigma,\alpha)=e(g_1,\beta) 是否成立来判断 凭证的有效性。

Auth 就可以把 (\sigma,r,s,m,g_2^q,sig_U(g_2^q)) 写入数据库。


方案二.Step3. Prove

UV 交互的过程,而且 U 不需直接提供 (\sigma,r,s)

如果是 blacklisting 的模式, V 都有一份 black list,这里面记录的是用户的公钥,如 \mathsf{BL}=(b_1,b_2,...,b_l), 其中 b_i=g_2^{q_i} (1\leq i\leq l)

与简易版的方案类似,只不过多了一些参数。

U 选择 t_1,t_2,\theta,\rho\leftarrow_R\mathbb{Z}_p^*f,\hat{f}\leftarrow_R\mathbb{G}_1, 发送 (\sigma',\alpha',\beta',d_1,d_2,\chi,f,\hat{f},g_2^\rho)V,其中

\sigma'=\sigma\cdot g_1^{t_1+t_2}, \alpha'=\alpha^\theta, \beta'=\beta^\theta\cdot\alpha'^{t_1+t_2}, d_1=\psi(\mathcal{U})^{t_1}, d_2=\psi(\mathcal{V})^{t_2}, \chi=f^q\hat{f}^\rho

并且需要证明 PK\{(q,\rho,\theta,r\theta,s\theta,t_1,t_2): \chi=f^q\hat{f}^\rho, \alpha'=\alpha^\theta, \beta'=\beta^\theta\cdot\alpha'^{t_1+t_2}, d_1=\psi(\mathcal{U})^{t_1}, d_2=\psi(\mathcal{V})^{t_2}, \theta\neq 0\}


方案二.Step4. Reveal

O 可以通过 (\sigma', d_1, d_2) 来还原 U 的真实身份。

只需要计算 \sigma=\frac{\sigma'}{d_1^{1/\xi_1}d_2^{1/\xi_2}},再通过查找数据库就可以得到 (\sigma, r, s, m, g_2^q, sig_U(g_2^q))

O 只需要向 V 证明其身份的有效性:

PK\{(\xi_1,\xi_2): \mathcal{U}=g_1^{\xi_1}, \mathcal{V}=g_2^{\xi_2},\sigma=\frac{\sigma'}{d_1^{1/\xi_1}d_2^{1/\xi_2}}\}

同时 V 也可以验证 (\sigma, r, s, m, g_2^q, sig_U(g_2^q)) 的有效性。


总结

这篇文章对凭证的理解, 凭证 可以看做一个签名,然后证明这个凭证是有效的,即 证明一个签名是有效的, 这个可以通过 零知识证明的方法。

比如 PV 进行匿名交涉, PV 证明拥有某个属性的签名, 如 \sigma

这里需要做的就是把 \sigma 转换成 \sigma',然后通过零知识证明, 使得 V 相信 \sigma' 的确是由 \sigma 转换过来的。

上面所有提到的 m 可以看做一个属性, 如 已经大于18岁, 而 user 要做的就是从 Auth 获取对该属性的签名 \sigma, 然后在不直接展示这个签名的情况下, 来证明自己拥有此签名。


3. GS-proof 2008

如何有效地完成 零知识证明 呢? 针对这个问题, 2008 年 Groth 与 Sahai 共同提出了一个针对 双线性对的非交互的零知识证明方案13。Belenkiy, Chase, Kohlweiss,Lysyanskaya 等人在同年利用此方案提出了新的匿名凭证机制14


4. P-signature 2008

基于 GS-proof, Belenkiy 等人构造了 P-signature 的方案14

Quote

A P-signature scheme consists of a signature scheme, a commitment scheme, and

  1. an interactive protocol for obtaining a signature on a committed value;
  2. a non-interactive proof system for proving that the contents of a commitment has been signed;
  3. a non-interactive proof system for proving that a pair of commitments are commitments to the same value.

P-signature 就是指

  1. 在已知 \mathsf{commit}(m) 的情况下产生一个对 m 的签名 \sigma
  2. 构建一个对 (\mathsf{commit}(m),\sigma) 的零知识证明;
  3. 证明不同的 \mathsf{commit}(m) 都对应的同一个值 m

Step1. 初始化

\mathsf{SigSetup}(1^k),生成有关 bilinear pairing 的一系列参数: (p,G_1,G_2,G_T,e,g,h), 令 z=e(g,h)

Step2. 生成密钥

\mathsf{Keygen}(params),随机选取\alpha,\beta\leftarrow_R\mathbb{Z}_p 作为私钥, 那么公钥为 (v,w,\tilde{v}),\tilde{w}, 其中 v=h^\alpha,w=h^\beta,\tilde{v}=g^\alpha,\tilde{w}=g^\beta

Step3. 签名

\mathsf{Sign}(params,(\alpha,\beta),m), 随机选取 r\leftarrow_R\mathbb{Z}_p-\{\frac{\alpha-m}{\beta}\},计算 C_1=g^{1/(\alpha+m+\beta r)},C_2=w^r,C_3=u^r

Step4. 验证

\mathsf{VerifySig}(params,(v,w,\tilde{v},\tilde{w}),m,(C_1,C_2,C_3)),计算 e(C_1,vh^mC_2)=z, e(u,C_2)=e(C_3,w) 是否成立。


要利用这个签名机制来完成 P-signature 还需要结合 GS-proof。

Special-1. 获取凭证

comm\leftarrow\mathsf{Commit}(params,m,open)

\mathsf{ObtainSig}(params,pk,m,comm,open)\leftrightarrow\mathsf{IssueSig}(params,sk,comm)

简单说下这三个算法,第一个比较简单,user U 用来生成 m 的承诺值 comm

后两个算法是 UAuth 交互的过程,可以使用 secure two-party computation 来实现。

通过这个交互, U 可以获取到关于 m 的签名 \sigma

Special-2. 证明

(comm,\pi,open)\leftarrow\mathsf{Prove}(params,pk,m,\sigma)

User U 根据 m,\sigma 来生成关于 \sigma 的零知识证明 \pi

VerifyProof(params,pk,comm,\pi)

Verifier V 根据 \picomm,来判断此零知识证明是否有效。

匿名凭证是什么?

从这个构造里,我们来勾勒一下匿名凭证的轮廓:

首先,还是三类群体, PIssuerV。其中 Issuer 有一对密钥,并且使用私钥签名,其它群体可以使用公钥进行验证;

P 如果想要获取某一凭证,可以向 Issuer 获取,凭证就是 (\sigma,m) 的一个元组;

如果大家都是诚实的, P 可以跟 Issuer 交互,得到 (\sigma,m);然后 P 可以把 (\sigma,m) 递交给 VP 可以使用 Issuer 的公钥进行验证;

直接这样做的话, P 暴露了太多的信息? 因此常规的做法是利用 commitment scheme 把 m 转换成 m',从而利用 m' 来获取一个签名 \sigma。这里 \sigma 是在 m 上的签名。

验证就是为了完成两件事, m'm 的一个承诺值; \sigmam 的一个签名。

现在只剩下两个问题, V 既然不知道 m, 怎么来断定 U 是否满足某种权限? Issuer 既然也不知道 m, 怎么能保证 U 没有欺骗他?


5. Revocation

2008年以后,关于 anonymous credentials 的文章开始重点关注 revocation。首先是基于累加器的方案15

累加器?

累加器 (Accumulator),由 \mathsf{AccGen},\mathsf{AccAdd},\mathsf{AccUpdate},\mathsf{AccWitUpdate},\mathsf{AccVerify} 这5个算法组成,这些算法由 the accumulator authority, an untrusted update entity, user,verifier 来使用。

((sk_A,pk_A),acc_{\phi},state_\phi)\leftarrow\mathsf{AccGen}(1^k,n)

(acc_{V\cup\{i\}},state_{U\cup\{i\}},wit_i)\leftarrow\mathsf{AccAdd}(sk_A,i,acc_V,state_U)

acc_V\leftarrow\mathsf{AccUpdate}(pk_A,V,state_U)

wit'_i\leftarrow\mathsf{AccWitUpdate(pk_A,wit_i,V_w,acc_V,V,state_U)}

\mathsf{AccVerify}(pk_A,i,wit_i,acc_V)


  1. D. Chaum, “Security without identification: Transaction systems to make big brother obsolete,” Communications of the ACM, vol. 28, no. 10, pp. 1030–1044, 1985. 

  2. A. Lysyanskaya, R. L. Rivest, A. Sahai, and S. Wolf, “Pseudonym systems,” in International Workshop on Selected Areas in Cryptography, 1999, pp. 184–199. 

  3. J. Camenisch and A. Lysyanskaya, “An efficient system for non-transferable anonymous credentials with optional anonymity revocation,” in International Conference on the Theory and Applications of Cryptographic Techniques, 2001, pp. 93–118. 

  4. J. Camenisch and M. Stadler, “Efficient group signature schemes for large groups,” in Annual International Cryptology Conference, 1997, pp. 410–424. 

  5. A. Fiat and A. Shamir, “How to prove yourself: Practical solutions to identification and signature problems,” in Conference on the Theory and Application of Cryptographic Techniques, 1986, pp. 186–194. 

  6. M. Blanton, “Online subscriptions with anonymous access,” in Proceedings of the 2008 ACM symposium on Information, computer and communications security, 2008, pp. 217–227. 

  7. J. Camenisch and A. Lysyanskaya, “Signature schemes and anonymous credentials from bilinear maps,” in Annual International Cryptology Conference, 2004, pp. 56–72. 

  8. N. Akagi, Y. Manabe, and T. Okamoto, “An efficient anonymous credential system,” in International Conference on Financial Cryptography and Data Security, 2008, pp. 272–286. 

  9. https://www.cs.jhu.edu/~susan/600.641/scribes/lecture11.pdf 

  10. P. P. Tsang, M. H. Au, A. Kapadia, and S. W. Smith, “Blacklistable anonymous credentials: blocking misbehaving users without ttps,” in Proceedings of the 14th ACM conference on Computer and communications security, 2007, pp. 72–81. 

  11. D. Boneh, X. Boyen, and H. Shacham, “Short group signatures,” in Annual International Cryptology Conference, 2004, pp. 41–55. 

  12. T. Okamoto, “Efficient blind and partially blind signatures without random oracles,” in Theory of Cryptography Conference, 2006, pp. 80–99. 

  13. J. Groth and A. Sahai, “Efficient non-interactive proof systems for bilinear groups,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques, 2008, pp. 415–432. 

  14. M. Belenkiy, M. Chase, M. Kohlweiss, and A. Lysyanskaya, “P-signatures and noninteractive anonymous credentials,” in Theory of Cryptography Conference, 2008, pp. 356–374. 

  15. J. Camenisch, M. Kohlweiss, and C. Soriente, “An accumulator based on bilinear maps and efficient revocation for anonymous credentials,” in International Workshop on Public Key Cryptography, 2009, pp. 481–500.