2 Encrypt
nique_372 edited this page 2026-04-19 11:21:55 -05:00

Utils Tab: Encryption

From this sub-tab you can encrypt files inside the base folder configured in the General tab, using inclusion and exclusion patterns defined in a JSON file.


Parameters

  • Method: Encryption algorithm to use. Available options:
Method Required key length
AES 128 16 characters
AES 256 32 characters
DES 7 characters
  • JSON config file: JSON file that defines which files will be encrypted and which will be kept unencrypted. Use the Browse button to select it, or the ? button to load a default template.

The file format is as follows:

{
    "incluyed": [
        "*_median_iqr.csv",
        "*.onnx",
        "idx.txt",
        "Features\\"
    ],
    "excluyed": [
        "*.png"
    ]
}
  • incluyed: File patterns that will be encrypted. Full folders can also be specified such as Features\\.
  • excluyed: File patterns that will not be encrypted even if they match an incluyed pattern.

In the example above, scaling files (*_median_iqr.csv), ONNX models (*.onnx), the index file (idx.txt) and all content in the Features\ folder will be encrypted, except .png files.

Simple patterns such as *, ? and ^ are supported. For more information see: https://forge.mql5.io/nique_372/MQLArticles/src/branch/main/Utils/StrMatch/README.md

  • Output extension: Extension that will be appended to the encrypted file. Default: .enc. Example: model.onnxmodel.onnx.enc.

    If this field is left empty the encrypted file will overwrite the original.

  • Key: Encryption key. Must have exactly the length required by the selected method. Has two helper buttons:

    • : Automatically generates a high-quality random key.
    • 👁: Shows or hides the key value.

Buttons

  • Browse: Opens the selector to choose the configuration JSON.
  • ?: Loads a default template with the correct structure.
  • Encrypt: Runs the encryption on the base folder. Before running it will ask if you want to delete the original files after encrypting. The button changes to Encrypting... while the operation is in progress.

Make sure to save the key in a safe place. Without it you will not be able to decrypt the files later. Make sure you have configured the base folder in the General tab before running.