Is there any way of converting ECDSA key to RSA key, and vice-versa as well in Go language?
Asked Answered
D

1

6

I am working on both encryption methods and want to convert the ECDSA key to RSA key and vice versa.

Danica answered 4/8, 2022 at 10:14 Comment(1)
ECDSA and RSA are different algorithms that are not compatible. The same applies to the keys, which therefore cannot be converted. This applies in general and not only to Go.Usance
S
6

No, there isn't. ECDSA and RSA are completely different and can't be converted. ECDSA is an elliptic-curve algorithm based on the elliptic-curve discrete logarithm problem, and RSA is a finite-field algorithm based on the factoring problem. In addition, RSA can be used for signing and encryption, and ECDSA can only sign.

If you want your code to handle both, you'll need to have two separate code paths, one for ECDSA and one for RSA.

Selenodont answered 5/8, 2022 at 19:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.