Yes, you can load an encrypted memblock from a file, then decrypt it in memory and then convert it into the media format you need. They key is to write out the memblock(s) using the media format(s) you will want to later import it in.
So the process looks something like:
- Convert all of your media files you want encrypted to memblocks using the relevant commands:
> CreateMemblockFromObjectMesh
> CreateMemblockFromSound
> CreateMemblockFromImage
> CreateMemblockFromFile (text files, data, files, etc)
- Encrypt the memblocks using whatever system you want.
- Save out the now encrypted memblocks to files using CreateFileFromMemblock.
Then on the loading side, you simply reverse the process:
- Load the encrypted memblocks into memory using CreateMemblockFromFile.
- Decrypt the memblocks as needed.
- Convert the now decrypted memblocks to the format needed and place in relevant media indexes you want to use with the needed commands:
> CreateObjectFromMeshMemblock
> CreateSoundFromMemblock
> CreateImageFromMemblock
This way, you never have to save out the memblocks to files before loading them into media indexes. Everything stays in memory.