If you have a shared Linux computer with other people and you want to be sure that your files and folders will not look indiscriminate, then you can hide them in a picture.
And the image should not be fake but be displayed normally in a preview. The trick is very simple and is based on the logic that you are not trying to hide your files but to camouflage them. Let's see how:
Before we begin, we have created a directory that contains one archive (.png or .jpg) and the file or directory we want to hide. For example, we are going to hide a directory of files called secret_files. Our original image file is Ig-logo.png. With the cd command (command to switch to another physical folder in linux, from the change directory) we go to the directory containing the image and the file or folder we want to hide.
cd i * (go to the directory whose name begins with i)
There we have created a directory named secret_files which we want to hide inside the image named Ig-logo.png, which is located in the same physical space. As a first move we will create a compressed file that will contain the directory we want to hide. To do this, we type the following command in line linux commands and press Enter.
zip -r secret.zip secret_files /
In the above command, the -r switch indicates that all the subdirectories that exist in the specified directory will be included. The name of the compressed file is secret.zip and the directory name to be compressed is secret_files.
After executing the command, type ls and press Enter to look at the secret.zip file.
Now, we are going to merge the compressed file with the image and save the result as a new image file using the linux "cat" command. In our example, we type the following command in the linux command line and press Enter.
cat Ig-logo.png secret.zip> secret.png
The original image file (Ig-logo.png) must be listed first, before the name of the compressed file we want to import into the image file. The> symbol then directs the original image file and the compressed file to a new image called secret.png.
When we use the ls command on the linux taskbar we see the new image file, secret.png , which hides the compressed file. You can display this new image using any program image display. It's the same as the original image (Ig-logo.png) except that it's now resized because.... what else? it naturally contains our hidden compressed folder.
Once we have our new image hiding the file or folder, we can now delete the compressed file and the original file or folder, using the rm (remove) command. In our example, we have typed the following two commands to delete our compressed file and the original folder.
rm secret.zip rm -r secret_files
To access the hidden file or folder again, we make sure that we are in the directory that contains the new image that our file or folder contains. Then extract the file or folder from the image by typing the following command and pressing Enter.
unzip secret.png
Our secret_files folder is available again and when we look inside it (cd secret_files / and ls) we see the files contained within it.
Of course, this is not necessarily the safest way to protect your files. It simply disguises them and thus makes them less visible to someone who is "eaten" to see your system. Of course if you want you can encrypt your zip files before hiding them in the image, to make them more secure.