Any means of communication will have it's own security ramifications. Files are workable, but possibly less efficient (you need to somehow have a semaphore so they don't write at the same time, etc...). Sockets or
named pipes would probably suit you fine, assuming you secure them properly.