{"id":25204801,"url":"https://github.com/lmriccardo/needham-schroeder-verification","last_synced_at":"2025-08-23T05:34:29.206Z","repository":{"id":111790321,"uuid":"505537553","full_name":"lmriccardo/needham-schroeder-verification","owner":"lmriccardo","description":"Project for the Formal Methods In Software Development course at the University of \"La Sapienza\" in Master in Computer Science A.A. 2021/2022","archived":false,"fork":false,"pushed_at":"2022-06-20T18:18:45.000Z","size":292,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T05:07:12.976Z","etag":null,"topics":["cryptography","murphi","needham-schroeder","nusmv-model-checker","spin","verification"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmriccardo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-20T17:32:36.000Z","updated_at":"2023-10-15T00:41:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"4dc04f99-afcf-4b57-bb03-3f4de1a7d522","html_url":"https://github.com/lmriccardo/needham-schroeder-verification","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lmriccardo/needham-schroeder-verification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fneedham-schroeder-verification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fneedham-schroeder-verification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fneedham-schroeder-verification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fneedham-schroeder-verification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmriccardo","download_url":"https://codeload.github.com/lmriccardo/needham-schroeder-verification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fneedham-schroeder-verification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745595,"owners_count":24813509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","murphi","needham-schroeder","nusmv-model-checker","spin","verification"],"created_at":"2025-02-10T09:17:36.051Z","updated_at":"2025-08-23T05:34:29.193Z","avatar_url":"https://github.com/lmriccardo.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Needham-Scrhoeder Protocol Verification\n\nThis is the repository for the project of Formal Methods In Software Development course at La Sapienza. This project is based on the paper [Using SPIN to Verify Security Properties of Cryptographic Protocols](http://spinroot.com/spin/Workshops/ws02/maggi.pdf). \n\n## Introduction\n\nThe **Needham-Schroeder Protocol** is a well known authentication protocol that aims to provide a mutual secure authentication in order to provide a secure communication channel between two main roles: *initiator* A and a *responder* B. Once authenticated, A and B, can start exchanging messages. The Needham-Schroeder protocol is based on the PKE (Public Key Cryptography) where each agent H has: a public key PK (knows by anyone) and a secrect key SK (knows only by the owner). This is the general Needham-Schroeder Authentication Protocol\n\n\u003cimg src=\"https://i.imgur.com/bCocgkt.png\" alt=\"Complete Needham-Schroeder Protocol\" align=\"center\"\u003e\n\nIf we assume that A and B already knows each others public keys, we can remove four of the seven steps, i.e., those involving the trusted entity, obtaining the following reduced model\n\n\u003cimg src=\"https://i.imgur.com/JfZo95i.png\" alt=\"Reduced Needham-Schroeder Protocol\" align=\"center\"\u003e\n\n---\n\n## Verification\n\nThe model has been verified with [SPIN](https://spinroot.com/spin/whatispin.html), [Murphi](http://formalverification.cs.utah.edu/Murphi/) and [NuSMV](https://nusmv.fbk.eu/), three well known model-checkers. \n\n\u003eSay that X takes part in a protocol run with Y if X has initiated a protocol session with Y. Say that X commits to a session with Y if X has correctly concluded a protocol session with Y. \n\nFollowing the above definition, we can state that: the *authentication* of B to A means that A commits to a session with B and B has indeed taken part in a protocol run with A, and viceversa. These are the two properties that we want to verify. In LTL we have\n\n```\n[] (([] !(IniCommitAB)) || (!(IniCommitAB) U (ResRunningAB))) --- P1\n[] (([] !(ResCommitAB)) || (!(ResCommitAB) U (IniRunningAB))) --- P2\n```\n\nFinally, I added one more property to be verified: the **deadlock** property. In this model we have a deadlock only if we cannot never reach the authentication, i.e., if the protocol is stuck and no authentication has been reached. This is the corresponding LTL spec\n\n```\n[] \u003c\u003e (  IniCommitAB \u0026 IniRunningAB\n       \u0026 ResCommitAB \u0026 ResRunningAB) --- P3\n```\n\nThese are the results of the verification step\n\n\u003cimg src=\"https://i.imgur.com/z1GT5r4.png\" alt=\"Verification Results\" align=\"center\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmriccardo%2Fneedham-schroeder-verification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmriccardo%2Fneedham-schroeder-verification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmriccardo%2Fneedham-schroeder-verification/lists"}