Repository navigation
Replies: 30 comments 1 reply
|
Tough one. Elliptic Curves are so far away that I can't see it in my roadmap ;). First RSA, then Elliptic Curves, or the other way around. Let's keep it open for inspiration. |
|
I have a few projects here where elliptic curves are the only option for keys. Also, many sites are moving away from RSA to ECDSA certificates, so it may be good to reassess support. |
|
Not quite the same use case. Are you thinking of offering a Diffie-Hellman Key Exchange API? I was thinking of Client A (iOS) talking to Client B (MacOS) and they wanted to agree on a symmetric shared secret using unauthenticated DH. CryptoSwift for both sides ✅ I am playing with Diffie-Hellman Key Exchange with OpenSSL to make sure I have understood the concepts. |
|
Hi, There is also a requirement from Apple to use ECDSA when accessing CloudKit Using a Server-to-Server Key. Having ECDSA support would be highly appreciated. Regards, |
|
im working on this and other things, no ETA though |
|
@krzyzanowskim Thanks for the update. Great work! |
|
Yes elliptic curve support would be huge, any updates? |
totally agree 👍 😁 |
|
I'm willing to chip in some time to help out on it as well, if you have a branch in progress, seems like Swifts lack of support for Big Int is the first major roadblock to overcome |
|
I'm ready to add that though, just hard to find spare time..Would you consider donations to keep the project more vital in these days? |
|
Sure I would contribute to that |
|
@saltyskip for the Big Int support you can check this component GitHub:attaswift/BigInt |
|
+1 on Elliptic Curve support! Any updates? I would contribute to that :) |
|
+1 on elliptic curve support. It's requirement for generating JWT used on many Apple server APIs, including APNs, Apple Music API, and the upcoming App Store Connect API. |
|
Would love this. I download a public key (DER) from a server and then need to use that key to verify a signature. I'm absolutely banging my head against the wall. |
|
Hi all, I believe many want EC support here is because they need to create and sign JWT for Apple's server APIs. If you want to sign Apple's JWT on iOS/macOS, you could give CupertinoJWT a try, which was pre-released recently. I've wrote it because I couldn't find a solution for creating JWT used for Apple's server APIs on iOS/macOS. It use Security and CommonCrypto only as dependencies. |
|
Yes, EC support would be awesome! |
|
I've written a pure Swift library called EllipticCurveKit, which has support for ECDSA, Schnorr Signatures (ECSS), and both In the branch called "Equations" I support any curve, and most curve forms. Doing the straightforward Double-Multiplication Algorithm, requires the differentiation of the curve equation, which most projects implements use hard-coded differentiation (since the equations usually are rather simple. I wanted to be able to support ANY curve, therefore I experiment in the above-mentioned branch with a run-time partial differentiation, thanks to EquationKit(which I wrote specifically for this purpose). |
|
With the help of smart people in this thread, it would be cool to migrate EllipticCurveKit into this repo, make it faster and more secure 🎉. One idea I've had for performance improvement is to swtitch from attaswift/BigInt(which I currently use) to Apple/vecLiv/vBigNum. And implement more of the performance optimized algorithms that can be found on Explicit-Formulas Database(the EC bible). |
|
@Sajjon I'm ok with that. that'd be great. wanna start with PR? |
|
@krzyzanowskim Sure, when I have the time... Probably not for a couple of weeks though. Currently, CryptoSwift has no dependencies, but I use (and need) BigInt and BigUInt. Or at least Int512 and UInt512. In EllipticCurveKit I use awesome attaswift/BigInt. AFAIK CryptoSwift does not contain any BigInt implementation, right? Would you be OK to add it as a dependency? If not, one alternative could be to copy paste Apple's Prototype BigInt straight into CryptoSwift. I haven't tried it out, but it looks promising and similar. And Karoy Lorenty who created attaswift/BigInt is working at Apple and has written lots of the code of the Apple prototype. |
|
Not sure if this helps at all, but just in case: https://gist.github.com/danshev/01b83d702b5ca265e43dfe7223924b68 |
there is UInt128, that's may be a good start ;) We don't need fully featured Int for EC afair, so maybe it's enough to implement what's needed. |
|
@krzyzanowskim We need at the very least Int256 and UInt256, the Galois (finite) Field of all Some Elliptic Curve Method operations, e.g. the fundamental Double-Multiplication Algorithm can result in values being larger than 256 bits - temporarily - until they have been reduced to 256 bit using modulus (mod P, where P is the size of the Galois Field). Thus it is practical to use a non-fixed-with in, such as attaswift/BigInt or Apples A func power(_ exponent: BigUInt, modulus: BigUInt) -> BigUIntFor the operations resulting in very big numbers, that we reduce using |
|
Ping @krzyzanowskim how would we proceed regarding |
|
I'm in favor to not use external dependency. if anything https://github.com/attaswift/BigInt is my favorite. The maintainability is my biggest concern here now. If Int256/UIn256 is all we need, I'd go and start with that plus whatever is necessary to save larger value temporary - Not starting with building BIGNUM at the start. In my opinion that can end up with a more straightforward code to follow in the future. @Sajjon if you'd like to work on that, I'd be more than happy to help/assist - feel free to open PR and continue work on a branch. |
|
Is this still in works? the last updates seems to be of 2019😅 |
|
once we merge RSA, we can thing about EC #887 |
|
For now, my RSA implementation is working, but extra features like PEM import/export and doc is missing. I can try to find time in the week to document what I've done so far (in the README), and make another PR to add PEM features later, so that you will be able to use BigInt directly. |
|
Is this still in works? the last updates seems to be of 2021😅 |
Uh oh!
There was an error while loading. Please reload this page.
I have no idea where to begin otherwise I'd make a pull request (requirement for kylef/JSONWebToken.swift#5). Maybe one day I'll find time to take a look into implementing this.
All reactions