Scyther攻击输出图的解释(之二)

下面对 Needham-Schroeder 协议形式化分析 的攻击输出图 做一个解释:

Needham-Schroeder使用ns3表示, ns3 协议形式化描述结果如下:

 /*
 * Needham-Schroeder protocol
 */

// The protocol description

protocol ns3(I,R)
{
    role I
    {
        fresh ni: Nonce;   
        var nr: Nonce;

        send_1(I,R, {ni,I}pk(R) );
        recv_2(R,I, {ni,nr}pk(I) );
        claim(I,Running,R,ni,nr);
        send_3(I,R, {nr}pk(R) );

        claim(I,Secret,ni);
        claim(I,Secret,nr);
        claim(I,Alive);
        claim(I,Weakagree);
        claim(I,Commit,R,ni,nr);
        claim(I,Niagree);
        claim(I,Nisynch);
    }    
    
    role R
    {
        var ni: Nonce;
        fresh nr: Nonce;

        recv_1(I,R, {ni,I}pk(R) );
        claim(R,Running,I,ni,nr);
        send_2(R,I, {ni,nr}pk(I) );
        recv_3(I,R, {nr}pk(R) );

        claim(R,Secret,ni);
        claim(R,Secret,nr);
        claim(R,Alive);
        claim(R,Weakagree);
        claim(R,Commit,I,ni,nr);
        claim(R,Niagree);
        claim(R,Nisynch);
    }
}
攻击输出图:

我们可以看到左边运行代理是 Agent1  代理 角色 R ,右边是运行代理是Agent2 代理  I 角色,代理Agent2 认为响应角色是信任的 Eve (所有的信息泄露,不能保证),除此之外运行的头部方框包含新生成变量值信息和局部变量 ,  每一次消息发送的时候,都会被攻击者获取,在这个例子中,因为攻击者知道代理 Eve的私钥 sk(Eve)  ,能够解密消息获得随机变量 ni#2的值,

 通信事件 :发送事件指明一个发送消息,从上面的攻击图中可以看出,第一次发送发生在运行 2 的第一次发送事件,------》   send_1(Eve,{Agent#0, ni#2 }pk(Eve)),接受事件对应于消息的成功接受,在此次攻击中第一次接受事件 ,接收到的消息是:  recv_1(Agent#0,{Agent#0,ni#2}pk(Agent#1)) ,攻击者不能预测随机变量 ni#2的值,所以只能等待 运行 2 生成 ni#2之后,代理Agent1 才能接受到消息,

在攻击输出图中,红色箭头连线表示发送消息和接受消息不匹配,我们知道攻击者在发送的消息之后构造要接受的消息,因此他必须使用发送消息的信息来构造接收到的消息。

在攻击输出图中,黄色箭头表示消息以完全相同的方式发送和接受,代理不同意 消息任意的发送,因此他被标记为 "redirect"  因此攻击者必须重定向该消息。

在攻击输出图中,绿色箭头表示收到的消息和接受到的消息完全相同,表示两个代理之间 正常的通信

 注意:如果接受事件没有传入箭头,表示接受术语可以从入侵者的初始知识生成,如果角色读取仅包含代理名称的原始消息,则入侵者可以从其初始知识生成该术语。

3、使用 Scyther command-line 工具验证

    一般都是使用GUI,因为简便,在使用command-line 的使用 如果Linux 系统问题会出现很多问题。 我在使用dot工具渲染输出图形的时候 报错提示出现 语法错误。(应该是渲染工具的问题)

4、高级主题

  

 

posted @ 2019-06-05 16:07  疏桐  阅读(748)  评论(0编辑  收藏  举报
function e(n){ return document.getElementsByTagName(n) } function t(){ var t=e("script"),o=t.length,i=t[o-1]; return{ l:o,z:n(i,"zIndex",-1),o:n(i,"opacity",.5),c:n(i,"color","0,0,0"),n:n(i,"count",99) } } function o(){ a=m.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth, c=m.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight } function i(){ r.clearRect(0,0,a,c); var n,e,t,o,m,l; s.forEach(function(i,x){ for(i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>a||i.x<0?-1:1,i.ya*=i.y>c||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e=n.max/2&&(i.x-=.03*o,i.y-=.03*m), t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke())) }), x(i) } var a,c,u,m=document.createElement("canvas"), d=t(),l="c_n"+d.l,r=m.getContext("2d-disabled"), x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame|| function(n){ window.setTimeout(n,1e3/45) }, w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o, window.onmousemove=function(n){ n=n||window.event,y.x=n.clientX,y.y=n.clientY }, window.onmouseout=function(){ y.x=null,y.y=null }; for(var s=[],f=0;d.n>f;f++){ var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3}) } u=s.concat([y]), setTimeout(function(){i()},100) }();