Skip to content

Encrypting the source code

As of Allplan 2022-1, it's possible to encrypt the .py-files containing source code. The encrypted files are unreadable and allow to protect the developer's copyrights.

The encrypted files are given the extension .pye and are used if no .py file is available. Instead of the .py files the .pye files can be delivered to the customer.

The encryption of the source code can be executed by the PythonPart EncryptPythonPartScript, located in \etc\Examples\PythonParts\ToolsAndStartExamples.

Encrypt PythonPart script

The encryption can be executed for a single file or a directory. If a directory is selected, the files from the sub directories are also encrypted. The sub directories are created in the target directory, if they don't already exist there.

Testing the PythonPart using the encrypted file(s) can be done as follows:

  • create a directory xxx_Encrypt with xxx is the location of the .py file(s)
  • create the .pye file(s) with the PythonPart EncryptPythonPartScript
  • temporary modify the <Name> tag in the .pyp file by using xxx_Encrypt
  • execute the PythonPart