Using ML to encypher data for production
It sounds like you are trying to compress data, and then recover the same data later. 

The most common tool for this task is an autoencoder. This model accepts data as input, and then learns to compress it and decompress it to produce something as close as possible to the original data. By making the middle layer of an autoencoder narrower, you can make the compression more lossy. By making it wider, you can make it less lossy.