Facial Recognition and Steganography This project was created to give a means to track the distribution of images from unauthorized sources. Where by you have the images in a gallery on your webserver and upon being viewed metadata of your choosing is encoded into the outgoing PNG image to the browser. It works by using facial recognition to establish a bounding box region around the detected face in which the secret metadata is encoded into this region via least significant bit (LSB) encoding steganography method. Later images found in the wild can be recovered and if the facial bounding box region is still intact recovery of the secret metadata can be achieved, which can aid in determinging who, when, where, what login etc may have taken and shared the image.
Load image from disk and detect face and establish the bounding box around face.
$detector = new Face_Steg('detection.dat',5);
$detector->face_detect('Estella_01.png');
$detector->toPNG();
$detector = new Face_Steg('detection.dat',5);
$detector->face_detect('Estella_01.png');
$detector->toStegPNG('secret message');
// Encryption can be added before going into toStegPNG
// can easily Base64(AES(message,key)) and encode that base64 string.
$detector = new Face_Steg('detection.dat',5);
$detector->face_detect('Encoded_01.png');
echo "Decoded MSG: " . $detector->toStegMSG() . "\n";