Invisible Ink
This library includes a set of tools for using zero-width unicode characters to embed human-invisible messages in text.
Watermarking
You can use invisible ink to uniquely identify a piece of text by embedding a UUID:
>>> from invisible_ink import encode_watermark, decode_watermark
>>> encoded_text, uuid = encode_watermark(u'asdf')
>>> print encoded_text
asdf
>>> uuid
UUID('3ca37a37-9c5a-4b9e-a9c0-a50c47c48dba')
>>> decode_watermark(encoded_text)
(u'asdf', UUID('3ca37a37-9c5a-4b9e-a9c0-a50c47c48dba'))
encode_watermark (text, watermark_uuid=None, prepend=False)
Encodes the given text with a watermark string generated from the given uuid. Optionally appends or prepends the watermark string.
Parameters:
text: Unicode string to which the watermark will be added
watermark_uuid: uuid.UUID instance to use as the watermark. (uuid.uuid4() will be used to generate one if not provided.)
prepend: Indicates whether the watermark should be prended to text (defaults to False). If False, the watermark will be appended.
Returns:
A 2-tuple: (encoded_text, watermark_uuid)
decode_watermark (encoded_text)
Decodes the given text, separating out the original text and the watermark uuid.
Paramters:
encoded_text: Unicode string which potentially includes a watermark
Returns:
A 2-tuple: (text, watermark_uuid). If no watermark is detected, text is the original text and watermark_uuid is None.
Installation
$ pip install invisible-ink
Metadata
Release files for invisible-ink 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| invisible-ink-0.1.1.tar.gz | 2.9 kB | Without provenance | Details for invisible-ink-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| invisible_ink-0.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for invisible_ink-0.1.1-py2.py3-none-any.whl |
Total release size: 7.4 kB
Release files / invisible-ink-0.1.1.tar.gz
| Download URL | invisible-ink-0.1.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
756040760290efce3e2ba146838636f497afc9a5340f40cdbe9e4a80a67dbc5a
|
|
BLAKE2b-256 checksum How to use checksums |
e29fbeac52516c3f0fbe3e668ba1745380e5d45807debe664d46a7a87268df63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / invisible_ink-0.1.1-py2.py3-none-any.whl
| Download URL | invisible_ink-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5db83bce0e4a442b60eb41c533cfde19ebe7090ec2b6a1b1e4d14141beebe8be
|
|
BLAKE2b-256 checksum How to use checksums |
cf5394f204bb855e0660068bef0be897333b24d2765ba7ec88853ba2ee807a9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for invisible-ink 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.