Embedding prolog program source in a foreign language as library calls - for protection

Hello,

I noticed the other day a (link to a?) C# example here in the forum that initialized the prolog engine and then asserted via a library call two facts.

I then had this (weird?) thought – what if i write a short program that takes a prolog program and embeds it into C program as source code – this is instead of consulting prolog source from an external file.

IF i were to do that and then compile the c program along with some kind of stub – that, say, enables the C program to receive (say) websocket “commands” that are passed along to the internal prolog engine – wouldn’t all that make the prolog source hard (or even impossible) to access – given the c binary ?

thanks,

Dan

https://linux.die.net/man/1/strings

I see …

I would have to add some kind of scrambler / obfuscator – and unscrambler as i send commands to the prolog engine

And, in the hope, that its hard to figure out how all the text in the binary file is scrambled

thanks :slight_smile:

Dan

I guess encryption is the solution to most secrecy issues. But how you do it depends on the situation.