首页
社区
课程
招聘
[转帖]NFS例子
发表于: 2011-4-13 12:21 5462

[转帖]NFS例子

2011-4-13 12:21
5462
只知其名,可原理就最少要代数数论才行----------颜松远的

[课程]FART 脱壳王!加量不加价!FART作者讲授!

上传的附件:
收藏
免费 0
支持
分享
最新回复 (6)
雪    币: 119
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
抢到沙发了!!!
2011-4-13 13:54
0
雪    币: 433
活跃值: (45)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
3
不知那集和a,b怎麽选的。。。。。。。。

书上的一道题:

14885=5*13*229=122^2+1

m=122

http://en.wikipedia.org/wiki/General_number_field_sieve
上传的附件:
2011-4-13 15:11
0
雪    币: 233
活跃值: (27)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
。。。。。。
NFS我还以为是Need For Speed(极品飞车)或者是 Net File System(网络文件系统)。。。
2011-4-13 16:09
0
雪    币: 433
活跃值: (45)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
5
颜找了两特殊数分解,也不讲讲那多项式构造。。。

14885
SetVerbose("NFS", 3);

找参数
R<X,Y> := PolynomialRing(Integers( ),2);
> n := 14885;
> F := X^2+Y^2;
> m1 := 122;
> m2 := 1;
> A := NFSProcess(n,F,m1,m2);
A`AlgebraicFBBound := 800;
A`RationalFBBound := 600;

A`OutputFilename := "/tmp/nfs-distrib-AA";
A`Maximuma := 2^25;
A`AlgebraicError := 10;
> A`RationalError := 10;
A;

FindRelations(A);

NFS Process [
  n: 14885
  F: X^2 + Y^2
  m1: 122
  m2: 1
  Data file base name: /tmp/nfs-distrib-AA
  Sieve ranges:
    -33554432 <= a <= 33554432
    0 <= b
  Algebraic factor base bounds:
    smooth primes <= 800, large primes <= 250000
  Rational factor base bounds:
    smooth primes <= 600, large primes <= 250000
  Log error terms:
    algebraic 10, rational 10
]
NFS polynomial has total degree 2
Using smoothness bounds: algebraic 800, rational 600
Using large prime bounds: algebraic 250000, rational 250000
Sieving interval contains 256 blocks of length 262144
NFS will quit sieving after 347 relations
Using error terms: algebraic 10, rational 10
Sieving block length is 262144
***************************************************
appending to file '/tmp/nfs-distrib-AA'
***************************************************
Output 54 free relations

在分布式中,A机中选因子基a=0---39,A机中选因子基a=39---99,生成两大文件nfs-distrib-A,
nfs-distrib-B,合并对比

> R<X,Y> := PolynomialRing(Integers( ),2);
> n := 14885;
> F := X^2+Y^2;
> m1 := 122;
> m2 := 1;
> A := NFSProcess(n,F,m1,m2);
> A`Firstb := 0;
> A`Lastb := 39;
> A`OutputFilename := "/tmp/nfs-distrib-A";
> FindRelations(A);
A`OutputFilename := "/tmp/nfs-distrib-all";
> Factor(A,9);  // factor dependency 9

B := NFSProcess(n,F,m1,m2);
> B`Firstb := 39;
> B`Lastb := 99;
> B`OutputFilename := "/tmp/nfs-distrib-B";
> FindRelations(B);

input_files := ["/tmp/nfs-distrib-A","/tmp/nfs-distrib-B"];
> P := NFSProcess(n,F,m1,m2);
> P`OutputFilename := "/tmp/nfs-distrib-all";
> MergeFiles(input_files, P`OutputFilename);
4162 25925
> CycleCount(P);
4368
> CreateCycleFile(P);
> CreateCharacterFile(P);
> FindDependencies(P);

看A

A`OutputFilename := "/tmp/nfs-distrib-all";
> Factor(A,5);  
看B
B`OutputFilename := "/tmp/nfs-distrib-all";

> Factor(P,1);
2011-4-13 19:08
0
雪    币: 433
活跃值: (45)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
6
SetVerbose("NFS", 3);

R<X,Y> := PolynomialRing(Integers( ),2);
> n := 70478782497479747987234958341;
> F := 814*X^4 + 3172*X^3*Y - 49218*X^2*Y^2 - 142775*X*Y^3
> - 65862*Y^4;
> m1 := 3050411;
> m2 := 1;
> A := NFSProcess(n,F,m1,m2);
> A`Firstb := 0;
> A`Lastb := 99;
> A`OutputFilename := "/tmp/nfs-distrib-A";
> FindRelations(A);

NFS polynomial has total degree 4
Using smoothness bounds: algebraic 14870, rational 14870
Using large prime bounds: algebraic 1487000, rational 1487000
Sieving interval contains 1 blocks of length 34816
NFS will quit sieving after 3581 relations
Using error terms: algebraic 13, rational 12
Sieving block length is 34816
Attempting to over-write file '/tmp/nfs-distrib-A'
Output 68 free relations
b=1, num_fulls=156
b=2, num_fulls=198
b=3, num_fulls=230
b=4, num_fulls=264
b=5, num_fulls=326
b=6, num_fulls=335
b=7, num_fulls=387
b=8, num_fulls=412
b=9, num_fulls=437
b=10, num_fulls=453
b=11, num_fulls=549
b=12, num_fulls=559
b=13, num_fulls=598
b=14, num_fulls=617
b=15, num_fulls=643
b=16, num_fulls=670
b=17, num_fulls=714
b=18, num_fulls=726
b=19, num_fulls=768
b=20, num_fulls=784
b=21, num_fulls=809
b=22, num_fulls=848
b=23, num_fulls=887
b=24, num_fulls=897
b=25, num_fulls=929
b=26, num_fulls=954
b=27, num_fulls=979
b=28, num_fulls=993
b=29, num_fulls=1036
b=30, num_fulls=1043
b=31, num_fulls=1084
b=32, num_fulls=1106
b=33, num_fulls=1138
b=34, num_fulls=1158
b=35, num_fulls=1185
b=36, num_fulls=1198
b=37, num_fulls=1292
b=38, num_fulls=1311
b=39, num_fulls=1328
b=40, num_fulls=1347
b=41, num_fulls=1387
b=42, num_fulls=1392
b=43, num_fulls=1426
b=44, num_fulls=1459
b=45, num_fulls=1472
b=46, num_fulls=1489
b=47, num_fulls=1529
b=48, num_fulls=1538
b=49, num_fulls=1564
b=50, num_fulls=1582
b=51, num_fulls=1599
b=52, num_fulls=1611
b=53, num_fulls=1647
b=54, num_fulls=1659
b=55, num_fulls=1696
b=56, num_fulls=1707
b=57, num_fulls=1725
b=58, num_fulls=1737
b=59, num_fulls=1782
b=60, num_fulls=1787
b=61, num_fulls=1825
b=62, num_fulls=1834
b=63, num_fulls=1848
b=64, num_fulls=1860
b=65, num_fulls=1883
b=66, num_fulls=1896
b=67, num_fulls=1948
b=68, num_fulls=1970
b=69, num_fulls=1988
b=70, num_fulls=1998
b=71, num_fulls=2031
b=72, num_fulls=2036
b=73, num_fulls=2071
b=74, num_fulls=2104
b=75, num_fulls=2116
b=76, num_fulls=2128
b=77, num_fulls=2169
b=78, num_fulls=2173
b=79, num_fulls=2207
b=80, num_fulls=2217
b=81, num_fulls=2237
b=82, num_fulls=2246
b=83, num_fulls=2284
b=84, num_fulls=2290
b=85, num_fulls=2309
b=86, num_fulls=2322
b=87, num_fulls=2338
b=88, num_fulls=2361
b=89, num_fulls=2387
b=90, num_fulls=2394
b=91, num_fulls=2414
b=92, num_fulls=2427
b=93, num_fulls=2440
b=94, num_fulls=2452
b=95, num_fulls=2474
b=96, num_fulls=2483
b=97, num_fulls=2516
b=98, num_fulls=2524
b=99, num_fulls=2561
Data gathering (excluding precomputation) time: 0.210
Counting cycles...
Total large primes: 20110
hash_size=40220
Relations computed: 2561 fulls, 1291 cycles, 3852 total
3852

选多项式很重要啊,下面29位的都OK,可上面5位的都超一分钟了

> R<X,Y> := PolynomialRing(Integers( ),2);
> n := 70478782497479747987234958341;
> F := 814*X^4 + 3172*X^3*Y - 49218*X^2*Y^2 - 142775*X*Y^3
> - 65862*Y^4;
> m1 := 3050411;
> m2 := 1;
> A := NFSProcess(n,F,m1,m2);
> A`Firstb := 0;
> A`Lastb := 99;
> A`OutputFilename := "/tmp/nfs-distrib-A";
> FindRelations(A);

B := NFSProcess(n,F,m1,m2);
> B`Firstb := 99;
> B`Lastb := 199;
> B`OutputFilename := "/tmp/nfs-distrib-B";
> FindRelations(B);
input_files := ["/tmp/nfs-distrib-A","/tmp/nfs-distrib-B"];
> P := NFSProcess(n,F,m1,m2);
> P`OutputFilename := "/tmp/nfs-distrib-all";
> MergeFiles(input_files, P`OutputFilename);
CycleCount(P);
CreateCycleFile(P);
> CreateCharacterFile(P);
> FindDependencies;

A`OutputFilename := "/tmp/nfs-distrib-all";
> Factor(A,9);  // factor dependency 9
B`OutputFilename := "/tmp/nfs-distrib-all";
> Factor(P,1);  // factor dependency 1

60922
235195
4162 25930
4373
Intrinsic 'FindDependencies'

Signatures:

    (<NFSProc> P)

        Find dependencies between relations in the NFS process P.

0
0
[ <11, 1> ]
[ 6407162045225431635203178031 ]

MPQS(70478782497479747987234958341);

[ <11, 1> ]
[ 6407162045225431635203178031 ]
2011-4-13 19:10
0
雪    币: 433
活跃值: (45)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
7
求范:

C<b> := ComplexField(100);
Norm(111111111111111+22222222222*b);
Norm(1111111111111111111111111111111+2224444444444444444444477777777777777777722222222*b);
2011-4-13 20:48
0
游客
登录 | 注册 方可回帖
返回
//