【密码学基础】混淆电路(Garbled Circuit)

1 概念

  • 混淆电路是一种密码学协议,以实现安全多方计算(MPC)。场景是当多个通信方需要共同输入数据,然后通过同一个函数计算出一个结果,但是,各个通信方都不允许其他人知道自己的输入是什么。混淆电路就能很好地解决这个问题。
  • 补充:可计算函数都可转化为电路的实现:加、比较、乘法等。电路是由门(gate)组成,如与门、非门、或门、与非门等。
  • 混淆电路通过加密和扰乱电路值来掩盖真实的输入信息,加密和扰乱是以门为单位,每个门都有一张真值表。
  • 混淆电路(GC) = 不经意传输(OT) + 逻辑电路

2 流程

本文以与门为例介绍混淆电路的算法流程。Alice和Bob两方分别拥有数据 X X X Y Y Y(0或1),现在希望双方都不知道对方数据的情况下,计算出逻辑与的结果 Z Z Z

Step 1:Alice生成混淆电路

首先,Alice将目标函数转化为布尔电路,然后生成一张与门的 真值表(true table):
在这里插入图片描述
然后,随机生成6个数 X 0 , X 1 , Y 0 , Y 1 , Z 0 , Z 1 X_0, X_1, Y_0, Y_1, Z_0, Z_1 X0,X1,Y0,Y1,Z0,Z1对真值表进行替换。注: X 1 X_1 X1表示替换 X = 1 X=1 X=1的位置,其他同理。于是有了下面这张 替换表
在这里插入图片描述
之后,Alice对替换表中的 Z Z Z进行连续两次对称加密(加密密钥和解密密钥相同)。如下图,加密密钥则是两个输入 X , Y X, Y X,Y,得到加密表:
在这里插入图片描述
然后,打乱各行,使加密表内容与行号无关(这里我交换了第2和第3行的顺序),最终得到 混淆表(garbled table)。 这也就是混淆电路中“混淆”二字的由来!
在这里插入图片描述

Step 2:Alice和Bob进行通信

Alice将自己的输入 X = n X=n X=n替换为为第一步生成的随机数 X n X_n Xn,发送给Bob,这样Bob就无从知晓Alice的真是输入到底是多少了。
然后,Bob也需要将手里的真实输入替换为第一步生成的随机数,怎么实现?通过不经意传输(OT)协议,从Alice手里获取对应的替换值 Y 1 / Y 0 Y_1/Y_0 Y1/Y0。注意!因为采用了1-out-of-2 OT协议,所以Bob只能取到 Y 1 , Y 0 Y_1, Y_0 Y1,Y0中的其一,并且Alice无从知晓Bob到底取走了哪个,从而无法知道Bob手里的真实值是多少。
随后,Alice也将混淆表发送给Bob进行后续的计算。

Step 3:Bob计算混淆电路

Alice和Bob完成上述的通信后(Alice替换真实值发给Bob,Bob从Alice手里取到对应替换值,Alice将混淆表发给Bob),Bob尝试进行电路解密。假设Alice真实输入是0,Bob真实输入是1,那么目前Bob已知的信息有 X 0 , Y 1 X_0, Y_1 X0,Y1两个数据。使用这两个值,对混淆表进行对称密钥解密,最终,只有第3行是可以解密出结果的!也就是 Z 0 Z_0 Z0。注意,这里解密出的 Z 0 Z_0 Z0仍是替换值,而只有Alice才知道替换的关系。

Step 4:Alice和Bob共享计算结果

Bob分享解密后的结果 Z 0 Z_0 Z0给Alice,Alice知道替换值与原始值的替换关系,所以可以快速替换回真实值,并且可以将最终的真实结果分享给Bob。

通过以上4个步骤,就在双方均不知道对方数据的情况下,顺利实现了共同计算同一个函数的功能。

总结

在这里插入图片描述
Alice端会生成布尔电路已经对应的真值表、替换表、加密表以及混淆表,发送给Bob的是替换值和混淆表,然后Bob通过OT协议拿到自己的替换值,从而对混淆表中的值进行解密。最后,将解密结果共享给Alice得到真值结果,最后双方共享真值结果。

参考资料:
混淆电路简介(GC)
MPC系列-混淆电路

  • 11
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
RedGate.SQL.Prompt.5.1完美破解版 SQL Prompt”充斥着的特点,采取日常工作与SQL出来的,离开你把重点放在棘手位。 当你写代码,SQL Prompt建议适当的关键字和查询对象。它甚至可以完成INSERT,ALTER和JOIN声明。为了减少重复输入,SQL Prompt下有一个广泛的,可定制的片段。 编辑您的SQL时,为了避免并发症,可以使用智能重命名,直接从查询编辑器的视图列依赖,并发现中风的无效对象。 格式化和脚本摘要,即使是最乱码的查询,点击几下可读。 SQL Prompt也向后兼容,因此它可以解决旧的数据库。 无论您需要的数据库代码编写,编辑,或探索,SQL Prompt使一切都毫不费力。 SQL Prompt - Provides intelligent code completion for SQL Server editors SQL Server developers and DBAs use SQL Prompt to: Write SQL smoothly, with code-completion and SQL snippets Check database structure at a glance, viewing column dependencies 'in query' Keep databases tidy by finding invalid objects automatically Work with current and older databases, thanks to backwards compatibility Do this and more with SQL Prompt Pro: Reformat SQL to a preferred style Summarize scripts Decrypt encrypted objects Smart rename to change the name any time an object appears in the database SQL Prompt is crammed with features that take the routine out of working with SQL, and leave you to focus on the tricky bits. When you're writing code, SQL Prompt suggests appropriate keywords and objects for queries. It can even complete INSERT, ALTER and JOIN statements. To cut down on repetitive typing, SQL Prompt has an extensive, customizable set of snippets. To avoid complications when editing your SQL, you can use smart renaming, view column dependencies straight from the query editor, and uncover invalid objects at a stroke. Reformatting and script summaries make even the most garbled queries readable in a few clicks. SQL Prompt is also backwards compatible, so it can tackle older databases too. Whether you need to write, edit, or explore database code, SQL Prompt makes everything effortless.
Hagel DU Meter 6.20.4628.0 破解补丁(不需断网) March 4, 2013 :: DU Meter 6.20 has been released. This update to version 6.x introduces several improvements and numerous bug fixes. New feature: Command-line access to DU Meter. It is possible to operate DU Meter's stopwatch from scripts and batch files. New feature: Clearing the DU Meter graph. If DU Meter's graph scaling or averaging gets in your way, you can clear the graph with just one click. New translation: Thanks to Pierluigi Callegarin, DU Meter is now available in Italian! Change in functionality: The less frequently used functions of DU Meter pop-up menu are demoted to a secondary (alternative) menu. It can be accessed by holding the SHIFT key while opening the pop-up menu. Improved performance and better error reporting. Numerous bug fixes and minor enhancements. If you already have version 6.x license, this upgrade is free. Otherwise, license upgrade is required. There is no need to uninstall, just install DU Meter 6.20 on top of your previous version. November 8, 2012 :: DU Meter 6.05 has been released. This minor update to version 6.x includes several important bug fixes: Compatibility issues with wlanapi.dll on Windows Server 2003 and Windows XP SP2 are resolved. SSD-preservation mode did not engage properly in some cases. You can see whether DU Meter is in reduced disk write mode by viewing DU Meter System Information (available from the About screen). Taskbar deskband text display was garbled on Chinese Windows 7 and on some Vista systems. Several localization-related fixes: problems with switching DU Meter interface back into English, non-localized taskbar deskband menu, etc. Several other minor bug fixes and improvements.
RedGate.SQL.Prompt.5.2.2.1最新完美破解版 SQL Prompt”充斥着的特点,采取日常工作与SQL出来的,离开你把重点放在棘手位。 当你写代码,SQL Prompt建议适当的关键字和查询对象。它甚至可以完成INSERT,ALTER和JOIN声明。为了减少重复输入,SQL Prompt下有一个广泛的,可定制的片段。 编辑您的SQL时,为了避免并发症,可以使用智能重命名,直接从查询编辑器的视图列依赖,并发现中风的无效对象。 格式化和脚本摘要,即使是最乱码的查询,点击几下可读。 SQL Prompt也向后兼容,因此它可以解决旧的数据库。 无论您需要的数据库代码编写,编辑,或探索,SQL Prompt使一切都毫不费力。 SQL Prompt - Provides intelligent code completion for SQL Server editors SQL Server developers and DBAs use SQL Prompt to: Write SQL smoothly, with code-completion and SQL snippets Check database structure at a glance, viewing column dependencies 'in query' Keep databases tidy by finding invalid objects automatically Work with current and older databases, thanks to backwards compatibility Do this and more with SQL Prompt Pro: Reformat SQL to a preferred style Summarize scripts Decrypt encrypted objects Smart rename to change the name any time an object appears in the database SQL Prompt is crammed with features that take the routine out of working with SQL, and leave you to focus on the tricky bits. When you're writing code, SQL Prompt suggests appropriate keywords and objects for queries. It can even complete INSERT, ALTER and JOIN statements. To cut down on repetitive typing, SQL Prompt has an extensive, customizable set of snippets. To avoid complications when editing your SQL, you can use smart renaming, view column dependencies straight from the query editor, and uncover invalid objects at a stroke. Reformatting and script summaries make even the most garbled queries readable in a few clicks. SQL Prompt is also backwards compatible, so it can tackle older databases too. Whether you need to write, edit, or explore database code, SQL Prompt makes everything effortless.
RedGate.SQL.Prompt.5.1.8.2最新完美破解版 Visual Studio 和 SQL Server Management Studio 均破解 RedGate SQL Prompt 5.1.8.2 SQL Prompt”充斥着的特点,采取日常工作与SQL出来的,离开你把重点放在棘手位。 当你写代码,SQL Prompt建议适当的关键字和查询对象。它甚至可以完成INSERT,ALTER和JOIN声明。为了减少重复输入,SQL Prompt下有一个广泛的,可定制的片段。 编辑您的SQL时,为了避免并发症,可以使用智能重命名,直接从查询编辑器的视图列依赖,并发现中风的无效对象。 格式化和脚本摘要,即使是最乱码的查询,点击几下可读。 SQL Prompt也向后兼容,因此它可以解决旧的数据库。 无论您需要的数据库代码编写,编辑,或探索,SQL Prompt使一切都毫不费力。 SQL Prompt - Provides intelligent code completion for SQL Server editors SQL Server developers and DBAs use SQL Prompt to: Write SQL smoothly, with code-completion and SQL snippets Check database structure at a glance, viewing column dependencies 'in query' Keep databases tidy by finding invalid objects automatically Work with current and older databases, thanks to backwards compatibility Do this and more with SQL Prompt Pro: Reformat SQL to a preferred style Summarize scripts Decrypt encrypted objects Smart rename to change the name any time an object appears in the database SQL Prompt is crammed with features that take the routine out of working with SQL, and leave you to focus on the tricky bits. When you're writing code, SQL Prompt suggests appropriate keywords and objects for queries. It can even complete INSERT, ALTER and JOIN statements. To cut down on repetitive typing, SQL Prompt has an extensive, customizable set of snippets. To avoid complications when editing your SQL, you can use smart renaming, view column dependencies straight from the query editor, and uncover invalid objects at a stroke. Reformatting and script summaries make even the most garbled queries readable in a few clicks. SQL Prompt is also backwards compatible, so it can tackle older databases too. Whether you need to write, edit, or explore database code, SQL Prompt makes everything effortless.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Mr.zwX

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值