V2

2023/05/13阅读：13主题：默认主题

# Enigma 的原理示意

Enigma（译为恩尼格码）密码机是一种使用配对设备进行同步加密和解码的机械式密码机，本文是在前人代码的基础上，通过添加着色的方法使其原理更加便于理解。本文的开源代码可见我的 ObservableHQ 笔记本

Enigma machine demo[1]

• Enigma 的原理示意[2]
• 原理说明[3]
• 示意图[4]

## 原理说明

Enigma Machine | Brilliant Math & Science Wiki[5]

Since there are   letters in the alphabet, there are   ways to arrange the letters, but the plugboard can only make   pairs, so there are  letters involved with the pairings, and 66 leftover that must be divided out. Furthermore, there are   pairs of letters, and it does not matter what order the pairs are in, so divide also by  , and the order of the letters in the pair does not matter, so divide also by  . The resulting number of combinations yielded by the plugboard is as follows:

All of the components put together yields total number of ways to set a military-grade Enigma machine

## 示意图

Enigma machine demo[6]

Enigma machine[7]

### 参考资料

[1]

Enigma machine demo: https://observablehq.com/@listenzcc/enigma-machine-demo

[2]

Enigma 的原理示意: #enigma-的原理示意

[3]

[4]

[5]

Enigma Machine | Brilliant Math & Science Wiki: https://brilliant.org/wiki/enigma-machine/

[6]

Enigma machine demo: https://observablehq.com/@listenzcc/enigma-machine-demo

[7]

Enigma machine: https://observablehq.com/@tmcw/enigma-machine

V2