Python is an interpreted language, so , it is very difficult to block access to source code. Even if you use a Converter exe
as py2exe, the executable layout is known as it is only compressed into a zip.
Usually, in cases like this, you have to make a choice. How important is protecting the code? Are there real secrets there (like a key to symmetric encryption of bank transfers), or are you just being paranoid? Choose the language that allows you to develop the best product faster and be realistic about how important your innovative ideas are.
If you decide that you really need to protect the script, write it as a small extension C
, however I do not know if this would apply to the platform QGis
. If it were possible for him to call an executable you would have considered the first suggestion I left in the comments regarding the SuperCrypt
, or even use a compiled language.
Translated and adapted from another issue of the English SUS.
Possible duplicate of How to decrypt MD5?
– Pedro Sanção
Encrypt what? Passwords? Data in transit? Data in rest? If you specify better what your goal is, we can probably help you more.
– mgibsonbr
I re-asked the question. I think it’s clearer.
– Guilherme Lima
Complicated... what you’re looking for is basically a form of DRM, and as far as I know is not possible to do [guaranteed]. Take a look at my answer to the question "How to protect source code?". If the client’s machine needs to do operations with this data, then: a) you can’t hide the algorithm; b) you can’t hide the data unless you use it homomorphic cryptography - something theoretical, which has already been proven possible but which is not available for practical use.
– mgibsonbr
@Guilherme Lima, from a look at this tool, might be useful for this case: http://www.moernaut.com/default.aspx?item=supercrypt I’ve used it but with vbs.
– George Wurthmann
nice, but he’s not a performer
– Guilherme Lima
@Guilhermelima you generate the lsc file with the software and use the executable to call lsc that way:
supercrypt /lscfile:"c:\google.lsc"
You cannot call a command line like this in the environment in which it is running?– George Wurthmann
Good afternoon William, you don’t want him to access the dice or you do not want it to access the content of the script as for example the algorithm you used to do the calculation?
– Guilherme Nascimento
Good afternoon, my dear.
– Guilherme Lima
No entedi kkk! Sorry I asked
A ou B?
and you said it isexatamente isso
. But I don’t know if it’s the data or the algorithm you want to protect, I expect a kind of responseé o A
oro B
– Guilherme Nascimento
I wish he didn’t see the algorithm used.
– Guilherme Lima
It’s a cool question, I just think you need to improve the text a little, anyway +1
– Guilherme Nascimento
@Guilhermelima the Supercrypt I quoted above does exactly what you are asking. You do not provide the script, but rather the.lsc file that will be called by the executable that comes along with the tool. You tried to use it?
– George Wurthmann
Yes, but my script is being used on another "Qgis" platform, that’s the problem.
– Guilherme Lima
@Guilhermelima understood, unfortunately I know nothing about Qgis. The only possibility is to run the file . py? Is the script called by Qgis? Or the script that calls the software?
– George Wurthmann
Only by Qgis, why it performs actions that require Qgis
– Guilherme Lima
@Guilhermelima this question is similar to what you need: http://stackoverflow.com/questions/261638/how-do-i-protect-python-code But unfortunately there is no way to protect. The solution would be to check in Qgis if there really is no other way to call the script, or if instead of the script there is no way to call an executable. In this case I don’t know how to do it. If I put this as a translation response or if I just put the link.
– George Wurthmann