十六进制ID/指纹到PGP字表转换器

hex2words的Python项目详细描述


十六字

hex2words是一个命令行python程序,用于转换十六进制 将数字(如文件哈希、gpg密钥指纹等)放入 PGP单词。

这些pgp单词可以用来检查指纹或散列 通过电话线进行配对,或者只是大声朗读给你的同事听。

PGP单词

PGP words是单词 他们选择的方式听起来很不一样。每个 介于0和255之间的数字有两个等效单词,例如0x12有 atlasbackwater

如果字节0x12处于偶数顺序(第2位、第4位等),则 翻译成atlas,如果是奇数顺序,则翻译成 回水。这样,如果你有一个像0x1212这样的号码,你将得到 两个不同的词:atlas backwater,而不是两个相同的词, 这样可以避免通过电话交谈犯下的错误。

nodejs的hex2个单词

这个hex2wordsnpm的库,以防您对nodejs感兴趣。不是我的。

使用hex2单词

安装hex2words

$ pip install hex2words

最简单的用法

这些字总是小写的。似乎,当使用像festivalsay这样的程序时,小写或大写会改变语调。

有3个标识符、一个mac、一个ip6地址和一些自定义格式的hexa id。

$ hex2words dc:0e:e5:62:94:ac fe80::df0e:e5ff:fe62:94ac 920d6b30-0fa4-11e5-9cde-442a60f31a14
dc:0e:e5:62:94:ac
        sweatband atlantic topmost gadgetry pluto penetrate

fe80::df0e:e5ff:fe62:94ac
        woodlark intention talon atlantic topmost yucatán woodlark gadgetry pluto penetrate

920d6b30-0fa4-11e5-9cde-442a60f31a14
        physique asteroid glitter commando artist pandora athens travesty python telephone crumpled chambermaid facial vertigo beehive belowground
$

管道文件内容

与以前相同的三个标识符,存储在文件中:

$ cat > test
dc:0e:e5:62:94:ac
fe80::df0e:e5ff:fe62:94ac
920d6b30-0fa4-11e5-9cde-442a60f31a14
^D
$

然后,通过管道传送文件:

$ cat test | hex2words
dc:0e:e5:62:94:ac
        sweatband Atlantic topmost gadgetry Pluto penetrate

fe80::df0e:e5ff:fe62:94ac
        woodlark intention talon Atlantic topmost Yucatán woodlark gadgetry Pluto penetrate

920d6b30-0fa4-11e5-9cde-442a60f31a14
        physique asteroid glitter commando artist Pandora Athens travesty python telephone crumpled chambermaid facial vertigo beehive belowground
$

管道文件散列

hex2words/目录中所有python源文件的sha1散列:

$ sha1sum hex2words/*.py  | hex2words
hex2words/__init__.py:
        2a8c85a1f694f79bda523b1423a3f7a473824fc5
        brickyard megaton music outfielder village molecule virus Norwegian surmount enrollment clockwork belowground blowtorch pandemic virus Pandora hockey Istanbul dropper resistor

hex2words/hex2words.py:
        6d859a1b70ee1f8274555031df14522cbb2137a0
        goggles leprosy pupil bravado guidance universe billiard Istanbul indoors equipment drumbeat company talon belowground Dupont Chicago shamrock Camelot clamshell Orlando

hex2words/input.py:
        769fb587669dfc506ad5b951ac05bd6379f2386a
        inverse opulent scorecard liberty framework Ohio wayside embezzle Geiger specialist sentence enchanting ribcage almighty skullcap Galveston jawbone vagabond classic hamburger

hex2words/program.py:
        d1bd5a1445be18880a842eb62bd15ab28cc39d35
        stairway quantity enlist belowground crusade racketeer beaming maritime allow Jupiter buzzard potato briefcase scavenger enlist pioneer offload replica quadrant conformist

hex2words/version.py:
        b6ba6a706b082a8b440150f1ee2f229bcaa1d658
        Scotland puberty Geiger hesitate glitter antenna brickyard Medusa crumpled adviser drumbeat vacancy tycoon combustion blockade Norwegian spellbind outfielder stockman everyday
$

管道gpg指纹

您可以同时使用指纹的最后4个字节(34ec9cba)或完整的指纹:

$ hex2words 34EC9CBA "EF45 5106 80FB 0232 6B04 5AFB 3247 4CF8 34EC 9CBA"
34EC9CBA
        choking unicorn python puberty

EF45 5106 80FB 0232 6B04 5AFB 3247 4CF8 34EC 9CBA
        uncut detector drunken amulet merit Wichita accrue component glitter alkali enlist Wichita checkup determine drainage warranty choking unicorn python puberty

或来自gpg的管道:

$ gpg --list-keys --fingerprint 34EC9CBA | hex2words
EF45510680FB02326B045AFB32474CF834EC9CBA: uncut detector drunken amulet merit Wichita accrue component glitter alkali enlist Wichita checkup determine drainage warranty choking unicorn python puberty

开发

安装用于开发

$ git clone git@bitbucket.org:pfigue/hex2words.git
$ cd hex2words/

例如,您可以运行setup.py install

运行测试

setup.py test应该可以。测试是为py.test框架编写的。他们住在hex2words/tests/里。

贡献

只需分叉项目和发送你的魔术拉请求。尝试 用flake8或类似的代码缩进,并尝试编写测试和 代码不错。

欢迎所有反馈!

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓在java中加入字符串组以创建复合字符串   java系统甚至不点击“下一步”或“上一步”按钮就将我返回到上一页,而不是进入下一页   java如何在arrayList中获取特定列的不同值   CXF GZIP REST JAVA   Java:使用大量半恒定标志检查优化循环中的循环?   java如何在两个应用程序之间进行会话管理?   java SVG文件使用蜡染(但没有轴线)转换为PNG   使用协议缓冲区和内部数据模型的java   java如何在logtag 安卓中打印和查看字符串的值   javascript如何在NodeJs中应用Java/Spring的分层架构?   java Spring URL在JSP中编码不正确   模式对话框后面的java工具提示   java WSRPC生成日历对象而不是日期   在对象外部无法识别类变量   java将图像从文件读/写到BuffereImage的最快方法?   JavaSpring数据存储库对具有不同Id的子类使用抽象超类   安全在Java 5.0上运行web应用程序服务器有危险吗?