模糊处理工具和库
obf的Python项目详细描述
obf-一个模糊处理工具和库
obf旨在混淆输入文档,同时确保输出仍然(有些)可读,并且 同时保持输入明文和模糊输出之间映射的一致性,这样 obf(纯文本)总是产生相同的结果。
后一个特性意味着obf并不真正适合于强加密,因为 输出密文,也许在婴儿床的帮助下,可以使攻击者理解输出。
obf的目的是允许在保护区之外共享潜在的敏感数据,同时确保 它是持续的一致性,因此可操作性不需要对其他工具和工具进行任何更改。
obf是作为一种工具开发的,它允许将数据(文件和数据库)从受保护的“绿色”网络复制到 不受保护的“红色”区域,包括开发人员工作站和笔记本电脑,同时保持合理的数据隐私。obf 旨在用作独立工具或自动数据复制过程中的库。
安装说明
obf是用python编写的,您可以使用pip安装程序来安装它:
$ pip install obf
用法
obf [-h] [-b [blockedwords file]] [-w [codewords file]] [-c]
[-n [N]] [-e [E]] [-a [ALGO]] [-s [SALT]] [-l] [-v]
[plaintext]
位置参数:
plaintext
要混淆的纯文本。如果没有明文规定,
然后obf会转而关注stdin。
可选参数:
^ {CD2>}显示此帮助消息并退出
-b [blockedwords file]
包含要阻止的特定单词的文件。如果丢失
整个输入都是模糊的。
-w [codewords file]
包含要使用的代码字的文件。
-c
显示一个显示阻塞值映射的crib
他们模糊的价值观。只有当
blockfile与-b选项一起使用。
-n [N]
指示生成的哈希的字节数的索引
用作对码字文件的查找。默认值
到0。
-e [E]
以逗号分隔的域名组件字符串
应该避免混淆以帮助
可读性。圆点不允许/无效。默认为
“com,co,uk,org”以及
命令行将添加到此列表中。
-a [ALGO], --algo [ALGO]
作为索引的基础的哈希算法。
码字文件;默认为SHA256
-s [SALT], --salt [SALT]
用于哈希函数的salt,以确保
编码。
-l, --list-algos
列出可用的哈希算法。
-v
详细模式=显示关键参数等
示例
$ obf hello
SPRIGHTFUL
$ cat plaintext.txt | obf
LITHARGE LUNE FELINES PROPHECY FORBORNE ANKLUNGS SPAMS VOYAGE WIVERNS. OUBLIETTES RESTRICTIONS, TRIPTYCHS DREAMING BOLETUS STIRRING THYME BURK TWINS FELINES FRETS PEMMICAN.
STUBBORNNESS HANKERS'BACKSWORD GIFTS ANKLUNGS RIDER PICA RECTA DREAMING@CORPULENCE.TACHOGRAMS BOLETUS STIRRING@CORPULENCE.TACHOGRAMS BLUNGER GIBUSES REPLETES WIVERNS.
LITHARGE SLOTTERS ELUDE DIPODIES GABFESTS EXORCISM URCHIN SOLUTE UNEARTHS PRUNES, BOLETUS STRAFE GABFESTS. "DREAMING", "STIRRING". DREAMING'UPRISE ASPHALTS. STIRRING
DREAMING STIRRING.
LITHARGE SLOTTERS GAMB LODGED PICA BAWL TRANSACTORS ROUTINISTS: PIXELS.JUMBLER@CONNECTORS.TACHOGRAMS ANKLUNGS BANTENG COENZYME GIBUSES FLOCKS.
$ cat plaintext.txt | obf -b blockedwords.txt
This is a sample file that holds some secrets. For example, both DREAMING and STIRRING are examples of a FRETS PEMMICAN.
Similarly you'd expect that their email addresses DREAMING@CORPULENCE.com and STIRRING@CORPULENCE.com should be considered secrets.
This line just confims behaviour with preceding or following punctuation, and EOL behaviour. "DREAMING", "STIRRING". DREAMING's house. STIRRING
DREAMING STIRRING.
This line has another email address in it: PIXELS.JUMBLER@CONNECTORS.com that ought to be obfuscated.
$ cat plaintext.txt | obf -b blockedwords.txt -n23
This is a sample file that holds some secrets. For example, both RETENE and GIBLETS are examples of a SACCHAROID CLEAVE.
Similarly you'd expect that their email addresses RETENE@TEMPERS.com and GIBLETS@TEMPERS.com should be considered secrets.
This line just confims behaviour with preceding or following punctuation, and EOL behaviour. "RETENE", "GIBLETS". RETENE's house. GIBLETS
RETENE GIBLETS.
This line has another email address in it: UNREELS.CLEEKS@UPBEARS.com that ought to be obfuscated.
$ cat plaintext.txt | obf -b blockedwords.txt -n23 -e bobandsue
This is a sample file that holds some secrets. For example, both RETENE and GIBLETS are examples of a SACCHAROID CLEAVE.
Similarly you'd expect that their email addresses RETENE@bobandsue.com and GIBLETS@bobandsue.com should be considered secrets.
This line just confims behaviour with preceding or following punctuation, and EOL behaviour. "RETENE", "GIBLETS". RETENE's house. GIBLETS
RETENE GIBLETS.
This line has another email address in it: UNREELS.CLEEKS@UPBEARS.com that ought to be obfuscated.
$ cat plaintext.txt | obf -b blockedwords.txt -n23 -e bobandsue -v -c
{'blockedwords': ['secret', 'name', 'bob', 'sue'], 'hash_index': 23, 'hash_index_length': 4,
'codewords_file': '/Users/hossein/anaconda3/lib/python3.6/site-packages/obf/codewords.txt',
'codewords_hash': '25e011f81127ec5b07511850b3c153ce6939ff9b96bc889b2e66fb36782fbc0e',
'excluded_domains': ['com', 'org', 'co', 'uk', 'bobandsue'], 'codewords_length': 66740}
secret -> SACCHAROID
name -> CLEAVE
bob -> RETENE
sue -> GIBLETS
obf -b blockedwords.txt -c -v -n23 --algo MD5 --salt examplesalt
{'codewords_hash': '25e011f81127ec5b07511850b3c153ce6939ff9b96bc889b2e66fb36782fbc0e', 'salt': 'examplesalt',
'hash_index_length': 4, 'hash_algo': 'MD5', 'excluded_domains': ['com', 'org', 'co', 'uk'], 'hash_index': 12,
'codewords_file': '../obf/codewords.txt', 'blockedwords': ['secret', 'name', 'bob', 'sue'],
'codewords_length': 66740}
secret -> REVEALMENT
name -> LOBATE
bob -> ZOMBIS
sue -> DEIL
主页
您可以在https://github.com/hossg/obf
找到obf的主页