使用乱码电路的蟒蛇图书馆
gabes的Python项目详细描述
简介
混乱的电路让两个不信任的人 计算一个联合函数,同时保持它们的输入是私有的。更准确地说, 它允许输入x的alice和输入y的bob计算函数 f(x,y)爱丽丝不知道y和鲍勃不知道x。方法 它首先将f转换成一个布尔电路 巧妙地混淆或garble电路以允许计算f 同时保持输入私有。
典型的例子是两个百万富翁想知道谁是 富有而不暴露自己的财富。在这种情况下,f变成“>;”(更大 函数,x和y是它们的财富。
gabes在python中实现乱码电路。应用程序作为命令运行 线路接口,但运行乱码电路所需的功能可在没有 命令行(参见gabes)。
安装
在命令行通过pip:
$ pip install gabes
或者,如果安装了virtualenvwrapper:
$ mkvirtualenv gabes $ pip install gabes
用法
各方将在其计算机上运行自己的程序实例作为cli应用程序。 Garbler将提供IP和端口号以建立与 评估者。
注意
在连接两个不同的网络时,请确保打开端口。
garbler一侧:
gabes -g -grr3 -c Desktop/my-circuit.circuit -a localhost:5000
evaluator一侧:
gabes -e -grr3 -a localhost:5000
标志
usage: gabes [-h] [-g] [-e] [-b bits] [-i identifier [identifier ...]] [-c file] -a ip:port [-cl] [-pp] [-grr3] [-free] [-grr2] [-fle] [-half] Program to garble and evaluate a circuit. optional arguments: -h, --help show this help message and exit -g, --garbler Set this flag to become the garbler -e, --evaluator Set this flag to become the evaluator -b bits, --bits bits Include your private input bitstring to the circuit (e.g. 001011) -i identifier [identifier ...], --identifiers identifier [identifier ...] Indicate which input wires you supply to the circuit (e.g. -i A C D) -c file, --circuit file Path of the file representing the circuit. Only the garbler needs to supply the file -a ip:port, --address ip:port IP address followed by the port number -cl, --classical Set this flag for classical garbled circuits -pp, --point-and-permute Set this flag to include point-and-permute -grr3, --grr3 Set this flag for GRR3 garbled circuits -free, --free-xor Set this flag for free-xor garbled circuits -fle, --flexor Set this flag for flexor garbled circuits -half, --half-gates Set this flag for half gates garbled circuits