資源簡介
SHA-1算法c語言實現,對下載到的代碼進行修改,編譯,驗證的過程請參考:http://blog.csdn.net/testcs_dn/article/details/25771377
代碼片段和文件信息
//?SHA1.cpp?:?定義控制臺應用程序的入口點。
//
#include?“stdafx.h“
#include
#include?
#include?
#include?
void?creat_w(unsigned?char?input[64]unsigned?long?w[80])
{
???int?ij;unsigned?long?temptemp1;
???for(i=0;i<16;i++)
??????????{
?????????????j=4*i;
?????????????w[i]=((long)input[j])<<24?|((long)input[1+j])<<16|((long)input[2+j])<<8|((long)input[3+j])<<0;
??????????}
???for(i=16;i<80;i++)
?????????{
?????????????w[i]=w[i-16]^w[i-14]^w[i-8]^w[i-3];
?????????????temp=w[i]<<1;
?????????????temp1=w[i]>>31;
?????????????w[i]=temp|temp1;
?????????}
}
char?ms_len(long?achar?intput[64])
{
????unsigned?long?temp3p1;??int?ij;
????temp3=0;
????p1=~(~temp3<<8);
????for(i=0;i<4;i++)
???????{
??????????j=8*i;
??????????intput[63-i]=(char
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????7114??2014-05-14?09:54??SHA1\Debug\BuildLog.htm
?????文件?????????65??2014-05-14?09:54??SHA1\Debug\mt.dep
?????文件????????406??2014-05-14?09:07??SHA1\Debug\SHA1.exe.em
?????文件????????472??2014-05-14?09:07??SHA1\Debug\SHA1.exe.em
?????文件????????388??2014-05-14?09:54??SHA1\Debug\SHA1.exe.intermediate.manifest
?????文件??????26224??2014-05-14?09:54??SHA1\Debug\SHA1.obj
?????文件????1048576??2014-05-14?08:55??SHA1\Debug\SHA1.pch
?????文件??????10624??2014-05-14?08:55??SHA1\Debug\stdafx.obj
?????文件?????314368??2014-05-14?09:54??SHA1\Debug\vc80.idb
?????文件?????151552??2014-05-14?09:54??SHA1\Debug\vc80.pdb
?????文件????????932??2014-05-14?08:55??SHA1\ReadMe.txt
?????文件???????2703??2014-05-14?09:54??SHA1\SHA1.cpp
?????文件???????4478??2014-05-14?08:55??SHA1\SHA1.vcproj
?????文件???????1427??2014-05-14?10:03??SHA1\SHA1.vcproj.USERLEN-LJRYJS1.Administrator.user
?????文件????????209??2014-05-14?08:55??SHA1\stdafx.cpp
?????文件????????378??2014-05-14?08:55??SHA1\stdafx.h
?????文件????6908928??2014-05-14?10:03??SHA1.ncb
?????文件????????877??2014-05-14?08:55??SHA1.sln
????..A..H.??????8704??2014-05-14?10:03??SHA1.suo
?????文件??????40960??2014-05-14?09:54??debug\SHA1.exe
?????文件?????313968??2014-05-14?09:54??debug\SHA1.ilk
?????文件?????429056??2014-05-14?09:54??debug\SHA1.pdb
?????目錄??????????0??2014-05-14?09:54??SHA1\Debug
?????目錄??????????0??2014-05-14?09:54??SHA1
?????目錄??????????0??2014-05-14?09:49??debug
-----------?---------??----------?-----??----
??????????????9272409????????????????????25
- 上一篇:斗地主游戲源代碼(MFC)
- 下一篇:C語言結構體 按平均分成績排序
評論
共有 條評論