This is a simple thing to answer, as the hackers cannot access your private keys if they are not online. So, the simplest method is the most secure one, simply write them down on a piece of paper.