# Calculating random number in ECDSA based on private key and signature

In ECDSA (Elliptic Curve Digital Signature Algorithm) we use a random number k in the signature process.

Signature in ECDSA is:

$$(x_1,y_1) = k * G$$ $$r = x_1 \mod n$$ $$s = k^{-1} (z+rd_{a}) \mod n$$

If we know the private key $d_a$ and signature (r,s) would it be possible to calculate random k? If no how hard would it be to calculate that?

This is immediate: $$k = s^{-1} (z + r \, d_a) \bmod n$$ where $z$ is the hash value of the message being signed.