Write payload into JSON without modifying it
Project description
JSON steganography
Write payload into JSON without modifying it
Installation
Install jsonsteg via PyPI:
pip install jsonsteg
CLI usage
Use command line interface via jsonsteg
command.
Writing
Write payload mysecret
to JSON found in file data.json
:
jsonsteg write --input mysecret data.json
Write the contents of file message.txt
as a payload to JSON of file data.json
:
jsonsteg write --input-file message.txt data.json
Instead of modifying data.json
file, you can output the altered JSON to output.json
file:
jsonsteg write --input mysecret --output output.json data.json
Reading
Write the payload of JSON in file data.json
and print it to console:
jsonsteg read data.json
Instead of printing, the output can also be saved to file output.txt
:
jsonsteg read --output output.txt data.json
Help
Learn more about possible options with these commands:
jsonsteg --help
jsonsteg read --help
jsonsteg write --help
Python usage
Jsonsteg can also be used as a Python package:
import jsonsteg
jsonsteg.DictionaryReader(json_dictionary)
jsonsteg.DictionaryWriter(json_dictionary, payload_bytes)
jsonsteg.ArrayReader(json_array)
jsonsteg.ArrayWriter(json_array, payload_bytes)
Writer objects have output
property and reader objects have payload
property.
Development
After cloning the git repository, install development dependencies by running the following command in project root:
poetry install
Run unit tests with
poetry run invoke test
Run coverage test with
poetry run invoke coverage
and create HTML coverage report with
poetry run invoke coverage-report
Publish the package on pypi.org or test.pypi.org by one of the following commands:
poetry run invoke publish
poetry run invoke publish-test
When running either one of the commands above,
you must have PYPI token stored in an environment variable named
POETRY_PYPI_TOKEN_PYPI
or POETRY_PYPI_TOKEN_TEST_PYPI
, respectively.
How is it done?
Read more about the mechanism here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jsonsteg-1.0.0.tar.gz
.
File metadata
- Download URL: jsonsteg-1.0.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.9.2 Linux/5.10.0-24-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52d321b68c2dcf9c5dab766e30a933083aef503acee679437f092832c6d78099 |
|
MD5 | f8e8eca8f7e4ea56053a96775963f5a6 |
|
BLAKE2b-256 | dfd4fba779ee2873f442185b04e9d0ba85edb6a5ae73808a7430e728d3150c4f |
File details
Details for the file jsonsteg-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: jsonsteg-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.9.2 Linux/5.10.0-24-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05ff30c104427f7e729983b663667baedbd191de74d07fcd0d311f36ee63ccac |
|
MD5 | 475387f2fc28b5cabf67f5a4454e8400 |
|
BLAKE2b-256 | e56ffac815bdd8344f5f42dc4d57d4e9f5a3f6cdd03233865f3983b38c5f996a |