Closed
Description
Having the private/public key It would be beneficial for users to be able to determine which type of encryption algorithm (ECDSA
,ED25519
) was used for the key generation.
How is this possible in cryptography:
- Having the private key we can extract the type of algorithm that is used for generation.
- By having the private key in DER encoded format.
- Then decoding it using a ASN1 decoder (just an example tool) most likely a third party library for JS project
- Then after decoding, it will return whether the key is
secp256k1
orcurveEd25519
For the purpose
- Good research on what third library should be used
- One possible solution is
asn1js
library would be for the decoding - In Java SDK
bouncycastle
is used. A check can be done if there's alternative for JavaScript.- Example in Java SDK: fromBytesDER
- Example in C++ SDK: decode
- One possible solution is
- Tests with a lot of different keys (at least hundred).
- Same/different byte lengths
- Same/different types (ECDSA, ED25519, RSA, Blowfish, Twofish, DES, TripleDES)