JPEG steganography in JavaScript
Work in progress
Trying to port f5 algorithm to JavaScript
Demo page - open browser JS console to see logs.
Changes and additions: main2.js: - add function to concatenate arraybuffers. - add function to convert arraybuffer to string and string to arraybuffer. - add slice functions for arraybuffer and Uint8Array - attach filename string (256 bytes) as arraybuffer to embeddata. Now filename is saved and encrypted. - slice decrypted arraybuffer hidData, extract from there filename arraybuffer, convert this to string and attach to download attribute. - Now the file can be downloaded with original filename.
Add index.html from http://desudesutalk.github.io/f5stegojs/ and change HTML code. Add styles and images. Move javascripts to "js" folder. Change structure of html pages. Now the folder "index_files" folder will be copied if index.html copied. Add test files:
- TEST_FILE_FOR_EMBEDDING.txt - this file containing the string "test string in the TEST_FILE_FOR_EMBEDDING.txt"
- EMPTY_COVER.jpg - original empty image (JPEG).
- STEGO_JPEG_WITH_FILE.jpeg - picture for test decoding file using default password, and download this.
- change pathways in example.html
- Change README.md
Usage:
Try to embedding file with data there:
- Run example.html or index.html
- Password: secret
- Select EMPTY_COVER.jpg as cover image.
- Select TEST_FILE_FOR_EMBEDDING.txt
- Press button "embed data".
- Download new jpeg file - repack.jpg
- Move this near EMPTY_COVER.jpg
- Rename this to STEGO_JPEG_WITH_FILE.jpeg
Try to extract file from STEGO_JPEG_WITH_FILE.jpeg:
- Re-open example.html
- Password: secret
- Container - Select STEGO_JPEG_WITH_FILE.jpeg
- Press button "Extract data."
- Download file with data by clicking on the link "download extracted data".
- Filename the same, contents too.
- Open this as text, and see the string: "test string in the TEST_FILE_FOR_EMBEDDING.txt". Now the filename saved in the encrypted data, and filename is not damaged.
Comparing, using WinMerge, the EMPTY_COVER.jpg and STEGO_JPEG_WITH_FILE.jpeg, some differences and downloaded file with TEST_FILE_FOR_EMBEDDING.txt no any differences.
Tests finished successfully!