python工具,表示用tinyscript制作的bruce schneier的纸牌密码
solitaire-cipher的Python项目详细描述
目录
简介
这个工具依赖于Tinyscript,实现了bruce schneier的Solitaire Cipher。
安装
$ sudo pip install solitaire-cipher
Behind a proxy ?
Do not forget to add option
--proxy=http://[user]:[pwd]@[host]:[port]
to your pip command.
快速启动
帮助
$ solitaire-cipher --help usage: solitaire-cipher [-r INI] [-w INI] [-h] [-v] {decrypt,encrypt} ... SolitaireCipher v1.1 Author : Alexandre D'Hondt Copyright: © 2019 AGPLv3 (http://www.gnu.org/licenses/agpl.html) Reference: https://www.schneier.com/academic/solitaire/ This tool implements the Solitaire Encryption Algorithm of Bruce Schneier. positional arguments: {decrypt,encrypt} commands decrypt decrypt message encrypt encrypt message config arguments: -r INI, --read-config INI read args from a config file (default: None) NB: this overrides other arguments -w INI, --write-config INI write args to a config file (default: None) extra arguments: -h, --help show this help message and exit -v, --verbose verbose mode (default: False) Usage examples: solitaire-cipher encrypt "AAAAA AAAAA" -p my_super_secret -s solitaire-cipher decrypt "AAAAA AAAAA" -p my_super_secret -d deck.txt
加密
$ solitaire-cipher encrypt --help usage: solitaire-cipher encrypt [-h] [-a A] [-b B] [-d DECK] -p PASSPHRASE [-o OUTPUT] [-s] message positional arguments: message message to be handled optional arguments: -a A joker A (default: 53) -b B joker B (default: 54) -d DECK deck file or list of integers (default: 1,2,...,53,54) -p PASSPHRASE passphrase (default: None) -o OUTPUT save the encoded deck to (default: deck.txt) -s shuffle the deck (default: False) extra arguments: -h, --help show this help message and exit
$ solitaire-cipher encrypt "TEST" -s -p my_super_secret 12:34:56 [INFO] IWEJ 12:34:56 [INFO] 28,48,10,24,3,23,2,38,34,6,30,40,8,4,9,11,15,20,31,47,22,35,45,41,49,43,5,13,25,39,19,12,37,33,36,7,16,B,46,29,50,42,26,1,21,A,17,51,14,27,18,44,32,52 12:34:56 [INFO] Saved the encoded deck to 'deck.txt'
解密
$ solitaire-cipher decrypt --help usage: solitaire-cipher decrypt [-h] [-a A] [-b B] [-d DECK] -p PASSPHRASE message positional arguments: message message to be handled optional arguments: -a A joker A (default: 53) -b B joker B (default: 54) -d DECK deck file or list of integers (default: 1,2,...,53,54) -p PASSPHRASE passphrase (default: None) extra arguments: -h, --help show this help message and exit
$ solitaire-cipher decrypt "IWEJ" -d deck.txt -p my_super_secret 12:34:56 [INFO] TEST 12:34:56 [INFO] 28,48,10,24,3,23,2,38,34,6,30,40,8,4,9,11,15,20,31,47,22,35,45,41,49,43,5,13,25,39,19,12,37,33,36,7,16,B,46,29,50,42,26,1,21,A,17,51,14,27,18,44,32,52