I'm making a simple steganography program to hide data in PNG files. Decoding/encoding single bytes was easy, but I also need to hide a header in the PNG file. This header will contain the filesize in bytes to know exactly how many bytes I need to extract the file (too many bytes and tge extracted file will be corrupted).
So I need to break the integer into single bytes (since integers in FB is 32 bits wide, this will result in four separate bytes). Then these bytes will be encoded into the first 16 pixels of the PNG image (in my steganography algorithm 1 decoded byte = 4 encoded and I use only R and B values for data storage). How might I do this?
TL;DR: I need to know how to break integers into four individual bytes and then merge those bytes into integers again.