bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
237 stars 122 forks source link

Use bcrypt with pc-dart #84

Open konsultaner opened 3 years ago

konsultaner commented 3 years ago

I used pc-dart to implement some authentication processes in my network library connectanum-dart. For one of the authentication processes I need to load ed25519 keys. I tried to implement loading from open ssh key format. This works well. If the files private key is encrypted, bcrypt_pbkdf is used.

Since pc-dart does not support bcrypt, I translated the original jbcrypt code to dart. The code can be found in my library.

The code it self is just slightly changed, but works with the given tests and vectors. It is just not very fast for some reasons.

I would love to use pbkdf from pc-dart in conjunktion with bcrypt. Could you either add bcrypt to your code or give me a hint how to use my code to provide a bcrypt digerster to make it work?

konsultaner commented 3 years ago

I fixed up performance with bcrypt. I guess its kind of usable now. [Update] The performance is good to go now. pretty much equal to what the original implementation has.