bcgit / pc-dart

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

EC encryption and decryption #118

Open tjcampanella opened 3 years ago

tjcampanella commented 3 years ago

Is there any EC engine for encrypting data with elliptic curve keys? I couldn’t find anything in the api reference. Thanks for any help.

AKushWarrior commented 3 years ago

https://pub.dev/documentation/pointycastle/latest/api.ecc/api.ecc-library.html

tjcampanella commented 3 years ago

@AKushWarrior I don’t know if I am missing something, but I don’t see any way to encrypt data with it. Just ways to get the keys.

AKushWarrior commented 3 years ago

Oh, yeah. This was done before I joined the project, so I'm not the most familiar.

It looks like the BouncyCastle engine is split across a bunch of files, but the entry point is https://www.github.com/bcgit/bc-java/tree/master/core%2Fsrc%2Fmain%2Fjava%2Forg%2Fbouncycastle%2Fcrypto%2Fec%2FECElGamalEncryptor.java

tjcampanella commented 3 years ago

Oh ok so this isn’t yet implemented for pointy castle. Thank you. I will look into implementing it myself.

AKushWarrior commented 3 years ago

If you do, submit a PR! I have a feeling a lot of people would want/need this work.

I'll also use this issue as tracking if I get around to implementing this.

tjcampanella commented 3 years ago

I just forked a package I found doing this and I updated it for null safety and such. Would you mind taking a look and seeing what you think: https://github.com/tjcampanella/secp256k1Cipher.

licy183 commented 3 years ago

I just submit a pull request #127. Maybe it helps.

AKushWarrior commented 3 years ago

@mwcw I reviewed and this looks merge-ready to me.

mwcw commented 3 years ago

Yes, sorry about the delay.