konstantinullrich / crypton

A simple Dart library for asymmetric encryption and digital signatures
https://pub.dev/packages/crypton
MIT License
33 stars 12 forks source link

Signing and Verifying Algorithm #21

Closed rupamking1 closed 3 years ago

rupamking1 commented 3 years ago

For Signing and Verifying what hash Algorithm you are using? How to verify signature using nodejs ?

konstantinullrich commented 3 years ago

Depends on the type of keypair you are using.

If you are using EC than we use SHA-256/DET-ECDSA or SHA-512/DET-ECDSA If you are more of the RSA type of Guy we are using SHA-256/RSA or SHA-512/RSA

As I'm not a NodeJs Developer I can't help you with that. Try finding a lib that is compatible with PointyCastle / BouncyCastle. If you find one it would be cool if you could provide a link in the comments of this Issue so I can extend the Documentation.

rupamking1 commented 3 years ago

I think Signing and Verifying Algorithm is DSA Algorithm I have last question about DSA- Q. Can I use public key to encrypt TextHash ? Is that necessary to encrypt TextHash with Private Key?

IMG_20201027_160721

konstantinullrich commented 3 years ago

Well, there is a difference between Signatures and Encrypted messages.

In order to sign a message/hash, you can only use the private key. It wouldn't make sense otherwise. But If you want to encrypt a message using asymmetric encryption you can only use the public key for that.

A signature is used to check if the message you received is the message sent by the sender.

The procedure which is shown in the picture you attached is signing and not encrypting. You usually attach the signature to the original message (Named Data in your picture).

rupamking1 commented 3 years ago

ok I understand your words, but I want to make it with node JS for that reason, I ask this question. please tell me- "if I use public key for signature message, is that secure deliver message signature or not".

konstantinullrich commented 3 years ago

No, it is not. because like the name suggests the Public Key is designed to be shared with everyone.