加密文本的数字图像隐写
steganograph的Python项目详细描述
jpg,gif,png,bmp。
安装
$ pip install steganography
示例图像
示例命令
# encode example: hide text to image >>>steganography -e /tmp/image/input.jpg /tmp/image/output.jpg 'The quick brown fox jumps over the lazy dog.'# decode example: read secret text from image >>>steganography -d /tmp/image/output.jpg The quick brown fox jumps over the lazy dog.
示例代码
# -*- coding: utf-8 -*-from__future__importabsolute_import,unicode_literalsfromsteganography.steganographyimportSteganography# hide text to imagepath="/tmp/image/input.jpg"output_path="/tmp/image/output.jpg"text='The quick brown fox jumps over the lazy dog.'Steganography.encode(path,output_path,text)# read secret text from imagesecret_text=Steganography.decode(output_path)