同态加密算法
As our reliance on cloud infrastructure increases and our social interactions become increasingly dependent on the internet, we worry more about data breaches in activities like online conversations and storing personal information on the cloud. Fully homomorphic encryption is a form of encryption that can tackle security issues arising from these activites.
随着我们对云基础架构的依赖增加以及我们的社交互动越来越依赖互联网,我们更加担心在线对话和将个人信息存储在云中等活动中的数据泄露。 完全同态加密是一种加密形式,可以解决由这些活动引起的安全性问题。
Fully homorphic encryption is regarded as the Holy Grail of information security because it can protect the privacy of data while it is stored in the cloud or while it is in transit. At first glance, the word “homomorphism” might seem unfamiliar, but it is not! “Homo” means similar and “morphism” means change, and homomorphism consequently means a form-preserving map between 2 algebraic structures. Homomorphic encryption is a special method of encryption that allows mathematical operations on encrypted data rather than on its plaintext. This means one can perform these operations on the data and get the encrypted output without ever knowing what the data was. The significant property of this particular type of encryption to note is that decrypting the operated encrypted data should give the same output as operating on the plaintext itself.
完全同态加密被视为信息安全的圣杯,因为它可以保护存储在云中或传输中的数据的私密性。 乍一看,“同态”一词可能看起来并不熟悉,但事实并非如此! “同态”表示相似,“同态”表示变化,因此,同态意味着两个代数结构之间的形式保留图。 同态加密是一种特殊的加密方法,它允许对加密数据而不是其明文进行数学运算。 这意味着人们可以在不知道数据是什么的情况下对数据执行这些操作并获得加密的输出。 要注意的这种特殊类型的加密的重要属性是,解密操作的加密数据应提供与对纯文本本身进行操作相同的输出。
Our current homomorphic encryption models are either partially homomorphic or fully homomorphic. Partially homomorphic models allow only a certain number of operations on the data (usually multiplication or division). On the other hand, fully homomorphic encryption allows you to perform multiple sequential operations on the data without exposing the meaning of the message.
我们当前的同态加密模型是部分同态或完全同态的。 部分同态模型仅对数据进行一定数量的运算(通常是乘法或除法)。 另一方面,完全同态加密使您可以在不暴露消息含义的情况下对数据执行多个顺序操作。
This diagram above is a simple demonstration on how homomorphic encryption works. It starts with a plaintext m, let’s assume it’s the name of someone in an organization Boogle “ALICE”. Let function f be decapitalizing the name. The goal is to be able to perform this function on the plaintext m without compromising the actual value of it, i.e. perform f on the value of the enc(m). So first you encrypt the message m into some value, let’s say 23225. This value is then transformed into some other value using some other function, e.g. f(x) = x + 75. The output is 23300, and this corresponds to another completely encrypted message which can be decrypted to give “Alice”.
上图是有关同态加密如何工作的简单演示。 它以纯文本m开头,我们假设它是Boogle“ ALICE”组织中某人的名字。 让函数f使名称大写。 目的是能够在不损害纯文本m的实际值的情况下对纯文本m执行此功能,即对enc(m)的值执行f。 因此,首先将消息m加密为某个值,例如23225。然后使用其他函数( 例如f(x)= x + 75)将此值转换为其他值。 输出为23300,它对应于另一个完全加密的消息,可以对其进行解密以提供“ Alice”。
This property is what allows homomorphic encryption to protect against privacy breaches. With increasing technological infrastructure comes an added necessity to secure it. In the current model of encryption we use when storing information on Amazon or Google provided cloud servers, the information must be decrypted on the server side before performing any operation on it before sending them back to the client for them to review the output. This clearly leaves security vulnerabilities because our information is being revealed at a point while it is being operated on. Homomorphic encryption allows your data to remain encrypted not only while it is at rest, but also while it is in transit and while it is being operated on. As a result, the server would never know what the actual information value was.
此属性使同态加密可以防止违反隐私的行为。 随着技术基础设施的增加,增加了对其进行保护的必要性。 在当前用于在Amazon或Google提供的云服务器上存储信息时使用的当前加密模型中,必须先在服务器端对信息进行解密,然后再对其执行任何操作,然后再将其发送回客户端以供他们查看输出。 这显然留下了安全漏洞,因为我们的信息在运行时的某个时刻被泄露。 同态加密使您的数据不仅在静止时,在传输过程中和在运行时都保持加密状态。 结果,服务器将永远不知道实际的信息值是多少。
An important property of homomorphic encryption to consider is that it is inherently malleable. A malleable encryption model means that any intruder can intercept the encrypted message, transform it into a different encrypted message, and then decrypt it into a plaintext that makes “sense”. This is generally considered unfavorable, because imagine a situation where one is trying to send private medical information about their blood type O, but then someone intercepts then alters it to a different type A. This is an example of why malleability can be looked down on.
要考虑的同态加密的一个重要属性是,它具有固有的延展性。 可延展的加密模型意味着任何入侵者都可以拦截加密的消息,将其转换为其他加密的消息,然后将其解密为纯文本,从而产生“感觉”。 通常认为这是不利的,因为设想一种情况,其中有人试图发送有关其O型血的私人医疗信息,但随后有人进行拦截,然后将其更改为另一种A型。这就是为什么可以低估延展性的一个示例。
However, homomorphic encryption models are supposed to be malleable! Take an example where you’re trying to add information to your blood type, from O to O+. When you encrypt your message and send it along the route, the system only sees your encrypted message, but it can still transform your message from O to O+ as wanted. In this case, malleable systems allow multiple parties, such as in cloud infrastructure, to act on your data without seeing it.
但是,同态加密模型应该具有延展性! 举一个例子,您尝试添加信息到您的血型,从O到O +。 当您加密消息并沿路由发送时,系统只会看到加密的消息,但仍可以根据需要将消息从O转换为O +。 在这种情况下,可延展的系统允许多个方(例如云基础架构中的一方)对您的数据进行操作而不会看到它们。
部分同态方案 (Partial Homomorphic Schemes)
RSA Encryption is an example of a partially homomorphic scheme, specifically multiplicative. It selects 2 prime numbers a and b and sets n = a ⋅ b. It then selects y and z such that
RSA加密是部分同态方案的一个示例,特别是乘法。 它选择2个质数a和b并设置n = a⋅b。 然后选择y和z
y ⋅ z ≡ 1 mod ϕ (N)
y⋅z mod 1 mod ϕ(N)
This is called the modular inverse of y of z modulo ϕ (N). The ≡ operator symbolizes congruence and means that the product y ⋅ z and 1 have the same remainder when divided by ϕ (N). ϕ (N) is called the Euler’s totient function and counts the positive integers up to N that are relatively prime to N. 2 relatively prime integers a and b, or coprime integers, are said to be so if the only positive integer that divides them both is 1. This forms a ring of possible values.
这称为z模ϕ(N)的y的模逆。 ≡运算符表示同余,表示乘以(N)时,乘积y⋅z和1具有相同的余数。 ϕ(N)被称为欧拉totient函数,并且对直到N的正整数进行计数,该正整数相对于N相对于质数.2个相对质数整数a和b或共质数整数被称为是这样,如果将它们相除的唯一正整数两者均为1。这形成了可能值的环。
In this case, a and b are private and are only known by the sender and receiver whereas p and q are public. Taking this information, the encryption and decryption schemes become
在这种情况下,a和b是私有的,只有发送方和接收方才知道,而p和q是公共的。 利用此信息,加密和解密方案成为
Enc(x)=x^b mod(n)
Enc(x)= x ^ b mod(n)
Dec(x)=y^a mod(n)
Dec(x)= y ^ a mod(n)
You can prove the homomorphism by taking a and b as example messages.
您可以通过使用a和b作为示例消息来证明同态。
Enc(a) . Enc(b) = Enc(a . b)
Enc(a)。 Enc(b)= Enc(a .b)
全同态算法 (Fully Homomorphic Algorithms)
Now fully homomorphic systems are ones in which any types of mathematical operations can be performed on the plaintext. Craig Gentry was the first to suggest that they could be theoretically possible.
现在,完全同态系统是可以在纯文本上执行任何类型的数学运算的系统。 Craig Gentry第一个提出理论上可行的建议。
In his thesis, he used the analogy of a jewelry shop owner. Lavinia is the jewelry shop owner, and she has employees that create jewelry from materials like diamond and gold. However, she’s afraid of her employees stealing these valuable items. To combat this, she creates a box with gloves attached to them. The employees can stick their hands into the box to create the jewelry, but cannot take anything out as only Lavinia has the key to open the box.
在他的论文中,他使用了珠宝店老板的比喻。 Lavinia是珠宝店的老板,她的员工使用钻石和黄金等材料制作珠宝。 但是,她担心员工会偷这些有价值的物品。 为了解决这个问题,她创建了一个带有手套的盒子。 员工可以将手伸入盒子中来制作珠宝,但不能取出任何东西,因为只有Lavinia才能打开盒子。
In this model, there is some noise in the morphic process. Each transformation adds more noise to the system, but this makes the model impractical as the system gets much slower. This necessarily means that Gentry’s scheme grows in complexity as more and more operations are performed. For example, one search using this scheme on Google’s search engine would increase computations by not millions, but trillion of times.
在此模型中,形态过程中存在一些噪声。 每次转换都会给系统增加更多的噪声,但是这会使模型变得不切实际,因为系统变得越来越慢。 这必然意味着随着执行越来越多的操作,Gentry的方案变得越来越复杂。 例如,在Google的搜索引擎上使用此方案进行的一次搜索将使计算量增加数百万倍而不是数百万倍。
However, despite this impracticality, this discovery at least shows that homomorphic encryption exists and proves that these schemes are possible, even if theoretically.
但是,尽管有这种不切实际的想法,但该发现至少表明存在同态加密,并且即使在理论上也证明了这些方案是可行的。
同态加密算法