formal security analysis of cryptographic protocol code
play

Formal Security Analysis of Cryptographic Protocol Code - PowerPoint PPT Presentation

Formal Security Analysis of Cryptographic Protocol Code Karthikeyan Bhargavan INRIA Karthikeyan.Bhargavan@inria.fr IIT Delhi, Fall 2010 Lecture 7: Using


  1. Formal ¡Security ¡Analysis ¡of ¡ Cryptographic ¡Protocol ¡Code ¡ ¡ Karthikeyan ¡Bhargavan ¡ INRIA ¡ Karthikeyan.Bhargavan@inria.fr ¡ IIT ¡Delhi, ¡Fall ¡2010 ¡

  2. Lecture ¡7: ¡ Using ¡ProVerif: ¡ ¡ Encodings ¡and ¡Embeddings ¡ IntroducCon ¡

  3. Values: ¡Channels, ¡Messages, ¡PaFerns ¡ 3 ¡

  4. Processes ¡

  5. DeclaraCons ¡and ¡Scripts ¡

  6. ReducCon ¡SemanCcs ¡

  7. Query ¡SaCsfacCon ¡ • Recall ¡the ¡definiCon ¡of ¡queries ¡in ¡F ¡ • We ¡say ¡a ¡process ¡P ¡saCsfies ¡a ¡query ¡q: ¡P ¡|= ¡q ¡

  8. Opponents, ¡Robust ¡Safety ¡ A ¡ ∆s-­‑opponent ¡ is ¡a ¡process ¡O ¡with ¡no ¡events, ¡s.t. ¡ ¡ • the ¡script ¡∆s ¡ process ¡O ¡is ¡well ¡formed ¡and ¡ ¡ • O ¡contains ¡no ¡constructor ¡or ¡destructor ¡ declared ¡private ¡in ¡∆s. ¡ A ¡script ¡∆s ¡ process ¡P ¡is ¡ robustly ¡safe ¡ for ¡q ¡ ¡ if ¡and ¡only ¡if ¡for ¡all ¡∆s-­‑opponents ¡O, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡P ¡| ¡O ¡is ¡safe ¡for ¡q. ¡

  9. Correctness ¡of ¡ProVerif ¡ ¡ [Abadi,Blanchet ¡JACM’05] ¡ ¡ ¡ ¡ Theorem: ¡ Given ¡a ¡script ¡S ¡= ¡∆s ¡ process ¡P ¡ ¡ containing ¡a ¡query ¡q ¡ – If ¡ProVerif ¡returns ¡true, ¡then ¡S ¡is ¡robustly ¡safe ¡for ¡q ¡ – If ¡ProVerif ¡returns ¡false, ¡then ¡S ¡is ¡not ¡robustly ¡safe ¡for ¡q ¡ – If ¡ProVerif ¡returns ¡“cannot ¡be ¡proved”, ¡ ¡ or ¡if ¡ProVerif ¡does ¡not ¡terminate, ¡we ¡don’t ¡know ¡ • Usually, ¡“Cannot ¡be ¡proved” ¡means ¡“Not ¡robustly ¡safe” ¡

  10. Using ¡ProVerif ¡on ¡F# ¡Programs ¡ To ¡verify ¡realisCc ¡programs, ¡we ¡need ¡to ¡ ¡ understand ¡various ¡modeling ¡idioms: ¡ • How ¡do ¡we ¡encode ¡database ¡servers? ¡ • How ¡do ¡we ¡model ¡key ¡leakage? ¡ • How ¡do ¡we ¡specify ¡message ¡secrecy? ¡ • How ¡do ¡we ¡translate ¡F# ¡to ¡ProVerif? ¡ – funcCons ¡to ¡processes, ¡programs ¡to ¡scripts ¡

  11. Lecture ¡7: ¡ Using ¡ProVerif: ¡ ¡ Encodings ¡and ¡Embeddings ¡ Databases ¡and ¡Key ¡Servers ¡

  12. A ¡Simple ¡Private ¡Database ¡ • Let ¡us ¡treat ¡a ¡database ¡like ¡a ¡hash ¡table ¡that ¡ maps ¡indices ¡to ¡values ¡ – Insert ¡adds ¡a ¡mapping ¡from ¡an ¡index ¡to ¡a ¡value ¡ – Select ¡retrieves ¡a ¡value ¡at ¡an ¡index ¡ – There ¡is ¡no ¡operaCon ¡to ¡remove ¡a ¡value ¡ • By ¡default, ¡a ¡database ¡can ¡only ¡be ¡used ¡by ¡ someone ¡who ¡is ¡explicitly ¡given ¡access ¡to ¡it ¡ ¡ – Indices ¡are ¡typically ¡not ¡secret, ¡but ¡values ¡may ¡be ¡

  13. A ¡Database ¡Server ¡in ¡ProVerif ¡ • The ¡private ¡database ¡is ¡modeled ¡as ¡a ¡channel ¡ ¡ ¡ ¡ ¡ ¡private ¡free ¡ db. ¡ • The ¡contents ¡of ¡the ¡database ¡are ¡messages ¡sent ¡ ¡ (but ¡not ¡yet ¡received) ¡on ¡this ¡channel ¡db ¡ • To ¡insert ¡a ¡value ¡v ¡with ¡index ¡i, ¡send ¡(i,v) ¡on ¡db ¡ ¡ ¡ ¡ ¡ ¡ out (db,(i,v)); ¡… ¡ • To ¡select ¡at ¡index ¡i, ¡receive ¡and ¡paFern-­‑match: ¡ ¡ ¡ ¡ ¡ ¡ in (db,(=i,v’)); ¡ ¡ ¡ ¡ ¡(* ¡Remove ¡from ¡database ¡at ¡i ¡*) ¡ ¡ ¡ ¡ ¡ ¡ out (db,(i,v’)); ¡ ¡ ¡ ¡ ¡(* ¡Restore ¡value ¡to ¡database ¡*) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡

  14. Recall ¡ProVerif ¡Example ¡ • We ¡code ¡a ¡simple ¡client, ¡server ¡example: ¡ ¡A ¡logs ¡Send(x) ¡ ¡A ¡  ¡B: ¡msg(enc(x,kab)) ¡ ¡B ¡logs ¡Accept(x) ¡ – All ¡messages ¡are ¡sent ¡on ¡a ¡public ¡channel ¡net ¡ – Messages ¡are ¡tagged ¡with ¡a ¡tag ¡msg ¡ – A ¡and ¡B ¡are ¡triggered ¡by ¡a ¡message ¡on ¡channel ¡app ¡ – A ¡and ¡B ¡share ¡the ¡key ¡kab ¡ – Security ¡Goal: ¡Accept(x) ¡=> ¡Send(x) ¡

  15. Recall ¡ProVerif ¡Script ¡ • msg: ¡constructor ¡tag ¡ • enc-­‑dec: ¡constructor-­‑destructor ¡pair ¡ • kab: ¡fresh ¡name ¡(key) ¡generated ¡for ¡this ¡script ¡ • client, ¡server: ¡replicated ¡processes ¡(share ¡kab ¡

  16. Generalizing ¡to ¡MulCple ¡Principals ¡ • A ¡and ¡B ¡are ¡not ¡hard-­‑coded ¡(A ¡chooses ¡B): ¡ ¡A ¡logs ¡Send(A,B,x) ¡ ¡A ¡  ¡B: ¡msg(A,B,enc(x,kab)) ¡ ¡B ¡logs ¡Accept(A,B,x) ¡ – Each ¡pair ¡of ¡principals ¡(p1,p2) ¡shares ¡a ¡key ¡ – Security ¡Goal: ¡Accept(p1,p2,x) ¡=> ¡Send(p1,p2,x) ¡

  17. Example: ¡A ¡Key ¡Database ¡ • We ¡encode ¡a ¡database ¡that ¡stores ¡symmetric ¡ keys, ¡indexed ¡by ¡names ¡of ¡principals ¡(a,b) ¡ ¡ ¡ ¡ ¡private ¡free ¡ keydb ¡ • We ¡represent ¡principals ¡by ¡0-­‑ary ¡constructors ¡ ¡ ¡ ¡ ¡ data ¡ A/0. ¡ data ¡ B/0. ¡ data ¡C/0. ¡ • For ¡each ¡principal ¡pair, ¡we ¡generate ¡keys ¡ new ¡kAB; ¡ out (keydb,((A,B),kAB); ¡ new ¡ kAC; ¡ out (keydb,((A,C),kAC); ¡… ¡

  18. Example ¡ProVerif ¡Script ¡

  19. Unbounded ¡Number ¡of ¡Principals ¡ • How ¡can ¡we ¡generalize ¡further? ¡ • The ¡current ¡model ¡has ¡a ¡fixed ¡A, ¡B, ¡C. ¡ • How ¡about ¡unlimited ¡number ¡of ¡principals? ¡ – Let ¡the ¡aFacker ¡choose ¡an ¡arbitrary ¡p1, ¡p2 ¡ – We ¡will ¡need ¡a ¡key ¡in ¡keydb ¡for ¡(p1,p2) ¡ – Shall ¡we ¡give ¡the ¡aFacker ¡db? ¡ – How ¡can ¡we ¡control ¡access ¡to ¡db, ¡but ¡sCll ¡allow ¡ the ¡aFacker ¡to ¡generate ¡a ¡key ¡for ¡any ¡(p1,p2)? ¡

  20. Keys ¡Controlled ¡by ¡the ¡AFacker ¡ • How ¡about ¡keys ¡between ¡A ¡and ¡the ¡aFacker? ¡ – Can ¡we ¡allow ¡the ¡aFacker ¡to ¡inject ¡keys ¡for ¡principals ¡ he ¡controls? ¡ – Would ¡the ¡query ¡sCll ¡be ¡true? ¡ ¡ ¡ ¡ ¡ query ¡ ev :Accept(p1,p2,x) ¡==> ¡ ev :Send(p1,p2,x) ¡ • We ¡use ¡a ¡new ¡event ¡BadKey ¡to ¡indicate ¡keys ¡that ¡ belong ¡to ¡the ¡adversary ¡ ¡ ¡ ¡ ¡ ¡query ¡ ev :Accept(p1,p2,x) ¡==> ¡ ev :Send(p1,p2,x) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ ev :BadKey(p1,p2,k) ¡

  21. Lecture ¡7: ¡ Using ¡ProVerif: ¡ ¡ Encodings ¡and ¡Embeddings ¡ Advanced ¡Security ¡Goals ¡

  22. AuthenCcaCon ¡and ¡Secrecy ¡ • We ¡use ¡crypto ¡for ¡secure ¡communicaCons ¡over ¡an ¡ insecure ¡network ¡ • We ¡are ¡concerned ¡with ¡two ¡kinds ¡of ¡threats ¡ – The ¡aFacker ¡should ¡not ¡be ¡able ¡to ¡inject ¡his ¡(tainted) ¡ messages ¡into ¡our ¡servers ¡ ¡ – The ¡aFacker ¡should ¡not ¡be ¡able ¡to ¡steal ¡our ¡secrets ¡ • For ¡authenCcaCon, ¡check ¡every ¡received ¡message ¡ • For ¡secrecy, ¡guard ¡every ¡sent ¡message ¡

  23. AuthenCcaCon ¡Queries ¡ ¡ • Message ¡integrity ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ query ¡ev: Accept(x) ¡==> ¡ ev: Send(x) ¡ – The ¡message ¡was ¡not ¡tampered ¡with ¡ • Sender ¡authenCcaCon ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ query ¡ev: Accept(a,x) ¡==> ¡ ev: Send(a,x) ¡ – Message ¡was ¡indeed ¡sent ¡by ¡this ¡sender ¡ • Intended ¡receiver ¡authenCcaCon ¡ ¡ ¡ ¡ ¡ query ¡ev: Accept(a,b,x) ¡==> ¡ ev: Send(a,b,x) ¡ – Message ¡was ¡intended ¡for ¡this ¡receiver ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend