In that case would it not be use-full to use a tunnel to protect your data. Something like the C script you talked about opens an SSH tunnel to the localhost and throws the data in there, with perl script waiting on the other side waiting to munge... ??? 8-&
Sinister greetings.