Formal Correctness of Security Protocols