Another option is encryption+compression, and not with zipfile either. Have you guys heard of Zstandard? Its fast and quick like ZIPs are but just as good as LZMA. And its multithreaded too - the first compression ever to be fully multithreaded. For something like that, you could try something like:
import cryptography.fernet, os, os.path
def encrypt(filename):
encrypter1=cryptography.fernet.Fernet(b'your-encryption-key-here')
compressor=zstandard.ZstdCompressor(level=22, write_checksum=True, write_content_size=True, threads=-1)
file = open(os.path.abspath("")+"/"+filename, "rb")
encrypted_uncompressed_data=encrypter1.encrypt(file.read())
compressed_encrypted_data=compressor.compress(encrypted_uncompressed_data)
encrypter2=cryptography.fernet.Fernet(b'another-cryptographic-key')
double_encrypted_compressed_data=encrypter2.encrypt(compressed_encrypted_data)
compressor2=zstandard.ZstdCompressor(level=22, write_checksum=True, write_content_size=True, threads=-1)
final_data=compressor2.compress(double_encrypted_compressed_data)
file.close()
return final_data
What this does:
We first create a Fernet object that holds a 32-byte (256-bit) key for AES-256 encryption. You could construct this data manually but you'd need to pass around nonces and things.
We then create a Zstandard.ZstdCompressor object that is used during our first encryption/compression pass.
We open the file passed into the function and read it in to the first encryptors encrypt() method.
We then pass the encrypted data through the compressor object which, while compressing the data, writes a checksum and the content length at the start of the compressed data, ensuring its not modifiable, then compresses it.
We then redo this again (encryption and compression but not rereading the file) and return the final data.
You can modify this to your liking, but its certainly one way to secure your data. Packing it into a zipfile could also be done this way: run all your maps and data through this function, zip it, then run the zipped raw data through this function and you've pretty much got inaccessible data unless someone can get the key from your Python code, and if you modify the Python bytecode structure in Python's source code, you can make decompilation and disassembly pretty much impossible.
"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." — Charles Babbage.
My Github