Explanation of signatures as “private key encryption” is incorrect . Well, basically. This is a traditional explanation of how RSA signatures work, but actually it doesn’t match how RSA signatures really work, because there is such a thing as “padding” that converts data elements to large integers and vice versa. Gasket details are of paramount importance for security - and you will not use the same add-ons for encryption and for signatures.
In addition, representing signatures as "private key encryption" can only work on asymmetric algorithms that use "hatch swap", and many signature algorithms do not matter (for example, DSA ). Therefore, I propose to forget this explanation, it is, at best, confusing.
A signature algorithm is generated on this message using the private key. It is checked on the message and public key; if the public key is the one corresponding to the secret key used to generate the signature, the verification algorithm will say “ok” only if it is the same message (or, more precisely, it is assumed that it is computationally impossible to find a separate message that, nevertheless, less will verify the verification algorithm). Thus, signatures are a kind of “asymmetric” algorithm, because they use a key pair, one of which is publicly available and the other is private.
There are several types of key pairs (in practice, RSA key pairs) that can be used for both signatures and encryption (with the corresponding RSA signature algorithm and RSA encryption algorithm) that are not the same algorithm, although they have one and the same mathematical kernel operation). You can technically use the same key pair for both; however, this is not recommended:
There may be implied flaws due to the interaction between the algorithms. Little research has been done on this. Although differences in filling should prevent them, there is no evidence.
Encryption keys and signature keys have different life cycles. See this answer for more details (in short: you want to back up the private encryption key, not the private signing key, so they cannot be the same key).
If any serious weakness is found in RSA, you will want to replace the keys with keys for other algorithms, and there is no guarantee that the encryption and signature algorithms will still be able to use the same key type.
source share