Page 1 of 1

Key is Broken - when using the correct passphrase

Posted: Thu 18 May 2017 09:00
by ED-Clint
Hi,

I have found a little information on this, however it has all been unanimous in that "key is broken" means the wrong password has been used. However if I open this key in puttykeygen the passphrase works, so I am a bit lost as to why I am getting this message when I am using the correct password.

I created the key using puttykeygen and I converted it to OpenSSH as other instructions detail. When I import the key I am doing the following;

procedure TForm1.ImportKey(Sender: TObject);
var
Key: TScKey;
begin
Key := TScKey.Create(ScFileStorage1.Keys);
Key.KeyName := 'key1';
Key.ImportFrom(Filename, Password);
end;

This is in XE2.

I also created a key with no passphrase and then using ImportFrom(Filename) still gives me "key is broken" so the problem is not the password (I think) but what else could it be?

Thanks.

Re: Key is Broken - when using the correct passphrase

Posted: Thu 18 May 2017 11:47
by ViktorV
Please make sure that the issue is reproduced on the latest SecureBridge 8.0.1 version. If it is, please compose a small sample demonstrating the described behavior and send it using the contact form https://www.devart.com/company/contactform.html. Also, please specify the used IDE version.

Re: Key is Broken - when using the correct passphrase

Posted: Thu 18 May 2017 12:46
by ED-Clint
Hi Viktor,

I am using Rad Studio XE2 and I installed SecureBridge 8.0.1 this morning after encountering this problem, to see if the update solved the issue, unfortunately it has not.

I will send you the sample shortly.

Re: Key is Broken - when using the correct passphrase

Posted: Fri 19 May 2017 12:49
by ViktorV
Currently, SecureBridge does not support OPENSSH keys import. We will consider a possibility of adding this functionality in one of the next SecureBridge builds.
Note, you can import original ppk keys either with a password or without it.

Re: Key is Broken - when using the correct passphrase

Posted: Fri 19 May 2017 12:55
by ED-Clint
Hi Viktor,

Thank you. Before trying this or posting for help I read the only other information I could find on here and DemetrionQ of Devart says this;
"1) The fact is that PuTTY saves keys in its own format. SecureBridge doesn't support this format. You should export the Putty key in the OpenSSH or SSH2 format to use it with SecureBridge. For that, you should load your private key in PuTTY Key Generator and export it to any available format using the Conversions menu. After that you can import your key in TScFileStorage.

2) The "Key is broken" error means that you are using an incorrect password when importing the OpenSSH key. Make sure you have specified the correct password in the Key.ImportFrom method."
Perhaps you can correct this misinformation for future searchers?

Re: Key is Broken - when using the correct passphrase

Posted: Fri 19 May 2017 13:45
by ViktorV
1. We have added support for PUTTY format keys import in SecureBridge 7.2.3. It is still possible to import a previously exported key using the menu item Conversions-Export OpenSSH key. We will consider support for a key exported using the menu item Conversions-Export OpenSSH key (force new file format).
2. The "Key is broken" error can occur not only when entering a wrong password. Some other errors can be generated when entering an incorrect password.

Re: Key is Broken - when using the correct passphrase

Posted: Fri 19 May 2017 14:29
by ED-Clint
Hi Viktor,

Thank you again, just to let you know my code is now working.

Re: Key is Broken - when using the correct passphrase

Posted: Fri 19 May 2017 14:34
by ViktorV
Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.