Page 1 of 1
distributing SSH keys
Posted: Thu 06 Oct 2011 16:47
by PaulReeves
I've recently added SSH connections to a PostgresQL database (using SecureBridge and PGDAC components). This is perhaps a basic question best asked elsewhere, but is there a simple way to compile the required SSH keys into the program data? I like being able to distribute a single EXE file. If possible, would this be bad practice?
Posted: Fri 07 Oct 2011 11:36
by Memnarch
similar problem here.
I tried to load a key from a string in delphi and it failed.
write string to stream
key import from stream
-->wrong data format
Re: distributing SSH keys
Posted: Tue 11 Oct 2011 09:21
by Dimon
PaulReeves wrote:I've recently added SSH connections to a PostgresQL database (using SecureBridge and PGDAC components). This is perhaps a basic question best asked elsewhere, but is there a simple way to compile the required SSH keys into the program data? I like being able to distribute a single EXE file. If possible, would this be bad practice?
You can store your SSH keys into the program data, but it is very insecure way and it contradicts with the principles of secure connections.
For every connection maximum 2 keys are needed - a server public key and a client private key. Server public key can be changed by server any time and therefore it is not effective to store it in the program data. Client private key must be individual for every client and must be protected from external access for the sake of security. Therefore this key cannot be stored in the program data as well.
Posted: Tue 11 Oct 2011 09:22
by Dimon
Memnarch wrote:similar problem here.
I tried to load a key from a string in delphi and it failed.
write string to stream
key import from stream
-->wrong data format
SecureBridge allows importing keys from many formats. But all the same this file or stream must contain all data, including captions and description that define the appropriate format. You can generate a new key using the TScKey.Generate method and try saving it in different formats using the TScKey.ExportTo method that will help you to see the data that is saved.
Re: distributing SSH keys
Posted: Tue 15 Nov 2011 09:31
by BlackWitcher
Hello!
I have similar situation but it's have some differences (sorry for big message):
I want to put SSH key files in local protected database (distributed with application) in BLOB-fields, and take this keys from DB before create connection to server.
I solved this task with ScFileStorage component as a Storage assigned with ScSSHClient component.
All is ok, but ScFileStorage create key-files on hard disk even if I put keys from TStream (First I created two ScKey object [user key and server key] and import keys from stream over ScKey.ImportFrom method, then add ScKey into empty ScFileStorage).
Of course I can make ScFileStorage.DeleteStorage after disconnect, but I want to avoid *.key files on disk when my App is works.
I thought about using ScRegStorage, but:
1. I won't touch registry at whole.
2. I'm afraid collisions, when final user will haven't permissions to work with registry.
So, is there some methods to use key storage in memory only?
May be in next versions you can add new component, named likes ScMemStorage (could works with TMemoryStream)?
In any case, thank you in advance and many thanks for beautiful and effective component suite.
Posted: Wed 16 Nov 2011 07:19
by Dimon
Thank you for the advice. We will investigate the possibility of adding such functionality in one of the next SecureBridge builds.
Re: distributing SSH keys
Posted: Wed 29 Aug 2012 07:39
by amiller29au
Adding Vote to have this functionality added.
Re: distributing SSH keys
Posted: Fri 31 Aug 2012 08:11
by AndreyZ
You can leave your suggestions for a new SecureBridge functionality at our UserVoice page:
http://devart.uservoice.com/forums/174370-securebridge