我正在尝试实现 this paper 中提出的协议(protocol)(第 3.2 节)。我最近开始研究同态加密和 Paillier。因此,我的问题可能太简单了,但我无法以任何方式解决问题。
论文说:
“那么Paillier密码系统满足所有要求 计算欧几里德距离的加密平方。 因此,方程(3)可以分解为……”
...这个方程:
但是,我不知道如何计算第三部分。我用过Kun Lui's Paillier implementation在 Java 中,还遵循以下 power 方法:
public static BigInteger power(BigInteger m, BigInteger i) {
BigInteger result = m;
while(i.compareTo(BigInteger.ONE) != 0){
result = result.multiply(m);
i = i.subtract(BigInteger.ONE);
}
return result;
}
不幸的是,第三部分无法计算成功:
// Part I
BigInteger esumsqr_p = paillier.Encryption(p1.multiply(p1).add(p2.multiply(p2)));
// Part II
BigInteger esumsqr_q = paillier.Encryption(q1.multiply(q1).add(q2.multiply(q2)));
// Part III
BigInteger esum_pq = power(eq1, new BigInteger("-2").multiply(p1)).multiply(power(eq2, new BigInteger("-2").multiply(p2)));
如果您能帮我解决这个问题,我将不胜感激。预先感谢您。
最佳答案
关于java - 用于安全计算欧几里德距离平方的 Paillier 密码系统和协议(protocol),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34549822/