Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

Is a txt document is safe compared to pdf ?

gw0gvq

macrumors 65816
Original poster
Jan 30, 2012
1,174
65
Barry, South Wales, UK
I emailed a pdf from my mac to someone earlier this week, and was told

'Generally speaking plain text files- which have suffixes such as .txt, .csv, .md, .Rmd (and others)- are the only truly safe files. The files are too simple for virus to hide in (there is nothing in them but the characters in the file).' If this is the case why does Apple prefer to use them? I know News Groups prefer to use plain text and I've been told Visually Impaired people find .txt easier to read, so, why are they used by mac if they ant secure?
 
Any file can be harmful, it's not about what extension it is. Text Files .txt, Comma Separated Values (.csv), Markdown (.md) are basically the same plain text file, the extension is used by a program to tell it how to open, Numbers or Excel recognize .csv files as table compatible data. Markdown editors see the .md extension and know to expect Markdown. Yet it is no different than a plain text file. PDF or portable document format is a coded document, think of a more complex Markdown file (simply stated). While it is less common for .txt files to contain malicious code, it is still possible to create a text file that runs some operation during launch.

As long as you are downloading files from reputable sources, the risk is extremely low for you to catch malicious code. However, if you are comparing the safety of basic files like this, you might be causing yourself undue stress. I don't have figures to give you to help ease your mind about it but I can tell you that out of the (conservative) tens of quintillions of files available on the Internet maybe 1000 or so are malicious plain text files.

You should be more concerned about hidden extensions. (e.g. somefile.txt.bat on windows or somefile.txt.sh on Mac or Linux)
 
Comment

superscape

macrumors 6502a
Feb 12, 2008
930
218
East Riding of Yorkshire, UK
I think he had in mind the case for visually impaired people as he works for RNIB thats Royal National Institute for the Blind in the UK

Ah, right. He may well be right from a readability point of view.

However, as far as the 'safety' of the files, I think he's at best a little paranoid and at worst just plain wrong.
 
Comment

Tomorrow

macrumors 604
Mar 2, 2008
7,159
1,357
Always a day away
Older email protocols were only capable of transmitting text. Anything binary - images, PDF's, etc. - had to be UUencoded before sending and UUdecoded upon receipt. Some of the first email clients began to do this process for the user as opposed to doing it manually.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.