Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more algorithms to support cryptocurrency #4

Closed
huskcasaca opened this issue Apr 4, 2023 · 4 comments
Closed

Add more algorithms to support cryptocurrency #4

huskcasaca opened this issue Apr 4, 2023 · 4 comments

Comments

@huskcasaca
Copy link
Contributor

Add support for ECDSA secp256k1 (current is secp256r1)
Add more cryptography providers like bouncycastle and spongycastle

@whyoleg
Copy link
Owner

whyoleg commented Apr 4, 2023

Hey, thx for the interest!
I believe it's possible already now (though not tested yet)
to use custom JDK JCE provider (like bouncy castle) you just need to use not default provider but create it.
So f.e. you can create BC provider and use to get ECDSA with custom curve similar to this example:

val BC = CryptographyProvider.JDK(JdkProvider.Instance(BouncyCastleProvider()))
//now use BC as provider, f.e:
val endsa = BC.get(ECDSA)
val keyPairGenerator = ecdsa.keyPairGenerator(EC.Curve("secp256k1"))

Feel free to ping me on results, if you will be able to try it

@Neustradamus
Copy link

Important to know, there are a lot of CVE in Spongy Castle.

It is needed to use Bouncy Castle:

@whyoleg
Copy link
Owner

whyoleg commented Aug 18, 2023

Hey, current dev branch now contains both testing that every supported algorithm works with Bouncy Castle (specifically org.bouncycastle:bcprov-jdk18on dependency) and that it works on Android API 21+ via integration tests using emulator.
From under the hood implementation side, there were little changes, so I could confirm, that overall almost everything should work here on Android and JVM with Bouncy Castle (PEM certificates could not work on all Android versions, as for now they require java.util.Base64)
I will also add an additional test for secp256k1 curve, but I believe there will be no issues.

@whyoleg
Copy link
Owner

whyoleg commented Sep 5, 2023

0.2.0 is released.
Added a small note on custom providers and Android support in documentation: https://whyoleg.github.io/cryptography-kotlin/modules/cryptography-provider-jdk/#custom-java-providers
secp256k1 curve is supported by OpenSSL3 and JDK with BouncyCastle providers out of the box

@whyoleg whyoleg closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants