Heavy Loading times (Plugin Initialization) using Encrypted Expansions
-
Hi, im upgrading to Encrypted expansions in my plugin but is taking too long to Initialize the Plugin or Standalone app when there is an expansion, as soon I delete the Expansions folder the Plugin loads a lot faster, im using the System ID and Encryption Key to Encrypt them.
I Reduced the images sizes but the result is the same...
-
@Soundavid said in Heavy Loading times (Plugin Initialization) using Encrypted Expansions:
as soon I delete the Expansions folder the Plugin loads a lot faster
Does it load faster when disabling the encryption?
-
@d-healey Yes! When im using FileSystem Expansions the plugin loads a lot faster
-
@Soundavid how big is your encryption key? You can set an arbirtrary length and the decoding speed is proportional to the key length. With 1234 it‘s trivial so just pick a suitable compromise for your taste (and remember that brute forcing the encryption key is most often not the attack vector).
-
@Christoph-Hart The Encryption Key that I set in the Project Settings is 72 character length, but the JSON object that im using to Set the expansion credentials contains almost 86 characters.
Which of them should I reduce?
-
@Soundavid the key because it is used to encrypt the bulk data that is embedded. The JSON object will be encrypted with the fixed size RSA key.
-
@Christoph-Hart Ok, thanks I will test this, how many characters do you recommend for a fast loading but fairly secure encryption key?
-
@Soundavid more than 4, less than you have :)
-
@Christoph-Hart That's a Big window :') Thanks!
-
@Christoph-Hart Ok I reduced the Encryption Key and the JSON Content A LOT! And Improves the loading time just a little like in a 10%, this is a normal behavior? Or im doing something weird? Im Calling the setCredentials function way before setting the setAllowedExpansionTypes in my script, maybe this has something to do with this?
include ("Theme.js");
include ("Paths.js");
include ("License.js"); ---> Here is where I set the Credentials and Check the Plugin License
include ("LAF.js");
include ("GUI.js");
include ("Filters.js");
include ("Controls.js");
include ("Mapping.js");
include ("Expansions.js"); ----> Here is where I set the Allowed Expansion Types
include ("Meters.js");
include ("ZoomHandler.js");
include ("Paint.js"); -
@Christoph-Hart Ok, I've tried everything and seems that the problem was with the Presets, I removed all the presets and create only a fresh preset to load the expansion and the plugin loads almost immediately
-
@Soundavid how big is a .preset file and how many presets are in there?
-
@Christoph-Hart Aproxx 131KB per Preset and 406 Total Presets (Summing all 6 expansions)
-
@Christoph-Hart Ok, My Solution was encoding the Expansions without presets and shipping the Preset Folder additionally, everything loads a lot faster now.
-
@Soundavid good idea at some point I might consider removing the user presets from the encryption payload (as they are living unencrypted on your hard disk anyways), but that‘s a good solution.
-
I already added this - https://github.com/christophhart/HISE/commit/28afe964c6f0739c8fdbe7270809b452274880b8
-
@Christoph-Hart Maybe let the user decide what would be encrypted with a checkbox? In this way we could update things like Presets, images, MIDI Files or Audio files without re-encoding the expansion but maintaining the encryption and copy protection.
-
@Soundavid said in Heavy Loading times (Plugin Initialization) using Encrypted Expansions:
Maybe let the user decide what would be encrypted with a checkbox?
Check my post above.
-
@d-healey Nice!