RSA format..
-
OK I have a client generating RSA keys on the server, for me to decrypt in the plug-in, and they are asking about sizes, and I cant find anything definitive in the documentation.
So how many bits in the RSA key? - they are using .Net 7 and they cant go below 512-bit
are we using some sort of padding too?
-
@Lindon Hise creates 512bit keys:
RSAKey::createKeyPair(publicKey, privateKey, 512, seeds, 6);
Although I wonder if it would be easy to add a preference menu for longer keys.
I have read somewhere 512bit keys have already been brute forced in a Juce made plugin...
512 is the strict minimum for any online generator, so it might be a good idea to use a longer one, I don't see where it could be a problem to be safer -
That been said, I think it is possible to replace the keys in the RSA with a longer one anyway.
But I'm trying to create a preference entry for an "all in Hise" solution... -
@ustk thanks mate.
-
After creating a preference, I am trying to read it from the projectHandler with no success.
void ProjectHandler::createRSAKey() const { RSAKey publicKey; RSAKey privateKey; Random r; const int seeds[] = { r.nextInt(), r.nextInt(), r.nextInt(), r.nextInt(), r.nextInt(), r.nextInt() }; auto existingFile = getWorkDirectory().getChildFile("RSA.xml"); if (existingFile.existsAsFile()) { publicKey = RSAKey(getPublicKeyFromFile(existingFile)); privateKey = RSAKey(getPrivateKeyFromFile(existingFile)); } else { //auto length = GET_HISE_SETTING(getMainController()->getSettingsObject(), HiseSettings::Other::RSAKeyLength).toString(); //auto length = dynamic_cast<GlobalSettingManager*>(getMainController())->getSettingsObject().getSetting(HiseSettings::Other::RSAKeyLength).toString(); auto length = GET_HISE_SETTING(getMainSynthChain(), HiseSettings::Other::RSAKeyLength).toString(); RSAKey::createKeyPair(publicKey, privateKey, (int)length, seeds, 6); }
I've tried a dozen of things to get the controller but I get an undeclared identifier
getMainSynthChain
,getProcessor
or whatever I put here. I also tried some dynamic_cast but same result... -
@Christoph-Hart What are the
serverKey1/2
used for in the RSA file? Server encrypted communication?