Skip to main content

Text Blind Watermark in Python

Project description

text_blind_watermark

Put message(blind watermark) into a text. so that the message is invisible, and the changes of the text are not perceptible.

PyPI Build Status codecov License Python Platform stars fork Downloads

Can be used in

  • Wechat
  • dingding
  • zhihu.com
  • ...

How to Use

install

pip install text_blind_watermark

embed message into text:

from text_blind_watermark import TextBlindWatermark

password = b"p@ssw0rd"
watermark = b"This is watermark"
original_text_file = 'files/file_txt.txt'
file_with_watermark = 'files/file_txt_with_watermark.txt'

with open(original_text_file, 'r') as f:
    text = f.read()

twm = TextBlindWatermark(pwd=password)

# add watermark into the text
text_with_wm = twm.add_wm_rnd(text=text, wm=watermark)

# write into a new file
with open(file_with_watermark, 'w') as f:
    f.write(text_with_wm)

read and extract watermark

from text_blind_watermark import TextBlindWatermark

password = b"p@ssw0rd"
file_with_watermark = 'files/file_txt_with_watermark.txt'

with open(file_with_watermark, 'r') as f:
    text_with_wm_new = f.read()

twm = TextBlindWatermark(pwd=password)
watermark_extract = twm.extract(text_with_wm_new)
print(watermark_extract)

watermark extracted: This is a watermark

Related Project

HideInfo:https://github.com/guofei9987/HideInfo

算法 说明
migrate tank 使图片在不同的背景下显示不同的图片
hide as image 把数据以图片形式存放
hide in image 把数据藏在一个图片中
image seed 把图片和文件黏在一起,并存为图片
EXIF 把一段信息放到图片的EXIF中
hide as music 把数据以音频的形式存放
hide in music 把数据隐藏在一个音频中
hide as text 把数据以文本文件的形式存放
hide in text 把数据隐藏在一段文本中

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

text_blind_watermark-0.4.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

text_blind_watermark-0.4.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file text_blind_watermark-0.4.1.tar.gz.

File metadata

  • Download URL: text_blind_watermark-0.4.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for text_blind_watermark-0.4.1.tar.gz
Algorithm Hash digest
SHA256 2f2eb4088e0dde9e34118c369b1a4f54285fd51648bf92302a204ae28592ba50
MD5 d5e91e8c39758bfc378710aad514e97a
BLAKE2b-256 5a82768d41261ab9a135217e91572ab0f628f43df892e0e466f0404ba6cddc27

See more details on using hashes here.

File details

Details for the file text_blind_watermark-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for text_blind_watermark-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05b3e8932acc7585f0642240871327243f33bcb8a18726526f52c94c049a6f71
MD5 3d949553d028c04b697ab4912ca06693
BLAKE2b-256 b3c1f2035c5cbb5985a2e3b2d066180acf6440a4683eb8d314a93db479dcc803

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page