import{_ as e}from"./plugin-vue_export-helper-DlAUqK2U.js";import{c as a,b as Q,e as t,a as m,o as l}from"./app-DlommLbD.js";const n={},o={class:"MathJax",jax:"SVG",style:{position:"relative"}},s={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"},i={class:"MathJax",jax:"SVG",style:{position:"relative"}},H={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"},p={class:"MathJax",jax:"SVG",style:{position:"relative"}},L={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 c(f,T){return l(),a("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]=t("Alice负责洗牌,她首先生成一个长度为52的数组,数组的每个元素表示一张牌,然后用她的加密算法",-1)),Q("mjx-container",o,[(l(),a("svg",s,[...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]=t("对这些元素进行加密,再把数组顺序打乱(洗牌)之后",-1)),Q("mjx-container",r,[(l(),a("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]=t("发送给下Bob",-1))]),Q("li",null,[T[9]||(T[9]=t("Bob收到这些牌之后并不认识,因为上面都有Alice的锁,所以他只能随机挑出5张牌,用自己的加密算法之后生成",-1)),Q("mjx-container",i,[(l(),a("svg",H,[...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]=t("送给Alice",-1))]),Q("li",null,[T[13]||(T[13]=t("Alice收到这5张牌之后用自己的解密函数解密,生成",-1)),Q("mjx-container",g,[(l(),a("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]=t("送还给Bob",-1))]),Q("li",null,[T[17]||(T[17]=t("Bob收到后进行解密,得到",-1)),Q("mjx-container",p,[(l(),a("svg",L,[...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]=t("作为自己的牌",-1))]),Q("li",null,[T[21]||(T[21]=t("最后Bob从剩下的47张牌中随机挑出5张送给Alice,Alice直接解密得到",-1)),Q("mjx-container",u,[(l(),a("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]=t("作为她的牌",-1))]),T[23]||(T[23]=Q("li",null,"发牌结束后双方交换密钥以验证此过程没有作弊",-1))])])}const x=e(n,[["render",c]]),y=JSON.parse('{"path":"/note/cryptography/mental_poker.html","title":"智能扑克协议","lang":"zh-CN","frontmatter":{"description":"智能扑克协议 1. SRA协议 假设Alice和Bob要玩一局扑克牌游戏,开局的时候他们都要一副牌(52张)中各抽取5张,那么过程就是这样: Alice负责洗牌,她首先生成一个长度为52的数组,数组的每个元素表示一张牌,然后用她的加密算法对这些元素进行加密,再把数组顺序打乱(洗牌)之后发送给下Bob Bob收到这些牌之后并不认识,因为上面都有Alice...","head":[["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"智能扑克协议\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2025-02-22T14:42:02.000Z\\",\\"author\\":[{\\"@type\\":\\"Person\\",\\"name\\":\\"JinChao\\",\\"url\\":\\"https://thecodeway.com\\"}]}"],["meta",{"property":"og:url","content":"https://thejinchao.github.io/note/cryptography/mental_poker.html"}],["meta",{"property":"og:site_name","content":"我的博客和笔记"}],["meta",{"property":"og:title","content":"智能扑克协议"}],["meta",{"property":"og:description","content":"智能扑克协议 1. SRA协议 假设Alice和Bob要玩一局扑克牌游戏,开局的时候他们都要一副牌(52张)中各抽取5张,那么过程就是这样: Alice负责洗牌,她首先生成一个长度为52的数组,数组的每个元素表示一张牌,然后用她的加密算法对这些元素进行加密,再把数组顺序打乱(洗牌)之后发送给下Bob Bob收到这些牌之后并不认识,因为上面都有Alice..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2025-02-22T14:42:02.000Z"}],["meta",{"property":"article:modified_time","content":"2025-02-22T14:42:02.000Z"}]]},"git":{"createdTime":1740235322000,"updatedTime":1740235322000,"contributors":[{"name":"thejinchao","username":"thejinchao","email":"thejinchao@gmail.com","commits":1,"url":"https://github.com/thejinchao"}]},"readingTime":{"minutes":0.95,"words":286},"filePathRelative":"note/cryptography/mental_poker.md","autoDesc":true}');export{x as comp,y as data};