in reply to Encrypting source code :(
A PAR file is a Zip file. The executable created by pp is a self-extracting Zip file with an auto-run feature.
In theory (I haven't tested this), you could create a PAR with pp, unzip it to a temporary location, then re-zip it with a password. Make sure the new Zip file has the extension .par
Then do: pp -o myprog myscript.par
If that works the way I think it does, pp will do something like cat extractor myscript.par >myprog
(On MS Windows, it would be something like copy /b extractor.exe+myscript.par myprog.exe)
Assuming that works AND the extractor supports encrypted Zip files, running myprog will ask for the password needed to decrypt myscript.par then extract and run normally.
If that doesn't work, you can use 7zip to create encrypted, self extracting archives. I don't recall the details, but there are options to specify the extractor to use (you want the "installer extractor") and the command you want the extractor to run. You will need to unzip your PAR file before creating the self-extracting archive, otherwise it will be the PAR file that gets extracted and not the files inside it.
(Note: The "installer extractor" doesn't actually install anything. It expects the command you tell it to run to do the actual installing. In your case, the command will be to run your program. After your program exits, the extractor will delete the files it created during the extraction phase.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Encrypting source code :(
by bliako (Abbot) on Jan 05, 2019 at 14:58 UTC | |
by kschwab (Vicar) on Jan 05, 2019 at 18:11 UTC | |
by bliako (Abbot) on Jan 06, 2019 at 11:02 UTC | |
by RonW (Parson) on Jan 09, 2019 at 21:24 UTC | |
by RonW (Parson) on Jan 09, 2019 at 21:09 UTC | |
by bliako (Abbot) on Jan 10, 2019 at 12:21 UTC | |
|
Re^2: Encrypting source code :(
by Anonymous Monk on Jan 05, 2019 at 12:16 UTC |