{"id":13617731,"url":"https://github.com/guofei9987/text_blind_watermark","last_synced_at":"2025-05-14T06:13:19.409Z","repository":{"id":52525169,"uuid":"437797089","full_name":"guofei9987/text_blind_watermark","owner":"guofei9987","description":"文本盲水印：把信息隐匿到文本中，put invisible blind watermark into a text. ","archived":false,"fork":false,"pushed_at":"2025-03-27T13:04:41.000Z","size":41,"stargazers_count":1519,"open_issues_count":0,"forks_count":143,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-06T21:41:42.930Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.guofei.site/os/text_wm.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guofei9987.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://www.guofei.site/微信打赏.jpg"],"open_collective":"blind_watermark"}},"created_at":"2021-12-13T08:43:46.000Z","updated_at":"2025-05-04T08:56:06.000Z","dependencies_parsed_at":"2024-02-08T21:03:28.367Z","dependency_job_id":"2512843b-6470-453d-8b4a-a10a4989b8f6","html_url":"https://github.com/guofei9987/text_blind_watermark","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.050000000000000044","last_synced_commit":"47ad4b2a2774b7937ccee2f2304ab81164f6e7da"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Ftext_blind_watermark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Ftext_blind_watermark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Ftext_blind_watermark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Ftext_blind_watermark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guofei9987","download_url":"https://codeload.github.com/guofei9987/text_blind_watermark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254081819,"owners_count":22011684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:01:47.014Z","updated_at":"2025-05-14T06:13:19.391Z","avatar_url":"https://github.com/guofei9987.png","language":"Python","funding_links":["https://www.guofei.site/微信打赏.jpg","https://opencollective.com/blind_watermark"],"categories":["Python"],"sub_categories":[],"readme":"# text_blind_watermark\n\nEmbed an invisible message (blind watermark) into text, without altering its readability or appearance.\n\n[![PyPI](https://img.shields.io/pypi/v/text_blind_watermark)](https://pypi.org/project/text_blind_watermark/)\n[![Build Status](https://app.travis-ci.com/guofei9987/text_blind_watermark.svg?branch=main)](https://app.travis-ci.com/guofei9987/text_blind_watermark)\n[![codecov](https://codecov.io/gh/guofei9987/text_blind_watermark/branch/main/graph/badge.svg?token=85EAN4IVM6)](https://codecov.io/gh/guofei9987/text_blind_watermark)\n[![License](https://img.shields.io/pypi/l/text_blind_watermark.svg)](https://github.com/guofei9987/text_blind_watermark/blob/master/LICENSE)\n![Python](https://img.shields.io/badge/python-\u003e=3.5-green.svg)\n![Platform](https://img.shields.io/badge/platform-windows%20|%20linux%20|%20macos-green.svg)\n[![stars](https://img.shields.io/github/stars/guofei9987/text_blind_watermark.svg?style=social)](https://github.com/guofei9987/text_blind_watermark/)\n[![fork](https://img.shields.io/github/forks/guofei9987/text_blind_watermark?style=social)](https://github.com/guofei9987/text_blind_watermark/fork)\n[![Downloads](https://pepy.tech/badge/text_blind_watermark)](https://pepy.tech/project/text_blind_watermark)\n\n\n- **Try it online**：[https://www.guofei.site/os/text_wm.html](https://www.guofei.site/os/text_wm.html)\n- Video demo：[https://www.bilibili.com/video/BV1m3411s7kT](https://www.bilibili.com/video/BV1m3411s7kT)\n- **Rust Version:** [https://github.com/guofei9987/hidden_watermark](https://github.com/guofei9987/hidden_watermark)\n- **中文 readme** [README_cn.md](README_cn.md)\n- **Source code:** [https://github.com/guofei9987/text_blind_watermark](https://github.com/guofei9987/text_blind_watermark)\n\n\n## ✨ Features\n\n- Invisible watermark embedding in plain text  \n- No visible difference in appearance\n- Verified in platforms: macOS, Windows, Linux, WeChat, DingTalk, Zhihu, Chrome, etc\n\n\n## 📦 Installation\n\n```bash\npip install text_blind_watermark\n```\n\n\n---\n\n## 🛠 Usage\n\n### Embed a watermark into text\n\n```python\nfrom text_blind_watermark import TextBlindWatermark\n\npassword = b\"p@ssw0rd\"\nwatermark = b\"This is watermark\"\noriginal_text_file = 'files/file_txt.txt'\nfile_with_watermark = 'files/file_txt_with_watermark.txt'\n\nwith open(original_text_file, 'r') as f:\n    text = f.read()\n\ntwm = TextBlindWatermark(pwd=password)\n\n# embed watermark into the text\ntext_with_wm = twm.add_wm_rnd(text=text, wm=watermark)\n\n# write into a new file\nwith open(file_with_watermark, 'w') as f:\n    f.write(text_with_wm)\n```\n\n\n### Extract the watermark\n\n```python\nfrom text_blind_watermark import TextBlindWatermark\n\npassword = b\"p@ssw0rd\"\nfile_with_watermark = 'files/file_txt_with_watermark.txt'\n\nwith open(file_with_watermark, 'r') as f:\n    text_with_wm_new = f.read()\n\ntwm = TextBlindWatermark(pwd=password)\nwatermark_extract = twm.extract(text_with_wm_new)\nprint(watermark_extract)\n```\n\n\u003e Output: `This is watermark`\n\n\n## 🔗 Related Project: [HideInfo](https://github.com/guofei9987/HideInfo)\n\n\n| 算法   | 说明                                                |\n|------|---------------------------------------------------|\n| [migrate tank](https://github.com/guofei9987/HideInfo/blob/main/example/example_mirage_tank.py) | Show different images under different backgrounds |\n| [hide as image](https://github.com/guofei9987/HideInfo/blob/main/example/example_hide_as_img.py) | Store data as an image                            |\n| [hide in image](https://github.com/guofei9987/HideInfo/blob/main/example/example_hide_in_img.py) | Hide data inside an image                         |\n| [image seed](https://github.com/guofei9987/HideInfo/blob/main/example/example_img_seed.py)   | Merge image and file together                     |\n| [EXIF](https://github.com/guofei9987/HideInfo/blob/main/example/example_img_exif.py) | Embed data in image EXIF metadata                                   |\n| [hide as music](https://github.com/guofei9987/HideInfo/blob/main/example/example_hide_as_music.py) | Store data as audio                                      |\n| [hide in music](https://github.com/guofei9987/HideInfo/blob/main/example/example_hide_in_music.py) | Hide data inside audio                                       |\n| [hide as text](https://github.com/guofei9987/HideInfo/blob/main/example/example_hide_as_txt.py) | Store data as plain text                                     |\n| [hide in text](https://github.com/guofei9987/HideInfo/blob/main/example/example_hide_in_txt.py) | Hide data within readable text                                       |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguofei9987%2Ftext_blind_watermark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguofei9987%2Ftext_blind_watermark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguofei9987%2Ftext_blind_watermark/lists"}