写之前先学习了ColdmaterL的Caesar-Cipher,参考了其中获取控制台输入的方式,感谢😀。
Learn ColdmaterL's Caesar-Cipher before coding, refered to his way to obtain console input, thanks a lot~😀
代码为密码学教材("Cryptography Theory and Practice Third Edition")中几种古典密码的C语言实现。通过控制台程序使用。
因为是初学者,可能难免出现一些错误,如果发现了错误以及不规范之处希望能帮忙指出,非常感谢~
The code is the C language implementation of several classical ciphers in the Cryptography Theory and Practice Third Edition. Use through the console program.
As a beginner, some mistakes may be unavoidable. If you find mistakes and irregularities, I hope you can help me point them out. Thank you very much~
具体实现的古典密码如下:
The classical ciphers are as follows:
- 代换密码 (Substitution cipher)
- 恺撒密码 (Caesar cipher)
- 移位密码 (Shift cipher)
- 仿射密码 (Affine cipher)
- 单表代换密码 (Monoalphabetic cipher)
- 多表代换密码 (Polyalphabetic cipher)
- 维吉尼亚密码 (Vigenere cipher)
- 置换密码 (Permutation cipher)
- 主菜单-Main Menu
- 主菜单输入 1 进入代换密码菜单选择
Enter 1 in the main menu to enter the substitution cipher menu
- 代换密码菜单界面输入 1 进入恺撒密码菜单界面
Substitute cipher menu interface Enter 1 to enter Caesar cipher menu interface
- 代换密码菜单界面输入 2 进入移位密码菜单界面
Substitution cipher menu interface Enter 2 to enter the shift cipher menu interface
- 代换密码菜单界面输入 3 进入仿射密码菜单界面
Substitution cipher menu interface Enter 3 to enter the affine cipher menu interface
- 代换密码菜单界面输入 4 进入单表代换密码项,需要先输入密钥
Enter 4 in the replacement cipher menu interface to enter the single table replacement cipher item. You need to enter the key first
- 输入密钥后进入单表代换密码菜单界面
Enter the key to enter the single table substitution cipher menu interface
- 代换密码菜单界面输入 5 进入多表代换密码菜单界面
Enter 5 in the substitution cipher menu interface to enter the multi table substitution cipher menu interface
- 多表代换密码菜单界面输入 1 进入维吉尼亚密码项,需要先输入密钥
Enter 1 in the menu interface of multi meter substitution cipher to enter the Virginia cipher item. You need to enter the key first
- 输入密钥后进入维吉尼亚密码菜单
Enter the key to enter the Virginia cipher menu
- 维吉尼亚密码菜单界面输入 1 进行维吉尼亚密码加密
Enter 1 in the Virginia cipher menu interface to encrypt the Virginia cipher
- 维吉尼亚密码菜单界面输入 2 进行维吉尼亚密码解密
Enter 2 in the Virginia cipher menu interface to decrypt the Virginia cipher
- 多表代换密码菜单界面输入 1 进入维吉尼亚密码项,需要先输入密钥
- 代换密码菜单界面输入 1 进入恺撒密码菜单界面
- 主菜单输入 2 进入置换密码
Enter 2 in the main menu to enter the replacement cipher- 按照提示输入密钥后才进入置换密码菜单界面
Enter the key according to the prompts before entering the replacement cipher menu interface
- 置换密码菜单界面输入 1 进行置换密码加密
Input 1 in the replacement cipher menu interface to encrypt the replacement cipher
- 置换密码菜单界面输入 2 进行置换密码解密
Enter 2 in the permutation cipher menu interface to decrypt the permutation cipher
- 按照提示输入密钥后才进入置换密码菜单界面
最初是想把教材上的加解密都统一实现的,但刚做到DES就发现使用控制台获取用户输入不方便了...所以还是拆分开来实现。 后续会继续使用C语言实现其他的加解密方式。
At first, I wanted to implement all the encryption and decryption in the textbooks in a unified way, but I found it inconvenient to use the console to obtain user input just after I achieved DES. So I still separated them for implementation.
Later, I will continue to use C language to implement other encryption and decryption methods.