首页
社区
课程
招聘
[分享+讨论]对 XOR_password 及XOR_cryptanalyiss 等相关论文研讨。(No. 2)
2009-9-26 16:12 7984

[分享+讨论]对 XOR_password 及XOR_cryptanalyiss 等相关论文研讨。(No. 2)

2009-9-26 16:12
7984
这篇论文即将发表在台湾唯一一个 information security 的期刊,信息安全通讯15卷第4期,出刊时间约为2009年10月10日前后。
以下是论文的内容。


以下的内容是实验的结果,根据论文的算法,实际以 Language C 设计出来,最后提出我们的攻击法,来证明这个算法是存在漏洞。


由以上内容知道,本方法确实比 【分享】An improved signature scheme without using one-way Hash functions 6 楼那篇论文 Cryptanalysis of a signature scheme without using one-way Hash functions.pdf 的方法还更有效率。

这是 source code,主要是验证我们的推论,各位可以参考上面的说明;当初没有优化,简单易懂,请见谅。
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <math.h>

long GetPowAndMod(long g, long x, long p);

int main()
{
    long g, x, p, y, m, k, s, r, t, gsk, j, M;
    printf("Input g, x, p (Separated By Space) : ");
    scanf("%ld%ld%ld", &g, &x, &p);
    fflush(stdin);
    y = GetPowAndMod(g, x, p) % p;
    printf("y : %ld\r\n", y);

	printf("Input m : ");
	scanf("%ld", &m);
	m = m % (p - 1);
	s = GetPowAndMod((y + m), m, p) % p;
	printf("s : %ld\r\n", s);

	printf("Input k : ");
	scanf("%ld", &k);
	gsk = GetPowAndMod(g, k, p) % p;
	for (j = 1 ; ; j++)
		if ((j * gsk % p) == 1)
			break;
	r = (m * s * j) % p;
	printf("r : %ld\r\n", r);

	for (j = 1 ; ; j++)
		if ((j * x % (p - 1)) == 1)
			break;
	t = ((((j * (k - (r ^ s))) % (p - 1))) - s) % p;
	
	if (t < 0)
	{
		t += (p - 1);
		printf("t : %ld\r\n", t % p);
	}
	else
	{
		printf("t : %ld\r\n", t % p);
	}
		
	for (j = 1 ; ; j++)
		if ((j * s % p) == 1)
			break;
	M = (((((GetPowAndMod(y, s + t, p) * r) % p) * GetPowAndMod(g, r ^ s, p)) % p) * j) % p;
	printf("M : %ld\r\n", M);

	t = 2 * s + t;
	r = -r;
	s = -s;
	for (j = 1 ; ; j++)
		if ((j * -s % p) == 1)
			break;
	M = (((((GetPowAndMod(y, s + t, p) * -r) % p) * GetPowAndMod(g, r ^ s, p)) % p) * j) % p;
	printf("M' : %ld\r\n", M);

	printf("Input r', s', t' (Separated By Space) : ");
	scanf("%ld%ld%ld", &r, &s, &t);
	for (j = 1 ; ; j++)
		if ((j * -s % p) == 1)
			break;
	M = (((((GetPowAndMod(y, s + t, p) * -r) % p) * GetPowAndMod(g, r ^ s, p)) % p) * j) % p;
	printf("M'' : %ld\r\n", M);

	system("pause");
    return 0;
}

long GetPowAndMod(long g, long x, long p)
{
	long Temp = g;

	if (x > 2)
		return (GetPowAndMod(g, x - 2, p) % p) * (g * g % p);
	else
	{
		for (long j = 1 ; j < x ; j++)
			Temp *= g;
		return Temp;
	}
}

[培训]内核驱动高级班,冲击BAT一流互联网大厂工 作,每周日13:00-18:00直播授课

上传的附件:
收藏
点赞7
打赏
分享
最新回复 (9)
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
jordanpz 2009-9-26 17:11
2
0
图片有些地方看不清楚,可否上传pdf?
雪    币: 2096
活跃值: (100)
能力值: (RANK:420 )
在线值:
发帖
回帖
粉丝
rockinuk 8 2009-9-26 19:14
4
0
已夾於附件中,請參考。
上传的附件:
雪    币: 84
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
liudanking 2009-9-26 19:31
5
0
谢谢了。又时间研究一下。
雪    币: 431
活跃值: (1875)
能力值: ( LV17,RANK:1820 )
在线值:
发帖
回帖
粉丝
riusksk 41 2009-9-26 21:55
6
0
Support
雪    币: 21
活跃值: (26)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
一鸿 2009-9-27 10:01
7
0
学习一下,xor,至今还不知什么?
误解了,签名算法,我感兴趣的算法。努力学习一下。
雪    币: 2096
活跃值: (100)
能力值: (RANK:420 )
在线值:
发帖
回帖
粉丝
rockinuk 8 2009-9-27 16:29
8
0
有空請瞭解 Jackozoo  版主在 language C 裏用了 inline assembly 的方法。
xor 是一個 logical gate 或是一個 boolean fucntion.
雪    币: 274
活跃值: (11)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
wangfir 2009-10-15 20:25
9
0
以前学的时候,xor表示是“异或”的意思,和论文中所述的作用相同。
雪    币: 806
活跃值: (10)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
zyr零零发 1 2010-2-4 13:00
10
0
感谢分享资料
雪    币: 328
活跃值: (34)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
madsys 2010-2-4 14:01
11
0
这就是上次那个有点小问题的代码吧?嘿嘿,学习了~
游客
登录 | 注册 方可回帖
返回