import{_ as e,c as t,b as Q,d as a,a as m,o as l}from"./app-CqutohVF.js";const n={},s={class:"MathJax",jax:"SVG",style:{position:"relative"}},o={style:{"vertical-align":"-0.345ex"},xmlns:"http://www.w3.org/2000/svg",width:"3.057ex",height:"1.884ex",role:"img",focusable:"false",viewBox:"0 -680 1351.3 832.7","aria-hidden":"true"},r={class:"MathJax",jax:"SVG",style:{position:"relative"}},d={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"7.195ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3180.3 1000","aria-hidden":"true"},H={class:"MathJax",jax:"SVG",style:{position:"relative"}},i={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"12.907ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 5705 1000","aria-hidden":"true"},g={class:"MathJax",jax:"SVG",style:{position:"relative"}},h={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"28.155ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 12444.6 1000","aria-hidden":"true"},L={class:"MathJax",jax:"SVG",style:{position:"relative"}},p={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"17.64ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 7796.9 1000","aria-hidden":"true"},u={class:"MathJax",jax:"SVG",style:{position:"relative"}},M={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"17.611ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 7784.2 1000","aria-hidden":"true"};function f(c,T){return l(),t("div",null,[T[24]||(T[24]=Q("h1",{id:"智能扑克协议",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#智能扑克协议"},[Q("span",null,"智能扑克协议")])],-1)),T[25]||(T[25]=Q("hr",null,null,-1)),T[26]||(T[26]=Q("h2",{id:"_1-sra协议",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#_1-sra协议"},[Q("span",null,"1. SRA协议")])],-1)),T[27]||(T[27]=Q("p",null,"假设Alice和Bob要玩一局扑克牌游戏,开局的时候他们都要一副牌(52张)中各抽取5张,那么过程就是这样:",-1)),Q("ol",null,[Q("li",null,[T[4]||(T[4]=a("Alice负责洗牌,她首先生成一个长度为52的数组,数组的每个元素表示一张牌,然后用她的加密算法")),Q("mjx-container",s,[(l(),t("svg",o,T[0]||(T[0]=[m('',1)]))),T[1]||(T[1]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"A")])])],-1))]),T[5]||(T[5]=a("对这些元素进行加密,再把数组顺序打乱(洗牌)之后")),Q("mjx-container",r,[(l(),t("svg",d,T[2]||(T[2]=[m('',1)]))),T[3]||(T[3]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"A")]),Q("mo",{stretchy:"false"},"("),Q("mi",null,"M"),Q("mo",{stretchy:"false"},")")])],-1))]),T[6]||(T[6]=a("发送给下Bob"))]),Q("li",null,[T[9]||(T[9]=a("Bob收到这些牌之后并不认识,因为上面都有Alice的锁,所以他只能随机挑出5张牌,用自己的加密算法之后生成")),Q("mjx-container",H,[(l(),t("svg",i,T[7]||(T[7]=[m('',1)]))),T[8]||(T[8]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"B")]),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"A")]),Q("mo",{stretchy:"false"},"("),Q("mi",null,"M"),Q("mo",{stretchy:"false"},")"),Q("mo",{stretchy:"false"},")"),Q("mo",{stretchy:"false"},")")])],-1))]),T[10]||(T[10]=a("送给Alice"))]),Q("li",null,[T[13]||(T[13]=a("Alice收到这5张牌之后用自己的解密函数解密,生成")),Q("mjx-container",g,[(l(),t("svg",h,T[11]||(T[11]=[m('',1)]))),T[12]||(T[12]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"D"),Q("mi",null,"A")]),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"B")]),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"A")]),Q("mo",{stretchy:"false"},"("),Q("mi",null,"M"),Q("mo",{stretchy:"false"},")"),Q("mo",{stretchy:"false"},")"),Q("mo",{stretchy:"false"},")"),Q("mo",{stretchy:"false"},")"),Q("mo",null,"="),Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"B")]),Q("mo",{stretchy:"false"},"("),Q("mi",null,"M"),Q("mo",{stretchy:"false"},")")])],-1))]),T[14]||(T[14]=a("送还给Bob"))]),Q("li",null,[T[17]||(T[17]=a("Bob收到后进行解密,得到")),Q("mjx-container",L,[(l(),t("svg",p,T[15]||(T[15]=[m('',1)]))),T[16]||(T[16]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"D"),Q("mi",null,"B")]),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"B")]),Q("mo",{stretchy:"false"},"("),Q("mi",null,"M"),Q("mo",{stretchy:"false"},")"),Q("mo",{stretchy:"false"},")"),Q("mo",null,"="),Q("mi",null,"M")])],-1))]),T[18]||(T[18]=a("作为自己的牌"))]),Q("li",null,[T[21]||(T[21]=a("最后Bob从剩下的47张牌中随机挑出5张送给Alice,Alice直接解密得到")),Q("mjx-container",u,[(l(),t("svg",M,T[19]||(T[19]=[m('',1)]))),T[20]||(T[20]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"D"),Q("mi",null,"A")]),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"E"),Q("mi",null,"A")]),Q("mo",{stretchy:"false"},"("),Q("mi",null,"M"),Q("mo",{stretchy:"false"},")"),Q("mo",{stretchy:"false"},")"),Q("mo",null,"="),Q("mi",null,"M")])],-1))]),T[22]||(T[22]=a("作为她的牌"))]),T[23]||(T[23]=Q("li",null,"发牌结束后双方交换密钥以验证此过程没有作弊",-1))])])}const w=e(n,[["render",f],["__file","mental_poker.html.vue"]]),x=JSON.parse('{"path":"/note/cryptography/mental_poker.html","title":"智能扑克协议","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"1. SRA协议","slug":"_1-sra协议","link":"#_1-sra协议","children":[]}],"git":{"contributors":[{"name":"thejinchao","username":"thejinchao","email":"thejinchao@gmail.com","commits":1,"url":"https://github.com/thejinchao"}]},"filePathRelative":"note/cryptography/mental_poker.md"}');export{w as comp,x as data};