Why?
If you have your RPi remote from the host, and use Octoprint (I don't know about Repetier server, but guess it's the same), the connection from host to the RPi can be encrypted with https
If the RPi itself is secure, then it doesn't matter that the Gcode is stored on it. I have my RPi right alongside the printer.
Ultimately, if someone has physical access to the printer (or the connection to it) they'll be able to record your Gcode as it's sent to the printer or even the pulses sent to the steppers and replay them. But if they have access to your printer, they can steal the object once it's printed.