Skip to content

Instantly share code, notes, and snippets.

View lorenzobn's full-sized avatar

LorenzoB. lorenzobn

View GitHub Profile
@lorenzobn
lorenzobn / script.py
Last active October 13, 2022 19:37
Steganography tool that uses LSB technique with pseudo-random pixel selection
import numpy as np
from PIL import Image
import sys, argparse, random
EOF_MARKER = '$eof!'
confs = {'RGB':[0,3], 'RGBA':[1,4]}
def calculate_min_size(number_of_bits):
"""Calculates the minimum image size needed to contain number_of_bits"""
min_pxls = number_of_bits//3 # 1 pixel = 3 bits stored