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.
yet this rule isn't enforced with the CLI
D:\qc\workspaces\quantconnect>lean project-create "Library/MyEncryptLibrary"
Successfully created Python project 'Library/MyEncryptLibrary'
D:\qc\workspaces\quantconnect>lean encrypt "Library/MyEncryptLibrary" --key "C:\Users\derek\Desktop\encryption-file2.txt"
Local files encrypted successfully with key C:\Users\derek\Desktop\encryption-file2.txt
D:\qc\workspaces\quantconnect>lean project-create "EncryptTest3"
Successfully created Python project 'EncryptTest3'
D:\qc\workspaces\quantconnect>lean encrypt "EncryptTest3" --key "C:\Users\derek\Desktop\encryption-file.txt"
Local files encrypted successfully with key C:\Users\derek\Desktop\encryption-file.txt
D:\qc\workspaces\quantconnect>lean library add "EncryptTest3" "Library/MyEncryptLibrary"
Adding Lean CLI library D:\qc\workspaces\quantconnect\Library\MyEncryptLibrary to project D:\qc\workspaces\quantconnect\EncryptTest3
In the Cloud Platform docs, we say
yet this rule isn't enforced with the CLI