Sunday, March 24, 2013

Generating and importing RSA/DSA SSH keys into bVNC Secure

Apart from being able to generate its own SSH keys in RSA and DSA format (tap the "Manage Key" button in VNC over SSH mode), versions v3.0.5 and newer of my VNC client, bVNC Secure, can import RSA/DSA keys as well. This guide will show you how such keys are generated and imported into bVNC Secure.

bVNC Secure is an Android and Blackberry Playbook/OS 10 application, available on Google Play and App World respectively. Find it on your mobile device or here:

Google Play, for devices running Android 2.2 and up, or here:

App World for BB Playbook and OS 10 devices.

Generating supported key types in a supported format:

- Encrypted RSA keys in PEM format, obtainable with the following command:
  ssh-keygen -t rsa -b 4096 -f SOMEFILE
When prompted for a pass-phrase enter one of your choice which will be needed to make use of the key when using it to connect.

- Non-encryped RSA keys in PEM format obtainable with the following command:
  ssh-keygen -t rsa -b 4096 -f SOMEFILE
When prompted for a pass-phrase, press enter (twice).

- Non-encryped RSA/DSA keys in PKCS#8 format, obtainable with:
  ssh-keygen -t dsa -b 1024 -f TEMP
  openssl pkcs8 -topk8 -nocrypt > SOMEFILE < TEMP

Importing the key stored in SOMEFILE into bVNC by:

- copying it to the "Download" directory on your smartphone or tablet
- Creating a connection of type VNC over SSH
- Tapping "Manage key"
- Typing SOMEFILE into the text field marked "Filename in Download directory"
- If your key is encrypted, entering your passphrase in the text-field marked "Passphrase"
- Tapping "Import".

1 comment:

  1. Please help.
    bVNC Pro on Android 5.1.1
    SSH with RSA key worked with a Raspberry PI host, but not anymore.
    Tried to repeat setup as follows.
    1. On Raspi:
    ssh-keygen -t rsa -b 2048 -f myrsa
    2. copied to Android /sdcard/Download
    3. in bVNC hit Manage Key, specified bits 2048, file and hit IMPORT
    This gives "Failed to recover key-pair from file. Supported formats are encrypted/unencrypted RSA key in PEM format or unencrypted RSA/DSA key in PKCS8 format. Keys generated with 'ssh-keygen -t rsa' are known to work."

    Also tried ssh-keygen -e -m PEM -f > and used that file instaed with the same result.
    Question: what went wrong?