secure a Bluetooth connection

I think you should learn Python (or so) to get the PC side right.
Creating files from a terminal program the way you described (or better as I understood your story) is not supported as far as I know.