Skip to main content

Positional LSB

tests codecov python-versions PyPI GitHub

Positional LSB is a steganographic algorithm based on LSB. The algorithm is designed to overcome the lack of ease extracting data when LSB usage is detected. This implementation uses sequential writing of data into pseudo-random pixels of the image.

Content

Requirements

Python 3.10+
The package has 2 required dependencies:

Installation

pip install positional-lsb

Example

This package implements three options for using the algorithm:

  • Without encryption
  • With 3DES
  • With AES

There are differences only in the called class method

  • encode() for encode without encryption
  • encode_with_3des() for encode with 3DES
  • encode_with_aes() for encode with AES

And similarly for decode methods

When creating a PositionalLSBImage class object, as the first argument you need to specify the path to the image that will be used as a container, and the second argument (optional) is the password in the string format.

The use of an algorithm without a password does not reduce the cryptographic strength to the level of the classical LSB, but it makes it easy to extract data if, like you use the package

Encode

You need to create an instance of the PositionalLSBImage class and call the one kind of encode method and pass the data as the first argument and the name of the output image.

The output image must be with .png extension, otherwise nothing will work

from positional_lsb.stego import PositionalLSBImage

# get data in bytes
data = b'Positional LSB is cool!'

lsb_encode = PositionalLSBImage('empty_image.[jpg, png, bpm, ...]', 'Passw0rd')
lsb_encode.encode_with_3des(data, 'image_with_data.png')

Decode

You need to create an instance of the PositionalLSBImage class and call the one kind of decode method, which returns the data in bytes.

from positional_lsb.stego import PositionalLSBImage


lsb_decode = PositionalLSBImage('image_with_data.png', 'Passw0rd')
data = lsb_decode.decode_with_3des()

# do something with data
# ...

Testing

Tox is used to test this package.

For run tests python 3.10 and 3.11 must be installed

To run tests, install and run tox with the following commands:

# install tox
pip install tox
# run tox
tox

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for positional-lsb 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for positional-lsb 0.1.0
File Size Uploaded
positional_lsb-0.1.0.tar.gz 21.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for positional-lsb 0.1.0
File Interpreter ABI Platform
positional_lsb-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 MB

Release files / positional_lsb-0.1.0.tar.gz

Download URL positional_lsb-0.1.0.tar.gz
Size 21.3 MB
Tags Source
SHA-256 checksum
How to use checksums
86bf71bd32118cbdc05a4ac2f1bf9c3f081d4784ae11a58b4193a6b2458ee1e0
BLAKE2b-256 checksum
How to use checksums
e2c10827cbc0b1c6e521ae47300e2d44a3ee9023bf6d7433702fff1b25cd7c82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / positional_lsb-0.1.0-py3-none-any.whl

Download URL positional_lsb-0.1.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5fc379c94d8167e992a66046716a144b1be3c36cefa1264ff0bd4397d57430e
BLAKE2b-256 checksum
How to use checksums
a62a95e9baf576fc02a79eec41bb0e392ac61b99a6207f3a8985f0cf2efbe2cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page