|
[求助]工作中遇到的一个追求速度的算法,国外有人控制在30秒内,我却要6分钟.
VOID ReadAll(DWORD m_BoxLength)//遍历并保存到文件或内存 { DWORD dwPos = 0; DWORD m_Current = 0; int m_FileLength=0; char*pFileMem=pFile; //pFile是内存映射的文件缓冲指针 while(m_Current < m_BoxLength) { BOOL IsEnd = FALSE; DWORD m_HeiPos = m_Current + 20000; //20000为最少重复字符数值 if(m_HeiPos > m_BoxLength) { m_HeiPos = m_BoxLength; IsEnd = TRUE; } BYTE m_Vaule = GetPosValue(m_Current); if(IsEnd == FALSE) { while(m_Vaule == GetPosValue(m_HeiPos)) { m_HeiPos += 20000; if(m_HeiPos > m_BoxLength) { m_HeiPos = m_BoxLength; IsEnd = TRUE; break; } } } if(IsEnd == FALSE) { int m_LowPos = m_HeiPos - 20000; while(1) { int m_MidPos = (m_LowPos+m_HeiPos) / 2; //取中间值 if(m_Vaule == GetPosValue(m_MidPos)) m_LowPos = m_MidPos; else m_HeiPos = m_MidPos; if(m_HeiPos = m_LowPos + 1) //修改后代码 break; } } *pFileMem++=m_Vaule;//这一句和下一句完成压缩保存将时间缩短 *((int*)pFileMem)=m_HeiPos - m_Current pFileMem+=4; dwPos += (m_HeiPos - m_Current); m_Current = m_HeiPos; } SaveToFile(pFile,pFileMem-pFile);//在这里一次性保存文件,pFileMem-pFile是文件长度 } 还有你不必将 int m_MidPos = (m_LowPos+m_HeiPos) / 2; //取中间值 修改为int m_MidPos = m_LowPos + (m_HeiPos - m_LowPos) / 2; //修改:取中间值 因为这两者的结果完全相等,而前者速度快 更没必要将 if(m_HeiPos = m_LowPos + 1) //修改后代码 修改为 if (GetPosValue(m_LowPos) != GetPosValue(m_LowPos + 1))//修改这里的退出条件 因为只有高低端数据不相等时才能进入while(1)这个循环,用前者判断足矣,况且你这样一修改,如果GetPosValue非常耗时,就可能使时间慢两倍 自己好好想想吧 |
|
[原创]大整数除法新算法(吐血发布)
我已用另个大整数除法(这里没公开,这里公开的只是一个适合64四字节除以32四字节的大整数除法) 测试过,只需要,20几分钟. |
|
[原创]大整数除法新算法(吐血发布)
看来你不知道在现有大整数除法运算的现状(不含本人的算法):现有的大整数除法比大整数除法的算法落后很多,现在有很多快速运算的大整数乘法,但却没有一个能摆脱时间复杂度为:T(n) = O(n^2)的大整数的除法。为说明情况这里首先设定一个大整数乘法为L X L的大数运算,即被乘数和乘数都是L个4字节,一个大整数除法为2L / L的大数运算,即被除数是2L个4字节和除数是L个4字节,当L<=64个4字节是,现有大整数除法所耗费的时间约是大整数乘法的2倍以上,不会出现10倍以上的情况,但随着L的变大,由于大整数除法没有快速运算方法,导致大整数除法所耗费的时间与大整数乘法所耗费的时间的比值变得很大,例如 L=2097152个四字节时,大整数除法所耗费的时间与大整数乘法所耗费的时间的比值达到上百倍,本人文中一共提供了两个新的大整数除法,一个是适用范围是L<=64,另一个是适用L〉64超大的整数除法运算,在L〉64超大的整数除法运算中充分利用现有的大整数乘法,使他的时间复杂度也降低为T(n) = O(nlog2 3),这就使该算法的运算效率大幅提高,因此文中所言,并无不妥。 |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
源头是生成hash密匙时间是现有计算机运算时间的10秒以上,这是不可行的,原因有2: 首先HASH次数太多很可能没有意义,因为HASH次数太多,可能会导致中间有些运算相互抵消,一旦被破解者所掌握这样就会使攻破的时间大幅缩短, 其次加密时间增加,不利于在速度较低的计算机上完成加密,而在速度较高的计算机去解密的这种情况。 越快越密通过直接增加源头密码的长度就可克服这些缺点 |
|
[求助]工作中遇到的一个追求速度的算法,国外有人控制在30秒内,我却要6分钟.
我虽然在60楼给出了遍历算法,但没经调试,所以我希望楼主采用该法后,能公布测试结果(包括 DEBUG版本和RELEASE版本) |
|
[求助]工作中遇到的一个追求速度的算法,国外有人控制在30秒内,我却要6分钟.
ReadAll(int m_BoxLength)//遍历并保存到文件或内存 { int m_Current=0; while(m_Current<m_BoxLength) { BOOL IsEnd=FALSE; int m_HeiPos=m_Current+20000; //20000为最少重复字符数值 if(m_HeiPos>m_BoxLength){m_HeiPos=m_BoxLength;IsEnd=TRUE;} BYTE m_Vaule m_Vaule=GetPosValue(m_Current); if(IsEnd==FALSE) { while(m_Vaule==GetPosValue(m_HeiPos)) { m_HeiPos+=20000; if(m_HeiPos>m_BoxLength){m_HeiPos=m_BoxLength;IsEnd=TRUE; break;} } } if(IsEnd==FALSE) { int m_LowPos=m_HeiPos-20000; while(1) { int m_MidPos=(m_LowPos+m_HeiPos)/2; if(m_Vaule==GetPosValue(m_MidPos)) m_LowPos=m_MidPos; else m_HeiPos=m_MidPos; if(m_HeiPos=m_LowPos+1) break; } } SaveVaule(m_Vaule,m_HeiPos-m_Current); //SaveVaule(int m_Vaule,int m_SameLength)的作用是将读取到值保存到文件中或内存中,自己写吧 m_Current=m_HeiPos; } } |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
exile还是没有理解AES加密磁盘数据时问题出在哪? 当然,如果AES加密无线信号,是一种不错加密方法,但我并没否定这点,本文讲的是加密磁盘数据,你首先要搞清楚现有的加密软件在使用AES加密磁盘数据时,决定AES加密强度的因素并不是AES的扩展密码,决定一个木桶能装多少水,不是由最长的木板决定的,而是由最短的那块木板决定的,AES应用到加密磁盘数据时,尽管AES的扩展密码(128、或176、或256位甚至更长)加密出来的密文的加密强度很高,但由于这些软件在源头上做的不好,导致源头密码太短,以致实际加密强度很低,当然,如果将本人的增加加密强度方法应用到AES的软件中,可以修复AES的箭伤。 学非对称加密的网友注意:我刚在本站贴了一个大整数相除的新算法,该算法效率很高。 |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
新事物出生总会遇到旧势力的围追堵截,开罪了AES,招徕强大的压制,始料未及。 |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
公布代码是不可能的,不过你可以去读我写的有关大整数除法的论文,该论文中提出了两种计算大整数除法的新方法,这两种新方法一中适合除数长度小于64个四字节的大整数除法,另一种适合除数长度大于64个四字节的大整数除法,或许对于大家写不对称加密很有帮助。 注意要先下载,解压并解密用WORD打开就可阅读。 |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
我说了那么多,没几个人能像你那样理解了那么多,但你还没有完全理解我所说的,其实你所说的如果在想明白一点的话,恰好证明了我的观点,我可以向你透露一个秘密:越快越密软件既可以加密文件,也可以加密文件夹,加密文件夹时就采用了分级密钥管理,如果你不信可以去分析代码. |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
源头密码是指密钥链的顶端密钥。当加密体制没有漏洞时,破解密文,当然应从源头密钥开始,谁会从128位、176位、256位开始,因为源头密钥的长度往往较短,突破了源头密钥后,其下面的密钥不是可以一个接一个的打开吗。采用哈西值验证密码一样可给攻击提供依据。 |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
越快越密解密时并没有使用所谓的MD5码,而是出人意料地采用了穷举法来寻找添加到源头密码中随机密码,默认设置是花1秒钟采用穷举法来寻找,因为通常情况下,用户打开很重要的加密文件时,多等待1秒钟是值得的,用户愿意花1秒钟将密文的加密强度增加成千上万倍。在默认设置下,计算机速度越快,添加的随机密码越长,加密后生成的密文的加密强度也越高,也正因此取名为越快越密。文中图片在设置加密强度的区域,就有设置时间和预定计算机速度的选项,预定计算机速度是以加密机器的速度为参考来设置,加密时用户可以根据需要灵活设置。建议各位到越快越密网站下载试用一下就会知道功能强大。HTTP://WWW.JMJMM.COM |
|
[原创]量子计算机出现之前,越快越密就是对称加密王者(限磁盘数据)
32767是指附加的随机密码相对仅采用用户密码加密文件时的放大倍数,该随机密码是直接添加到用户密码中以增加用户的密码长度,以克服用户密码太短缺陷而计算机太快的危险性,并且32767是由用户根据预定解密计算机速度来设置,用户的计算机越快,该值越适合设置为更大值。越快越密内部采用的是2048位(比特)密钥加密,其加密强度超乎想象的大。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值