資源簡(jiǎn)介
使用OPENSSL庫(kù)進(jìn)行AES256位對(duì)稱加解密的例子程序

代碼片段和文件信息
#include?
#include?
#include?
#include?
#pragma?comment(lib“l(fā)ibeay32.lib“)
int?main(int?argc?char?**argv)
{
unsigned?char?buf[16];
memset(buf1sizeof(buf));
unsigned?char?buf2[16];
unsigned?char?buf3[16];
unsigned?char?aes_keybuf[32];
memset(aes_keybuf0sizeof(aes_keybuf));
AES_KEY?aeskey;
AES_set_encrypt_key(aes_keybuf256&aeskey);
AES_encrypt(bufbuf2&aeskey);
AES_set_decrypt_key(aes_keybuf256&aeskey);
AES_decrypt(buf2buf3&aeskey);
if(memcmp(bufbuf3sizeof(buf))==0)
printf(“test?success\r\n“);
else
printf(“test?fail\r\n“);
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
????.CA....???1170432??2012-06-21?16:03??OpenSSLAESTest\libeay32.dll
????.CA....????797690??2012-06-21?16:03??OpenSSLAESTest\libeay32.lib
????.CA....???????626??2012-07-04?13:33??OpenSSLAESTest\main.cpp
????.CA....??????5507??2012-06-21?16:01??OpenSSLAESTest\openssl\aes.h
????.CA....??????2892??2012-06-21?16:01??OpenSSLAESTest\openssl\appli
????.CA....?????52190??2012-06-21?16:01??OpenSSLAESTest\openssl\asn1.h
????.CA....?????30092??2012-06-21?16:01??OpenSSLAESTest\openssl\asn1t.h
????.CA....?????19143??2012-06-21?16:01??OpenSSLAESTest\openssl\asn1_mac.h
????.CA....?????32987??2012-06-21?16:01??OpenSSLAESTest\openssl\bio.h
????.CA....??????5143??2012-06-21?16:01??OpenSSLAESTest\openssl\blowfish.h
????.CA....?????36185??2012-06-21?16:01??OpenSSLAESTest\openssl\bn.h
????.CA....??????4646??2012-06-21?16:01??OpenSSLAESTest\openssl\buffer.h
????.CA....??????4956??2012-06-21?16:01??OpenSSLAESTest\openssl\camellia.h
????.CA....??????4492??2012-06-21?16:01??OpenSSLAESTest\openssl\cast.h
????.CA....??????3244??2012-06-21?16:01??OpenSSLAESTest\openssl\cmac.h
????.CA....?????19927??2012-06-21?16:01??OpenSSLAESTest\openssl\cms.h
????.CA....??????1978??2012-06-21?16:01??OpenSSLAESTest\openssl\comp.h
????.CA....??????9848??2012-06-21?16:01??OpenSSLAESTest\openssl\conf.h
????.CA....??????4080??2012-06-21?16:01??OpenSSLAESTest\openssl\conf_api.h
????.CA....?????23940??2012-06-21?16:00??OpenSSLAESTest\openssl\crypto.h
????.CA....?????10849??2012-06-21?16:01??OpenSSLAESTest\openssl\des.h
????.CA....?????18238??2012-06-21?16:01??OpenSSLAESTest\openssl\des_old.h
????.CA....??????9979??2012-06-21?16:01??OpenSSLAESTest\openssl\dh.h
????.CA....?????12057??2012-06-21?16:01??OpenSSLAESTest\openssl\dsa.h
????.CA....?????18095??2012-06-21?16:01??OpenSSLAESTest\openssl\dso.h
????.CA....??????7959??2012-06-21?16:01??OpenSSLAESTest\openssl\dtls1.h
????.CA....???????540??2012-06-21?16:00??OpenSSLAESTest\openssl\ebcdic.h
????.CA....?????45883??2012-06-21?16:01??OpenSSLAESTest\openssl\ec.h
????.CA....??????4682??2012-06-21?16:01??OpenSSLAESTest\openssl\ecdh.h
????.CA....?????10510??2012-06-21?16:01??OpenSSLAESTest\openssl\ecdsa.h
............此處省略59個(gè)文件信息
評(píng)論
共有 條評(píng)論