I don't have such a file on my Windows 7 system, so it's unlikely it belongs to Windows.
That means that the best way to restore it - if you don't have it on a backup - is to reinstall the program that it came with. Now it's up to you to check the list of startup programs (in msconfig>startup tab) or in sysinterals's autorun program to determine what program that is.
My guess, however: this file came with some malware and has been deleted by your antivirus. Then be glad it's gone. All you have to do then is remove the program that calls it from the list of programs that run at boot. The same tools as I mentioned above can be used for that.
A final question: what goes wrong now that unknown (to us) program can't run? If nothing goes wrong, it seems you don't need that file. Why restore it then?
When I turn on my PC, I get an error message reading: "Program can't start because cryptoapi.dll is missing.
What is the best and safest way to restore this dll file?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic