Embed an invisible message (blind watermark) into text, without altering its readability or appearance.
- Try it online:https://www.guofei.site/os/text_wm.html
- Video demo:https://www.bilibili.com/video/BV1m3411s7kT
- Rust Version: https://github.com/guofei9987/hidden_watermark
- 中文 readme README_cn.md
- Source code: https://github.com/guofei9987/text_blind_watermark
- Invisible watermark embedding in plain text
- No visible difference in appearance
- Verified in platforms: macOS, Windows, Linux, WeChat, DingTalk, Zhihu, Chrome, etc
pip install text_blind_watermark
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)
# embed 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)
from text_blind_watermark import TextBlindWatermark
password = b"p@ssw0rd"
file_with_watermark = 'files/file_txt_with_
7D3F
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)
Output:
This is watermark
🔗 Related Project: HideInfo
算法 | 说明 |
---|---|
migrate tank | Show different images under different backgrounds |
hide as image | Store data as an image |
hide in image | Hide data inside an image |
image seed | Merge image and file together |
EXIF | Embed data in image EXIF metadata |
hide as music | Store data as audio |
hide in music | Hide data inside audio |
hide as text | Store data as plain text |
hide in text | Hide data within readable text |