Projects

Encryption

Introduction

You can save encrypted versions of your project files on your local machine and in QuantConnect Cloud instead of the raw, human readable, file content. To use the encryption system, you provide your own encryption key. The encryption key file must be a txt file with at least 32 characters. It’s content can be arbitrary.

Encrypt Projects

To encrypt a local project, run lean encrypt "<projectName>" --key "<keyPath>".

$ lean encrypt "My Project" --key "C:\Users\john\qc-encryption-key.txt"
Local files encrypted successfully with key C:\Users\john\qc-encryption-key.txt

To push an encrypted version of a local project to QuantConnect Cloud, add your encryption key to your browser and then run lean cloud push --project "<projectName>" --encrypt --key "<keyPath>". If your local project is unencrypted when you run this command, the project sent to QuantConnect Cloud is encrypted but the project on your local machine remains unencrypted. If your local project is unencrypted and has a library when you run this command, the project sent to QuantConnect Cloud is encrypted but the library sent to QuantConnect Cloud remains unencrypted.

$ lean cloud push --project "My Project" --encrypt --key "C:\Users\john\qc-encryption-key.txt"
[1/1] Pushing 'My Project'
Successfully created cloud project 'My Project' in organization 'd6d62db48592c72e67b534553413b691'
Successfully updated name, files, and libraries for 'My Project'

To pull an encrypted version of a project in QuantConnect Cloud to your local machine, run lean cloud pull --project "<projectName>" --encrypt --key "<keyPath>". If your cloud project isn't encrypted when you run this command, the project you pull to your local machine is encrypted but the project in the cloud remains unencrypted.

$ lean cloud pull --project "My Project" --encrypt --key "C:\Users\john\qc-encryption-key.txt"
[1/1] Pulling 'My Project'
Successfully pulled 'My Project/main.py'
Successfully pulled 'My Project/research.ipynb'

Decrypt Projects

To decrypt a local project, run lean decrypt "<projectName>" --key "<keyPath>".

$ lean decrypt "My Project" --key "C:\Users\john\qc\encryption-key.txt"
Successfully decrypted project C:\Users\john\qc\workspaces\AI Capital\My Project

To pull a decrypted version of a project in QuantConnect Cloud to your local machine, run lean cloud pull --project "<projectName>" --decrypt --key "<keyPath>". If your cloud project is encrypted when you run this command, the project you pull to your local machine is decrypted but the project in the cloud remains encrypted.

$ lean cloud pull --project "My Project" --decrypt --key "C:\Users\john\qc\encryption-key.txt"
[1/1] Pulling 'My Project'
Successfully pulled 'My Project/main.py'
Successfully pulled 'My Project/research.ipynb'

To push a decrypted version of a local project to QuantConnect Cloud, run lean cloud push --project "<projectName>" --decrypt --key "<keyPath>". If your local project is encrypted when you run this command, the project you push to the cloud is decrypted but the project on your local machine remains encrypted.

$ lean cloud push --project "My Project" --decrypt --key "C:\Users\john\qc\encryption-key.txt"
[1/1] Pushing 'My Project'
Successfully created cloud project 'My Project' in organization 'd6d62db48592c72e67b534553413b691'
Successfully updated name, files, and libraries for 'My Project'

Collaboration Support

Encryption isn’t available for projects that have collaborators.

Libraries

Encrypted projects can use libraries encrypted with the same project key or unencrypted libraries. However, you cannot use a library encrypted with a different project encryption key.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: