Hello Narad
OSPFv2 does use MD5 for encryption of the authentication process. You can find out more here:
In addition, OSPFv2 based on RFC 2328 allows only MD5, but RFC 5709 has added the use of HMAC-SHA algorithms for cryptographic authentication.
As for OPSFv3, it supports authentication with IPsec. You can find out more about that here:
I hope this has been helpful!
Laz