資源簡介
使用VC實現RSA簡單的加密解密,輸入字符串,得到加密字符串,對加密字符串解密

代碼片段和文件信息
#include?“stdafx.h“
#include?“KeyProduce.h“
#include?
CKEY_PRODUCE::CKEY_PRODUCE()
{?}
CKEY_PRODUCE::~CKEY_PRODUCE()
{?}
int?CKEY_PRODUCE::JudgePrime(unsigned?int?prime)
{
unsigned?int?i;
unsigned?int?limit=?(unsigned?int)sqrt(?(double)prime?);
for(i=2;?i?<=?limit;?i++)
{
if(prime%i==0)?return?0;
}
????return?1;
}
int?CKEY_PRODUCE::gcd(unsigned?int?aunsigned?int?b)
{
if?(a<=0||b<=0)?return?0;
while?(b)
{
unsigned?int?r?=?a?%?b;
a=b;?b=r;
}
return?a;
}
int?CKEY_PRODUCE::niyuan(unsigned?int?eunsigned?int?mod)
{
int?x1x2x3y1y2y3t1t2t3temp;
????x1=1;?x2=0;?x3=mod;
y1=0;?y2=1;?y3=e;
while(1)
{
if(y3==0)
{
return?0;
break;
}
else?if(y3==1)
{
if(y2<0)??return?(y2+mod);
else?return?y2;
break;
}
temp=x3/y3;
t1=x1-temp*y1;?t2=x2-temp*y2;?t3=x3-temp*y3;
x1=y1;?x2=y2;?x3=y3;
y1=t1;?y2=t2;?y3=t3;
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5978??2008-12-12?23:12??RSA\Debug\KeyPruduce.obj
?????文件?????110633??2008-12-12?23:12??RSA\Debug\RSA.exe
?????文件?????274072??2008-12-12?23:12??RSA\Debug\RSA.ilk
?????文件??????13803??2008-12-12?22:12??RSA\Debug\RSA.obj
?????文件????5502064??2008-12-12?21:50??RSA\Debug\RSA.pch
?????文件?????386048??2008-12-12?23:12??RSA\Debug\RSA.pdb
?????文件???????2992??2008-12-12?23:05??RSA\Debug\RSA.res
?????文件??????32825??2008-12-12?23:12??RSA\Debug\RSADlg.obj
?????文件?????105440??2008-12-12?21:50??RSA\Debug\StdAfx.obj
?????文件?????214016??2008-12-18?20:07??RSA\Debug\vc60.idb
?????文件?????364544??2008-12-12?23:12??RSA\Debug\vc60.pdb
?????文件????????417??2008-12-12?23:12??RSA\KeyProduce.h
?????文件????????936??2008-12-12?23:12??RSA\KeyPruduce.cpp
?????文件???????3525??2008-12-12?17:11??RSA\ReadMe.txt
?????文件???????1078??2008-12-12?17:11??RSA\res\RSA.ico
?????文件????????395??2008-12-12?17:11??RSA\res\RSA.rc2
????..A.SH.??????3072??2008-12-12?23:17??RSA\res\Thumbs.db
?????文件???????1049??2008-12-12?21:50??RSA\resource.h
?????文件??????36000??2008-12-12?23:05??RSA\RSA.APS
?????文件???????1605??2008-12-18?20:08??RSA\RSA.clw
?????文件???????2021??2008-12-12?17:11??RSA\RSA.cpp
?????文件???????4237??2008-12-12?23:05??RSA\RSA.dsp
?????文件????????529??2008-12-12?17:11??RSA\RSA.dsw
?????文件???????1291??2008-12-12?17:11??RSA\RSA.h
?????文件??????58368??2008-12-18?20:08??RSA\RSA.ncb
?????文件??????54784??2008-12-18?20:08??RSA\RSA.opt
?????文件????????240??2008-12-18?20:07??RSA\RSA.plg
?????文件???????6015??2008-12-12?23:05??RSA\RSA.rc
?????文件???????7099??2008-12-12?22:57??RSA\RSADlg.cpp
?????文件???????1487??2008-12-12?22:10??RSA\RSADlg.h
............此處省略8個文件信息
- 上一篇:圓檢測 用霍夫變換算法實現
- 下一篇:c++課程設計賓館客房管理系統
評論
共有 條評論