What if you want to distribute a game or some other program but don't want users to see the content of the files used by this program?
PPL now has a set of functions to implement encrypted file packaging very easily into your projects. The file is encrypted with the key you have specified. There is a limit of 16000 files per package file.
Here is a simple demo on how to use package files:
Hope you guys like it.
PPL now has a set of functions to implement encrypted file packaging very easily into your projects. The file is encrypted with the key you have specified. There is a limit of 16000 files per package file.
Here is a simple demo on how to use package files:
- Code:
// PPL integrate Package file system demo written by Alain Deschenes (c) 2004 ArianeSoft
// Delete the package file first
DeleteFile("c:\\ppl\\pc\\run\\test\\data.pkg");
// Open the package data.pkg
p$ = OpenPackage("c:\\ppl\\pc\\run\\test\\data.pkg", "MyPrivateKey");
// Add the file editor.ppl to the package file.
AddFileToPackage(p$, "c:\\ppl\\editor.ppl");
// Add the file main.ppl to the package file.
AddFileToPackage(p$, "c:\\ppl\\main.ppl");
// Verify if file main.ppl is really part of the package file.
if (PackageFileExists(p$, "main.ppl"))
// Extract the file into a temporary unencrypted file.
fn$ = ExtractFileFromPackage(p$, "main.ppl");
// Load file content to a variable.
s$ = LoadStr(fn$, sz$);
// Delete the temporary file immediately.
DeleteFile(fn$);
// Show file information.
ShowMessage(fn$ + " = " + s$);
end;
// Close package file and write all changes to disk if needed.
ClosePackage(p$);
Hope you guys like it.