GithubHelp home page GithubHelp logo

goodopenrepo / text_blind_watermark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guofei9987/text_blind_watermark

0.0 0.0 0.0 37 KB

文本盲水印:把信息隐匿到文本中,put blind watermark into a text(invisible watermark for text).

Home Page: https://www.guofei.site/pictures_for_blog/app/text_watermark/v1.html

License: MIT License

Python 100.00%

text_blind_watermark's Introduction

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 TextBlindWatermarkThin

password = '20190808'
watermark = 'github.com/guofei9987'
text_blind_wm = TextBlindWatermarkThin(password=password)

wm = text_blind_wm.embed(watermark=watermark)
# This is example,you can put wm everywhere
text_embed = '这句话中有盲' + wm + '水印,你能提取出来吗?'
print(text_embed)

extract message from text

text_blind_wm_new = TextBlindWatermarkThin(password=password)
wm_extract = text_blind_wm_new.extract(text_embed)
print('提取内容:', wm_extract)

github.com/guofei9987

Method 2 is more robust

Alice Put her text watermark into a text:

from text_blind_watermark import TextBlindWatermark

watermark = "绝密:两点老地方见!"
text = "这句话中有盲水印,你能提取出来吗?" * 16
password = "20190808"

twm = TextBlindWatermark(password=password)
twm.read_wm(watermark=watermark)
twm.read_text(text=text)
text_embed = twm.embed()

print("打上盲水印之后:")
print(text_embed)

Then, you can paste this text to where you need.

Bob Extract the invisible watermark

from text_blind_watermark import TextBlindWatermark
password = "20190808"

twm_new = TextBlindWatermark(password=password)
wm_extract = twm_new.extract(text_embed)
print("解出的盲水印:")
print(wm_extract)

text_blind_watermark's People

Contributors

guofei9987 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.