CKKS 复数近似加密
- see: Yongsoo Song - Presentations
- see: 【bilibili】Introduction to CKKS
- see: 【中】/【En】/【En】原理简介
a) 原理
【0】 北航学弟的毕设感想
【1】【1】【1】CKKS 同态加密方案
【2】 同态加密:CKKS原理之旋转(Rotation)
【3】 同态加密:以CKKS为例的Bootstrapping操作介绍
【4】 bfv同态加密_三、全同态加密-飞马(section 1)
【5】 同态加密CKKS:编码
【6】 同态加密和安全多方计算结合做逻辑回归
【7】 CKKS的Encoding(CKKS方案的编码部分的笔记)
【8】 CKKS 密文矩阵乘法优化
【9】 基于近似计算的同态加密方案CKKS17----Relinearization和Rescaling。其中介绍了评估密钥evaluation key
b) 实现
C++
Python
- OpenFHE-python 。【1】
【2】 代理重加密 - TenSeal库。【1】【2】/【3】
密文向量乘明文矩阵【paper:Algorithms in helib】,它可以使用多线程来更快地运行。(参数含义)。(持有密钥)。(关于序列化存储)。
【4】 Tenseal库
关于CKKS工程问题可以参阅以下链接:
Java
c) SIMD性质
原理:用分圆多项式,根据 CRT 可以将密文分成 N个槽(slot)
并发编程:SIMD 介绍
【1】 SIMD编码
格密码
(一)小整数解问题(SIS)
(二)最近向量问题(CVP)
(三)最短向量问题(SVP)
(四)容错学习问题(LWE、RLWE)
多密钥加密
【1】 CCS 2019:Efficient Multi-Key Homomorphic Encryption with Packed Ciphertexts with Application to Oblivious Neural Network Inference
【2】 多密钥TFHE学习笔记1-MKTFHE的整体流程
代理重加密 / 阈值加密
注:It is also possible for Alice to be her own policy authority.
【1】 OpenFHE – Open-Source Fully Homomorphic Encryption Library 海报
【2】 OpenFHE: Open-Source Fully Homomorphic Encryption Library 论文
【3】 发布/订阅系统的快速代理重新加密。2017 ACM Transactions on Privacy and Security ,上述【2】中的参考文献
【4】 基于标准 LWE 假设的具有 HRA 安全性和密钥隐私的 PRE。2021 IACR,上述【4】被引用的文献
理论基础
- 环论:UCBerkeley 的课程
- A Toolkit for Ring-LWE Cryptography:(看不大懂)
- 分圆多项式
- 离散傅里叶变换(DFT):FFT 用于多项式乘法
- 离散傅里叶变换(DFT)
一些报错(py库tenseal)
ValueError: scale out of bounds
:同态乘法时,达到最大乘法深度。需要bootstrap / rescale操作,比如 解密后重新加密。见 CKKS multiplication crashes with “scale out of bounds”。'CKKSVector' object is not subscriptable
:密文向量不可拆分。- 密文张量取数:
Enc_ten[[range(4)]]
,Eidn_do[0:4]
,Eidn_do[0]
等,总之,需为range类型,仅包括start, stop,暂不支持步长间隔
def __getitem__(self, item) -> "CKKSTensor":
slices = []
if isinstance(item, int):
start = item
stop = item + 1
slices = [(start, stop)]
elif isinstance(item, slice):
start = 0 if item.start is None else item.start
stop = self.data.shape()[0] if item.stop is None else item.stop
slices = [(start, stop)]
else:
for i, slice_ in enumerate(item):
start = 0 if slice_.start is None else slice_.start
stop = self.data.shape()[i] if slice_.stop is None else slice_.stop
slices.append((start, stop))