4

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.

Krystian
  • 405
  • 2
  • 4
  • 14
  • 1
    look at `man touch` more carefully – Ipor Sircer Nov 16 '16 at 11:29
  • 2
    @IporSircer I've just found an answer. My question can be closed :) – Krystian Nov 16 '16 at 11:29
  • 4
    Krystian, this site is supposed to be a repository for knowledge in a Q&A format. If you've found an answer to your question, while this question may feel unnecessary to you now, you're still encouraged to [write an answer](https://stackoverflow.com/help/self-answer) for the benefit of any future readers. Unless you deem the question too trivial to answer or it already has a duplicate on the site, in which case you should flag it thusly. – Reti43 Nov 16 '16 at 11:35

3 Answers3

10

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

Krystian
  • 405
  • 2
  • 4
  • 14
5

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

Community
  • 1
  • 1
Rayee Roded
  • 2,440
  • 1
  • 20
  • 21
0
touch -c -m --date="2022-02-19 10:00" /path/to/your/file
keikai
  • 14,085
  • 9
  • 49
  • 68