how ta pass value of a variable to the stdin of a command
===

I'm writing a shell script that should be somewhat secure i.e. does not pass secure data through parameters of commands or preferably does not use temporary files. How can I pass a variable to the stdin of a command? Or, if it's not possible, how to correctly use temporary files for such task?