🏛️ 什么是栅栏密码?
栅栏密码(也称锯齿形密码)是一种经典的换位密码,它通过将明文在多个水平“栅栏”或行上以锯齿形模式书写来重新排列文本。然后,通过从上到下依次读出每个栅栏的内容来创建密文。 (also called the Zigzag Cipher) is a classical transposition cipher that rearranges the plaintext by writing it in a zigzag pattern across multiple horizontal "rails" or rows. The ciphertext is then created by reading off each rail sequentially from top to bottom.
与替换字母的替换密码(如凯撒密码)不同,栅栏密码只是改变字母的顺序,是一种换位技术。 of letters, making it a transposition technique.
📖 栅栏密码如何工作?
The encryption process follows these steps:
- 选择栅栏的数量(这是您的密钥/深度) (this is your key/depth)
- 将消息以锯齿形模式写在栅栏上 in a zigzag pattern across the rails
- 从上到下依次读出每个栅栏的内容以创建密文 each rail from top to bottom to create the ciphertext
Step 1: Write in zigzag pattern...
🔓 如何解码栅栏密码
解码需要知道所使用的栅栏数量:
- 用空占位符绘制锯齿形图案 with empty placeholders
- 计算每个栅栏中有多少个字符 go in each rail
- 从密文中依次填充栅栏 sequentially from the ciphertext
- 读取锯齿形图案以揭示明文 to reveal the plaintext
专业提示:使用上方工具的“解密”模式可自动解密任何栅栏密码消息! Use the tool above with "Decode" mode to automatically decrypt any Rail Fence Cipher message!