Skip to content

Implement method to determine which encryption algorithm is used for key generation - ECDSA or ED25519  #2170

Closed
@agadzhalov

Description

@agadzhalov

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:

  1. Having the private key we can extract the type of algorithm that is used for generation.
  2. By having the private key in DER encoded format.
  3. Then decoding it using a ASN1 decoder (just an example tool) most likely a third party library for JS project
  4. Then after decoding, it will return whether the key is secp256k1 or curveEd25519

For the purpose

  1. Good research on what third library should be used
    1. One possible solution is asn1js library would be for the decoding
    2. In Java SDK bouncycastle is used. A check can be done if there's alternative for JavaScript.
      1. Example in Java SDK: fromBytesDER
      2. Example in C++ SDK: decode
  2. Tests with a lot of different keys (at least hundred).
    1. Same/different byte lengths
    2. Same/different types (ECDSA, ED25519, RSA, Blowfish, Twofish, DES, TripleDES)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions