Open Nihildum opened 2 years ago
P.S.: My ssh key is an 4096 RSA key. With https://pub.dev/packages/ssh2 I did not had these problem, but there the release version of my App was not working properly.
The algorithm used in encrypted private keys is bcrypt, which is a password hashing algorithm and is slow by design. You can use the compute
function to move the computation to other isolates, as described in README.
Thanks for the answer. Using the compute to load the key solver the issue with the connection.
What do you mean in "bcrypt, which is a password hashing algorithm and is slow by design" with "slow by design". Slow in order to take long or slow because it needs a lot of computations?
Nevertheless, the application still hangs on the cat of the file.
@Nihildum did you find a solution? I have the same issue with any interaction of the package
I switched technology in my project. The ssh connection to the server was used in first prototype. When I implemented a real server with protobuf, I no longer neded the dartssh2 package.
Unfortunately I don't have that option
@xtyxtyx I am just using username
& onPasswordRequest
. Is there a way to prevent the main thread from blocking? Or do you have an idea on how we can prevent this in general?
For some reasons the use of dartssh2 blocks the main thread of my flutter application. This happens when I connect to the server and when I run a simple command on the server e.g. cat file.txt which is very small (like 100 characters). I run my application with a debugger and stopped it during the hangs. For the connection it seems that the loading of the ssh key takes quite some time, for the cat I not that sure.
Since dart has just one thread und there are no async calls in between, the main application hangs. Is there something I can to to prevent the hangs?
Connect to the server: F (bcrypt.dart:1242) Blowfish.encipher (bcrypt.dart:1154) Blowfish.expand0state (bcrypt.dart:1193) bcrypt_hash (bcrypt.dart:1267) bcrypt_pbkdf (bcrypt.dart:1343) OpenSSHKeyPairs._decryptPrivateKeyBlob (ssh_key_pair.dart:213) OpenSSHKeyPairs.getPrivateKeys (ssh_key_pair.dart:138) SSHKeyPair.fromPem (ssh_key_pair.dart:24) ServerConnection._connect (connection.dart:23)