did you ever have to encrypt your data cause it is so sensitive that you cannot store it on hdd to read in normal batch processing? No? But I do, sadly.
Assuming that you'll store your image in example folder and save your keys in .bin format you can change your config param to provide an proper encryption.
Decryption part is very simple, but I decided to omit image saving part because storing data in memory is the most important part. So, assuming that you have you data stored and proper defined in config file.