I have a software development kit which packages the data for the finished program in a series of LZMA packages. I want to ensure that my software is the only program that can read the packages, even though they're compressed in an open-source format. I also want to be able to encrypt it, if the user wants to, further so that only the finished program can read it and not the original SDK. If I simply run it through an encryption method twice, will that work?
To put it in pseudo-code:
encrypt_file(filename, "SDK key")
user_key = get_input()
encrypt_file(filename, user_key)
The compressed packages contain common file formats like PNG images, MP3 audio files, etc. Will this method work properly, such that I can just decode it by doing something like this:
user_key = getkey() //Retrieve it from some configuration setting
decrypt_file(filename, user_key)
decrypt_file(filename, "SDK key")