# 视觉密码学

视觉密码学是一种加密技术，它将秘密图像编码到称为“份额”的打印透明片上，使得当份额被物理叠加时，秘密对人眼变得可见，而解密时无需任何密码学计算。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> 在最初的形式中，秘密图像被分成两张透明片，每一张都与随机噪声无法区分；将一张置于另一张之上即可揭示明文。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> 一般形式是 n 中取 k 秘密共享问题的视觉变体：n 张透明片中的任意 k 张叠加即可揭示图像，而其中任意 k−1 张则无法获得关于图像的任何信息。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> 该方案是完美安全的。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 提出者 | 莫尼·纳奥尔（Moni Naor）和阿迪·沙米尔（Adi Shamir），EUROCRYPT 1994，施普林格《计算机科学讲义》第 950 卷（1995），第 1–12 页<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup><sup> • </sup><sup>[2](https://weizmann.elsevierpure.com/en/publications/visual-cryptography/)</sup> |
| 解密方式 | 叠加透明片；由人类视觉系统完成解码<sup>[3](https://www.wisdom.weizmann.ac.il/~naor/PAPERS/vis_auth.pdf)</sup> |
| 核心模型 | 每个像素在每份份额中变为 m 个子像素，用 n×m 布尔矩阵描述；叠加计算布尔或<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> |
| 像素扩展 (k,k) | \( m = 2^{k-1} \)，已被证明最优<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> |
| 安全性 | 任何少于 k 份份额的集合都无法获知关于秘密像素的任何信息<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> |
| 无扩展变体 | 随机网格方案（卡弗里与凯伦，1987）具有 \( m = 1 \)，因此重建图像保持原始尺寸<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0164121214000995)</sup> |

## 工作原理

秘密图像的每个像素在每份份额上被拆分为 m 个子像素，一个像素的编码由一个 n×m 布尔矩阵描述，每行对应一个参与者。解密是物理性的：将份额复印到透明片上并叠加，叠加计算所选行的布尔或。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup><sup> • </sup><sup>[5](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)</sup> 合成结果的灰度水平与或运算后的 \( m \) 维向量 \( V \) 的汉明重量（二进制向量中 1 的个数）\( H(V) \) 成正比；人类视觉系统在 \( H(V) \geq d \) 时将其解释为黑色，在 \( H(V) \leq d - \alpha m \) 时解释为白色。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup>

在基本的 2 取 2 情形中，每个明文像素在每份份额中变为一个 2×2 的子像素块，每份份额恰好包含两个黑色和两个透明子像素。叠加互补对得到黑色，叠加匹配对得到白色，而单独一份份额则是随机的，不添加任何信息。<sup>[3](https://www.wisdom.weizmann.ac.il/~naor/PAPERS/vis_auth.pdf)</sup>

一个形式化的 (k,n) 方案由两个 n×m 布尔矩阵的集合 \( C_{0} \) 和 \( C_{1} \) 组成，分别对应白色像素和黑色像素。对比度条件要求白色像素满足 \( H(V) \leq d - \alpha m \)，黑色像素满足 \( H(V) \geq d \)；安全性条件要求限制在任意少于 k 行的集合上的矩阵是不可区分的，即它们以相同频率包含相同的矩阵。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> 在一般的 (Qual, Forb, m) 表述中，合格集必须能通过叠加恢复图像，禁止集必须无法获得任何信息；相对差 α(m) 乘以 m 称为对比度，对比度应尽可能大，且至少为 \( 1/m \)，即 \( \alpha(m) \geq 1/m \)。<sup>[5](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)</sup>

## 实现方法

**基矩阵。** (k,k) 阈值构造使用两个基矩阵：\( T_{0} \) 的列等于所有具有偶数个 1 的布尔 k 维向量，\( T_{1} \) 的列为奇数重量列；像素扩展为 \( m = 2^{k-1} \)。<sup>[5](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)</sup> 德罗斯特（Droste）给出了一种算法，为一般 (k,n) 阈值方案构造基矩阵，具有 \( \alpha(m) = 1/m \) 且 \( m \geq n \)，适用于较小的 k 和 n。<sup>[5](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)</sup>

核心量是像素扩展 m（每份份额中每个像素对应的子像素数）、相对差 \( \alpha(m) \) 和对比度 \( \alpha(m) \cdot m \)。<sup>[5](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)</sup> 对于 k 取 k 的情形，纳奥尔和沙米尔给出了 \( m = 2^{k-1} \) 的构造并证明其最优：任何 k 取 k 方案必须使用至少 \( 2^{k-1} \) 个子像素。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup> 对于一般的 (k,n)，他们利用 k 阶独立哈希函数给出了 \( m = 2^{O(k \log k)} \cdot \log n \) 和 \( \alpha(m) = 2^{-O(k)} \) 的构造；阿泰内塞（Ateniese）等人的构造给出 \( m = O(k \cdot (2e)^{k} \cdot \log n) \)，像素扩展优于纳奥尔–沙米尔构造，且在 n 中取 2 的情形下达到最优。<sup>[5](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)</sup><sup> • </sup><sup>[6](https://doi.org/10.1006/inco.1996.0076)</sup> 对于 (2,n) 阈值方案，最优相对差的精确公式已知，最优方案通过平衡不完全区组设计来刻画，且 \( m \geq 2n - 2 \)，等号成立当且仅当存在一个 (n, n/2, n/2−1)-BIBD。<sup>[5](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)</sup> 存在三种对比度度量：\( \gamma_{\mathrm{ns}} \)（纳奥尔–沙米尔）、\( \gamma_{\mathrm{vv}} \)（费尔赫尔与范蒂尔堡）和 \( \gamma_{\mathrm{es}} \)（艾森与斯廷森），其中随机网格度量 \( \gamma_{\mathrm{rg}} \) 等价于 \( \gamma_{\mathrm{es}} \)；对于 (n,n) 阈值方案，偶/奇列构造相对于任何线性对比度度量都是最优的。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0164121214000995)</sup><sup> • </sup><sup>[7](https://doi.org/10.1023/a:1012504516447)</sup>

## 起源

视觉密码学发表于《密码学进展 – EUROCRYPT 1994》，施普林格《计算机科学讲义》第 950 卷（1995），第 1–12 页。<sup>[1](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)</sup><sup> • </sup><sup>[2](https://weizmann.elsevierpure.com/en/publications/visual-cryptography/)</sup> 一些后来的论文引用基本概念时称其于 1995 年提出，这是反映了会议录的年份；而会议报告是在 1994 年。<sup>[8](https://www.mdpi.com/2076-3417/12/19/10096)</sup>

概念前身是阈值秘密共享。1979 年《ACM 通讯》上的论文《如何共享一个秘密》展示了如何将数据 D 分成 n 份，使得 D 可以从任意 k 份中轻松重建，而完全掌握 k−1 份则绝对无法揭示关于 D 的任何信息。<sup>[9](https://doi.org/10.1145/359168.359176)</sup> 更早的光学先例是 O. 卡弗里（O. Kafri）和 E. 凯伦（E. Keren）于 1987 年发表在《光学快报》上的图像和形状的随机网格加密。<sup>[10](https://doi.org/10.1364/ol.12.000377)</sup> 1996 年，朱塞佩·阿泰内塞（Giuseppe Ateniese）、卡洛·布伦多（Carlo Blundo）、阿尔弗雷多·德桑蒂斯（Alfredo De Santis）和道格拉斯·R. 斯廷森（Douglas R. Stinson）将视觉密码学扩展到一般访问结构，2001 年同一团队开发了扩展能力，使份额携带有意义的图像。<sup>[6](https://doi.org/10.1006/inco.1996.0076)</sup><sup> • </sup><sup>[11](https://doi.org/10.1016/s0304-3975%2899%2900127-9)</sup>

## 变体

**随机网格与概率方案。** 卡弗里与凯伦（1987）的随机网格模型没有像素扩展，\( m = 1 \)，因此重建图像与原始图像尺寸相同，采用概率重建；这种方法还消除了基本或运算方案对码本的要求。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0164121214000995)</sup><sup> • </sup><sup>[8](https://www.mdpi.com/2076-3417/12/19/10096)</sup> 视觉密码学的概率模型被提出并在后续工作中得到推广。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0164121214000995)</sup><sup> • </sup><sup>[12](https://doi.org/10.1016/j.patrec.2003.12.011)</sup>

**基于异或的有意义份额方案。** 基于异或的方案用按位异或重建代替或叠加。一种具有有意义份额的无像素扩展异或方案解决了或运算方案图像质量低和像素对齐的问题：所揭示秘密的对比度在开区间 \( (0,1) \) 内变化，而对于或运算方案则在 \( (0,1/2) \) 内变化。<sup>[13](https://www.sciencedirect.com/science/article/abs/pii/S0165168414004757)</sup> 吴和孙的方法，以及欧（Ou）及其同事的方法，通过将秘密加密到封面图像中来生成有意义的份额；欧等人方案的三种优化被提出。<sup>[8](https://www.mdpi.com/2076-3417/12/19/10096)</sup>

**彩色与灰度。** 费尔赫尔和范蒂尔堡在伽罗瓦域 GF(q) 上定义了 c 色视觉秘密共享，使用 c 个 n×b 的 q 元矩阵集合和广义或运算。<sup>[14](https://doi.org/10.1023/a:1008280705142)</sup> 基于异或的方案已被扩展，使得秘密灰度或彩色图像被加密为 n 份有意义的份额，导入 n 张不同的封面图像，通过对对齐的份额图像计算按位异或而非物理叠加来完全恢复。<sup>[8](https://www.mdpi.com/2076-3417/12/19/10096)</sup> 在扩展视觉密码学方案（EVCS）中，每份份额必须看起来像人类可识别的源图像。<sup>[15](https://web.cs.ucla.edu/~rafail/PUBLIC/96.pdf)</sup> 基于图的访问结构，即任何合格集都包含以参与者为顶点的图中的一条边，由阿泰内塞及其同事进行了研究。<sup>[6](https://doi.org/10.1006/inco.1996.0076)</sup>

**近期方案。** 2025 年的一种基于异或的 (k,n) 方案，其中 \( 2 \leq k < n \)，允许 n 份份额同时加密 \( C(n,k) \) 个不同的完全独立的秘密，每个秘密由一个 k 子集重建，所有份额均为有意义的图像，无像素扩展，对于宽度为 \( W \)、高度为 \( H \) 的图像，编码复杂度为 \( O(n \cdot W \cdot H) \)。<sup>[16](https://www.mdpi.com/2076-3417/15/23/12720)</sup> 2025 年的一种使用随机和最小份额的彩色图像轻量级异或系统强调，经典的基于异或的视觉密码学是轻量级的，与基于多项式和 CRT 的视觉密码学相比，无像素扩展且计算负载低。<sup>[17](https://www.nature.com/articles/s41598-025-27142-2)</sup>

## 应用

扩展能力允许份额携带有意义的图像而非随机噪声，使每份份额看起来像人类可识别的源图像。<sup>[11](https://doi.org/10.1016/s0304-3975%2899%2900127-9)</sup><sup> • </sup><sup>[15](https://web.cs.ucla.edu/~rafail/PUBLIC/96.pdf)</sup> 基于异或的方案同样将秘密加密到封面图像中，生成适用于灰度图像和彩色图像的有意义份额。<sup>[8](https://www.mdpi.com/2076-3417/12/19/10096)</sup>

## 局限与替代方案

或运算叠加存在图像质量低和像素对齐的问题，基于异或的有意义份额方案正是为解决这些问题而设计的；或运算所揭示的相对对比度至多为 \( 1/2 \)，在 2 取 2 方案中可达到等号，而基于异或的方法为 \( (0,1) \)。<sup>[13](https://www.sciencedirect.com/science/article/abs/pii/S0165168414004757)</sup> 对比度还随阈值增大而急剧下降：在演化 (k,∞) 随机网格方案中，对比度从 \( k = 2 \) 时的 \( 1/5 \) 降至 \( k = 4 \) 时的约 \( 0.0101 \)，因此大阈值产生实际上无法辨认的重建图像。<sup>[18](https://arxiv.org/html/2508.15917v1)</sup> 欺骗攻击已被研究：洪（Horng）、陈（Chen）和蔡（Tsai）于 2006 年在《设计、编码与密码学》上发表了《视觉密码学中的欺骗》。<sup>[19](https://doi.org/10.1007/s10623-005-6342-0)</sup> 与需要计算来重建的多项式插值秘密共享相比，视觉密码学通过视觉重建，但代价是像素扩展或对比度；与基于多项式和 CRT 的图像秘密共享相比，基于异或的视觉[密码学](https://www.edgepedia.org/zh/cryptography)是轻量级的，无像素扩展且计算负载低。<sup>[17](https://www.nature.com/articles/s41598-025-27142-2)</sup>

## References

1. [Visual Cryptography (Naor & Shamir, EUROCRYPT '94, LNCS 950, pp. 1–12)](https://link.springer.com/content/pdf/10.1007/BFb0053419.pdf)
2. [Visual cryptography, Weizmann Institute of Science research record](https://weizmann.elsevierpure.com/en/publications/visual-cryptography/)
3. [Visual Authentication and Identification (Naor et al., Weizmann)](https://www.wisdom.weizmann.ac.il/~naor/PAPERS/vis_auth.pdf)
4. [Measure-independent characterization of contrast optimal visual cryptography schemes (De Prisco, De Santis; ScienceDirect)](https://www.sciencedirect.com/science/article/abs/pii/S0164121214000995)
5. [On the Contrast in Visual Cryptography Schemes (Ateniese, Blundo, De Santis, Stinson; Designs, Codes and Cryptography / Journal of Cryptology literature)](https://link.springer.com/content/pdf/10.1007/s001459900057.pdf)
6. [Giuseppe Ateniese and colleagues (1996). Visual Cryptography for General Access Structures. Information and Computation.](https://doi.org/10.1006/inco.1996.0076)
7. [Philip A. Eisen, Douglas R. Stinson (2002). Threshold Visual Cryptography Schemes with Specified Whiteness Levels of Reconstructed Pixels. Designs Codes and Cryptography.](https://doi.org/10.1023/a:1012504516447)
8. [XOR-Based (n, n) Visual Cryptography Schemes for Grayscale or Color Images with Meaningful Shares](https://www.mdpi.com/2076-3417/12/19/10096)
9. [Adi Shamir (1979). How to share a secret. Communications of the ACM.](https://doi.org/10.1145/359168.359176)
10. [O. Kafri, E. Keren (1987). Encryption of pictures and shapes by random grids. Optics Letters.](https://doi.org/10.1364/ol.12.000377)
11. [Extended capabilities for visual cryptography (Theoretical Computer Science, 2001)](https://doi.org/10.1016/s0304-3975%2899%2900127-9)
12. [Ching-Nung Yang (2004). New visual secret sharing schemes using probabilistic method. Pattern Recognition Letters.](https://doi.org/10.1016/j.patrec.2003.12.011)
13. [Non-expansible XOR-based visual cryptography scheme with meaningful shares](https://www.sciencedirect.com/science/article/abs/pii/S0165168414004757)
14. [Eric R. Verheul, Henk C. A. van Tilborg (1997). Constructions and Properties of k out of n Visual Secret Sharing Schemes. Designs Codes and Cryptography.](https://doi.org/10.1023/a:1008280705142)
15. [Visual Cryptography on Graphs (multi-secret extended VCS)](https://web.cs.ucla.edu/~rafail/PUBLIC/96.pdf)
16. [An XOR-Based (k, n) Visual Fully Independent Secrets Sharing Scheme with Meaningful Shares (Applied Sciences, 2025)](https://www.mdpi.com/2076-3417/15/23/12720)
17. [Lightweight XOR-based visual cryptography using random shares for secure colour image sharing with minimal shares (Scientific Reports, 2025)](https://www.nature.com/articles/s41598-025-27142-2)
18. [Evolving k-Threshold Visual Cryptography Schemes (arXiv, 2025)](https://arxiv.org/html/2508.15917v1)
19. [Gwoboa Horng, Tzungher Chen, Du-shiau Tsai (2006). Cheating in Visual Cryptography. Designs Codes and Cryptography.](https://doi.org/10.1007/s10623-005-6342-0)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 21, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Titles Mo to Z

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/visual-cryptography

English original: https://www.edgepedia.org/visual-cryptography
