'Linux - modify file modify/access/change time [closed]

I read an article about new steganographic method: "Time is on my side: Steganography in filesystem metadata" http://www.sciencedirect.com/science/article/pii/S1742287616300433. It is very interesting and makes me thinking about one thing.

Is it possible to manipulate file modify/access/change time metedata using C or any other language in Linux OS? I found method which is using touch command, but it creates file with specific tag value. I would like to find way to modify this metadata in existing one.



Solution 1:[1]

Using touch command you can edit time metadata of files. Example:

touch -a -t 201611161200.10 file.txt

It will result in modifing access timestamp, and replace it with date 2016-11-16 12:00:10.000000000 To change 'Modify' date you should use flag -m

Solution 2:[2]

I came across this thread and I had to share my findings (as mentioned this site is a repository for knowledge):

Solution 3:[3]

touch -c -m --date="2022-02-19 10:00" /path/to/your/file

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Krystian
Solution 2 Community
Solution 3 keikai