I'm trying to get my server to establish trust with a client. Neither is on the Internet, so there are no certificate authorities. The typical way to establish trust in my domain is for a client to "request a seed", the server provides a seed, and the client "provides a key", and the server "verifies the key". (In case you are curious: ISO 14229-1, Unified Diagnostic Services) There is no required way to generate either the seed or the key, or to verify it.
Assuming I can properly generate an RSA asymmetric key pair and distribute it, the server holds the public key (n, e)
and the client holds the private key K
. Assume good cryptographic hashes, strong random number generators, appropriate retry timeouts to prevent replay attacks, etc.
Is the private key vulnerable in the following scheme?
- Server provides the seed: A random number
M
. - Client signs said seed (
S = RSASSA-PKCS1-V1_5-SIGN(K,M)
) and sends the signature to the server. - The server verifies that signature (
RSASSA-PKCS1-V1_5-VERIFY ((n, e), M, S)
). - If the signature could be verified with the public key, then the client can be trusted.
I'm worried about a known-plaintext attack: I see the private key getting mixed into the signature, unlike with encryption where only the public key is mixed into the output.