Crypto++(CryptoPP)库初始化以及使用注意事项

拜雨学Cryptopp 在Android中使用Cryptopp Cryptopp是一个C++编写的加密库,支持多种加密。常见的MD5、SHA、RSA、DES等等。因为自己在学习JNI,但是单纯的学习C/C++学不进去,所以编译一个加密库来强化学习。 本次学习主要目标 成功编译Cryptopp并且在Android中使用该库进行基本加密。 对于程序员来说学习一种语言或者框架最好的就是去官网。下面说明下Cryptopp官网的几个常用的地址 官网首页 编译教程 官方示例 咱们就按着这个来学习在Android中使用Cryptopp来加密 阅读详情

开篇提示:本文为本人原创,本文欢迎转载,但必须注明本文出处,例如。
“该文引用自 CruiseYoung的:Crypto++(CryptoPP)库初始化以及使用注意事项
http://blog.youkuaiyun.com/fksec/article/details/41012391”
否则说明阁下愿意支付以100元人民币每字计的稿费,敬请留意。

1 官网

地址:http://www.cryptopp.com/

2 重要资料来源

2.1 源代码中的“Readme.txt”文件;
2.2 源代码中的测试工程“dlltest”中的“dlltest.cpp”;

3 使用注意事项

3.1 重要文档摘录;

*** MSVC-Specific Information ***

On Windows, Crypto++ can be compiled into 3 forms: a static library
including all algorithms, a DLL with only FIPS Approved algorithms, and
a static library with only algorithms not in the DLL.
(FIPS Approved means Approved according to the FIPS 140-2 standard.)
The DLL may be used by itself, or it may be used together with the second
form of the static library. MSVC project files are included to build
all three forms, and sample applications using each of the three forms
are also included.

To compile Crypto++ with MSVC, open the "cryptest.dsw" (for MSVC 6 and MSVC .NET 
2003) or "cryptest.sln" (for MSVC 2005 - 2010) workspace file and build one or 
more of the following projects:

cryptopp - This builds the DLL. Please note that if you wish to use Crypto++
  as a FIPS validated module, you must use a pre-built DLL that has undergone
  the FIPS validation process instead of building your own.
dlltest - This builds a sample application that only uses the DLL.
cryptest Non-DLL-Import Configuration - This builds the full static library
  along with a full test driver.
cryptest DLL-Import Configuration - This builds a static library containing
  only algorithms not in the DLL, along with a full test driver that uses
  both the DLL and the static library.

To use the Crypto++ DLL in your application, #include "dll.h" before including
any other Crypto++ header files, and place the DLL in the same directory as
your .exe file. dll.h includes the line #pragma comment(lib, "cryptopp")
so you don't have to explicitly list the import library in your project
settings. To use a static library form of Crypto++, make the "cryptlib"
project a dependency of your application project, or specify it as
an additional library to link with in your project settings.
In either case you should check the compiler options to
make sure that the library and your application are using the same C++
run-time libraries and calling conventions.

*** DLL Memory Management ***

Because it's possible for the Crypto++ DLL to delete objects allocated 
by the calling application, they must use the same C++ memory heap. Three 
methods are provided to achieve this.
1.  The calling application can tell Crypto++ what heap to use. This method 
    is required when the calling application uses a non-standard heap.
2.  Crypto++ can tell the calling application what heap to use. This method 
    is required when the calling application uses a statically linked C++ Run 
    Time Library. (Method 1 does not work in this case because the Crypto++ DLL 
    is initialized before the calling application's heap is initialized.)
3.  Crypto++ can automatically use the heap provided by the calling application's 
    dynamically linked C++ Run Time Library. The calling application must
    make sure that the dynamically linked C++ Run Time Library is initialized
    before Crypto++ is loaded. (At this time it is not clear if it is possible
    to control the order in which DLLs are initialized on Windows 9x machines,
    so it might be best to avoid using this method.)

When Crypto++ attaches to a new process, it searches all modules loaded 
into the process space for exported functions "GetNewAndDeleteForCryptoPP" 
and "SetNewAndDeleteFromCryptoPP". If one of these functions is found, 
Crypto++ uses methods 1 or 2, respectively, by calling the function. 
Otherwise, method 3 is used. 

3.2 通常,我们在使用一个库时,要么引用该库的静态库(static),要么引用改库的动态库(dll);

       而改库却有三种引用方式:
第一种:即通常的静态库引用方式,此处我们称为“全静态库”引入方式,记为:Static方式;
该种方式提供了所有的算法,无须做任何初始化。
第二种:“纯动态库”形式,记为:DLL-Only方式;
此种方式仅仅提供FIPS算法,即FIPS 140-2标准所规定的算法,在使用前必须检查FIPS140-2算法是否在编译期间打开。
        程序编写方式:见后附的文件fips140_sample_application.cpp;
第三种:同时使用静态库和动态库,记为:DLL-Import方式;
注意此时,工程的C++运行库(CRT,C++ Run Time Library)引入了(MT/MTD),此时可能和您的工程所设置的CRT有冲突,可能会出现非常多的千奇百怪的错误。
见文件:dll.h
#ifdef CRYPTOPP_IMPORTS

#ifdef _DLL
// cause CRT DLL to be initialized before Crypto++ so that we can use malloc and free during DllMain()
#ifdef NDEBUG
#pragma comment(lib, "msvcrt")
#else
#pragma comment(lib, "msvcrtd")
#endif
#endif

#pragma comment(lib, "cryptopp")

#endif		// #ifdef CRYPTOPP_IMPORTS
3.3 总结:
Static方式:
预定义宏:无
依赖库:cryptlib.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;
DLL方式:
以下两种方式,需要注意两点:
注意1:在引入Crypto++(CryptoPP)库任何头文件前必须先引入dll.h头文件;
注意2:由于在dll.h文件已经有语句#pragma comment(lib, "cryptopp"),所以不需要自己明确依赖“cryptopp.lib”库,但必须在工程的属性中的“附加库目录”中填写“cryptopp.lib”目录;
注意3:都需要进行库初始化,即保证库使用相同的内存堆,否则程序运行过程中会崩溃;见dlltest.cpp文件;
#ifdef CRYPTOPP_IMPORTS

static PNew s_pNew = NULL;
static PDelete s_pDelete = NULL;

extern "C" __declspec(dllexport) void __cdecl SetNewAndDeleteFromCryptoPP(PNew pNew, PDelete pDelete, PSetNewHandler pSetNewHandler)
{
	s_pNew = pNew;
	s_pDelete = pDelete;
}

void * __cdecl operator new (size_t size)
{
	return s_pNew(size);
}

void __cdecl operator delete (void * p)
{
	s_pDelete(p);
}

#endif
DLL-Only方式:
预定义宏:CRYPTOPP_DLL_ONLY;
依赖库:odbc32.lib;odbccp32.lib;
程序编写方式:见后附的文件fips140_sample_application.cpp;
DLL-Import方式:
预定义宏:CRYPTOPP_IMPORTS;
注意4:CRYPTOPP_IMPORTS在第dll.h文件中已经定义,但此处要求定义,是为了使用后面总结的“cryptopp_dll_init.h”头文件。
依赖库:cryptlib.lib;Ws2_32.lib;

3.4 在引入以下头文件时,必须先定义#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1,且在类名前使用Weak::
#include <arc4.h>
#include <md2.h>
#include <md4.h>
#include <md5.h>
原文:
You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.

4 Crypto++(CryptoPP)库初始化头文件

文件:cryptopp_dll_init.h

#ifndef CRYPTOPP_DLL_INIT_HEADER_
#define CRYPTOPP_DLL_INIT_HEADER_


#if defined (CRUISE_HAVE_PRAGMA_ONCE)
#pragma once
#endif


#ifndef CRYPTOPP_DLL_ONLY
#define CRYPTOPP_DEFAULT_NO_DLL
#endif


/***************************************************************************/
/* To use the Crypto++ DLL in your application, #include "dll.h" before including  */
/* any other Crypto++ header files, and place the DLL in the same directory as  */
/* your .exe file.                                                                                         */
/***************************************************************************/
#if defined(CRYPTOPP_DLL_ONLY) || defined(CRYPTOPP_IMPORTS)
#include "dll.h"

//USING_NAMESPACE(CryptoPP)
//USING_NAMESPACE(std)
#endif


/*******************************************************************************/
/* Note: You may be using a weak algorithm that has been retained for backwards */
/* compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before */
/* including this .h file and prepend the class name with 'Weak::' to remove this       */
/* warning."                                                                                                     */
/******************************************************************************/
#if 0
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include <arc4.h>
#include <md2.h>
#include <md4.h>
#include <md5.h>
#endif


/************************************************************************/
/* Because it's possible for the Crypto++ DLL to delete objects allocated     */
/* by the calling application, they must use the same C++ memory heap.      */
/* The following code block to achieve this.                                                */
/************************************************************************/
#ifdef CRYPTOPP_IMPORTS

static CryptoPP::PNew s_pNew = NULL;
static CryptoPP::PDelete s_pDelete = NULL;

extern "C" __declspec(dllexport)
inline void __cdecl SetNewAndDeleteFromCryptoPP(
    CryptoPP::PNew pNew,
    CryptoPP::PDelete pDelete,
    CryptoPP::PSetNewHandler pSetNewHandler)
{
    s_pNew = pNew;
    s_pDelete = pDelete;
}

inline void * __cdecl operator new (size_t size)
{
    return s_pNew(size);
}

inline void __cdecl operator delete (void * p)
{
    s_pDelete(p);
}

#endif


/************************************************************************/
/*  Check FIPS140 before the program enters a function mian                     */
/************************************************************************/
#ifdef CRYPTOPP_DLL_ONLY

// check FIPS validity
/*static/inline*/
inline int CHECK_FIPS140(void)
{
    USING_NAMESPACE(CryptoPP)
    USING_NAMESPACE(std)

    if (!FIPS_140_2_ComplianceEnabled())
    {
        cerr << "FIPS 140-2 compliance was turned off at compile time.\n";
        abort();
    }

    // perform the power - up self test
    DoDllPowerUpSelfTest();

    // check self test status
    if (GetPowerUpSelfTestStatus() != POWER_UP_SELF_TEST_PASSED)
    {
        cerr << "Automatic power-up self test failed.\n";
        abort();
    }
    cout << "Automatic power-up self test passed.\n";

    // simulate a power-up self test error
    //SimulatePowerUpSelfTestFailure();

    return 0;
}

//  Check FIPS140 before the program enters a function mian
static int g_fips_validity = CHECK_FIPS140();

#endif


#endif
使用方式:
第一:只需如3.3节所示,定义各种引入方式的预定义宏即可,引入对应的依赖库;
第二:在引入Crypto++(CryptoPP)库任何头文件之前引入该文件即可,库初始化已在头文件中自动完成。

5 PIPS140-2算法使用方法

文件:fips140_sample_application.cpp
#include "cryptopp_dll_init.h"


void fips140_sample_application()
{
#ifdef CRYPTOPP_DLL_ONLY

    USING_NAMESPACE(CryptoPP)
    USING_NAMESPACE(std)

    // encrypt and decrypt
    const byte key[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
    const byte iv[] = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef };
    const byte plaintext[] = {	// "Now is the time for all " without tailing 0
        0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
        0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20,
        0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 };
    byte ciphertext[24];
    byte decrypted[24];

    CFB_FIPS_Mode<DES_EDE3>::Encryption encryption_DES_EDE3_CFB;
    encryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv);
    encryption_DES_EDE3_CFB.ProcessString(ciphertext, plaintext, 24);

    CFB_FIPS_Mode<DES_EDE3>::Decryption decryption_DES_EDE3_CFB;
    decryption_DES_EDE3_CFB.SetKeyWithIV(key, sizeof(key), iv);
    decryption_DES_EDE3_CFB.ProcessString(decrypted, ciphertext, 24);

    if (memcmp(plaintext, decrypted, 24) != 0)
    {
        cerr << "DES-EDE3-CFB Encryption/decryption failed.\n";
        abort();
    }
    cout << "1. DES-EDE3-CFB Encryption/decryption succeeded.\n";

    // hash
    const byte message[] = { 'a', 'b', 'c' };
    const byte expectedDigest[] = { 0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A, 0xBA, 0x3E, 0x25, 0x71, 0x78, 0x50, 0xC2, 0x6C, 0x9C, 0xD0, 0xD8, 0x9D };
    byte digest[20];

    SHA1 sha;
    sha.Update(message, 3);
    sha.Final(digest);

    if (memcmp(digest, expectedDigest, 20) != 0)
    {
        cerr << "SHA-1 hash failed.\n";
        abort();
    }
    cout << "2. SHA-1 hash succeeded.\n";

    // create auto-seeded X9.17 RNG object, if available
#ifdef OS_RNG_AVAILABLE
    AutoSeededX917RNG<AES> rng;
#else
    // this is used to allow this function to compile on platforms that don't have auto-seeded RNGs
    RandomNumberGenerator &rng(NullRNG());
#endif

    // generate DSA key
    DSA::PrivateKey dsaPrivateKey;
    dsaPrivateKey.GenerateRandomWithKeySize(rng, 1024);
    DSA::PublicKey dsaPublicKey;
    dsaPublicKey.AssignFrom(dsaPrivateKey);
    if (!dsaPrivateKey.Validate(rng, 3) || !dsaPublicKey.Validate(rng, 3))
    {
        cerr << "DSA key generation failed.\n";
        abort();
    }
    cout << "3. DSA key generation succeeded.\n";

    // encode DSA key
    std::string encodedDsaPublicKey, encodedDsaPrivateKey;
    dsaPublicKey.DEREncode(StringSink(encodedDsaPublicKey).Ref());
    dsaPrivateKey.DEREncode(StringSink(encodedDsaPrivateKey).Ref());

    // decode DSA key
    DSA::PrivateKey decodedDsaPrivateKey;
    decodedDsaPrivateKey.BERDecode(StringStore(encodedDsaPrivateKey).Ref());
    DSA::PublicKey decodedDsaPublicKey;
    decodedDsaPublicKey.BERDecode(StringStore(encodedDsaPublicKey).Ref());

    if (!decodedDsaPrivateKey.Validate(rng, 3) || !decodedDsaPublicKey.Validate(rng, 3))
    {
        cerr << "DSA key encode/decode failed.\n";
        abort();
    }
    cout << "4. DSA key encode/decode succeeded.\n";

    // sign and verify
    byte signature[40];
    DSA::Signer signer(dsaPrivateKey);
    assert(signer.SignatureLength() == 40);
    signer.SignMessage(rng, message, 3, signature);

    DSA::Verifier verifier(dsaPublicKey);
    if (!verifier.VerifyMessage(message, 3, signature, sizeof(signature)))
    {
        cerr << "DSA signature and verification failed.\n";
        abort();
    }
    cout << "5. DSA signature and verification succeeded.\n";


    // try to verify an invalid signature
    signature[0] ^= 1;
    if (verifier.VerifyMessage(message, 3, signature, sizeof(signature)))
    {
        cerr << "DSA signature verification failed to detect bad signature.\n";
        abort();
    }
    cout << "6. DSA signature verification successfully detected bad signature.\n";

    // try to use an invalid key length
    try
    {
        ECB_Mode<DES_EDE3>::Encryption encryption_DES_EDE3_ECB;
        encryption_DES_EDE3_ECB.SetKey(key, 5);

        // should not be here
        cerr << "DES-EDE3 implementation did not detect use of invalid key length.\n";
        abort();
    }
    catch (InvalidArgument &e)
    {
        cout << "7. Caught expected exception when using invalid key length. Exception message follows: ";
        cout << e.what() << endl;
    }

    cout << "\nFIPS 140-2 Sample Application completed normally.\n";
#endif
}

6 个人使用总结

6.1 综合3种引入方式,最方便,最不易出错的方式为“Static方式”;

6.2 DLL-Import引入方式,个人最不推荐,因为3.2所述原因,它可能导致整个工程编译不过;

crypto++(cryptopp)加密库aes算法的使用 crypto crypto++ cryptopp 加密解密 aes 编译问题 阅读详情

相关推荐

VS2022配置Cryptopp-8.7.0库并实现AES加密算法

VS2022配置Cryptopp-8.7.0库并实现AES加密算法

Amazing_snack的博客 1816

C++使用CryptoPP密码库之AES加密算法进行文件加密

CryptoPP 是一个开源的密码学加密库,提供了大量的密码学算法和功能,包括对称加密、非对称加密、哈希函数、消息认证码 (MAC)、数字签名等。这里重点介绍一下对称加密算法(AES)的使用和注意事项。

weixin_66143829的博客 2697

基于MFC与Crypto++的AES加密工具开发实战

对称加密是信息安全领域的核心技术之一,它使用相同的密钥进行数据的加密与解密,确保了信息传输的机密性和完整性。AES(高级加密标准)作为目前最广泛使用的对称加密算法,以其高安全性和高效率成为行业标准。其核心原理在于通过多轮的替换、置换等操作,将明文数据转换为难以破解的密文。在工程实践中,将AES算法集成到具体的应用程序中,能有效保护本地文件、通信数据等敏感信息,广泛应用于数据存储、安全通信、软件保护等场景。本文通过一个具体的MFC桌面工具项目,详细展示了如何利用Crypto++库实现AES-256-CBC加密

weixin_30480075的博客 373

(全网最详细攻略)【Crypto++】在Visual studio2022中运行Cryptopp

Cryptopp是什么?如何下载Cryptopp?如何在VS中使用Crypto++?关于VS中多个源文件如何分开运行的解决方法VS2019下Crypto++安装与调用Crypto++的安装及使用Crypto++安装和简单使用RSA加密解密。

JingYan_Chan的博客 1万+

再看cryptopp, 版本5.6.1

CryptoPP 5.6.1 加密算法 介绍

笑面虎的专栏 2797

零、HarmonyOS应用开发者基础学习总览

零、HarmonyOS应用开发者基础学习总览

weixin_45029825的博客 1455

C++私有配置加密实战:AES-256与二进制序列化实现.enc文件保护

在软件工程实践中,数据安全是核心议题之一,尤其涉及本地敏感配置如API密钥、许可证信息时,防止明文泄露至关重要。对称加密算法因其加解密效率高,成为保护本地数据的首选方案,其中AES(高级加密标准)凭借其高强度与广泛硬件支持,成为行业黄金标准。其技术价值在于为应用程序提供透明的数据机密性与完整性保障,广泛应用于桌面客户端、游戏存档、商业软件许可等需要分发到用户环境的场景。结合二进制序列化技术,可将内存中的复杂数据结构高效转换为字节流,再通过AES-256-GCM等模式加密,最终生成扩展名为.enc的二进制文件

weixin_30335353的博客 401

【前端HTML生成条形码——MQ】

本文将展示前端HTML如何根据用户输入内容生成对应的条形码,附HTML和JS代码。代码如下(示例):

weixin_42588676的博客 1955

C/C++ 使用 cryptopp 加密解密

Crypto++(也称为CryptoPP)是一个流行的开源密码学库,提供了各种密码学算法的实现。它是用C++编写的,并在许可证允许的范围内可自由使用和修改。 Crypto++支持多种密码学算法,包括对称加密算法(如AES、DES、RC4)、哈希函数(如SHA-1、SHA-256)、消息认证码(如HMAC)、公钥加密算法(如RSA、DSA、ECC)以及其他密码学功能。

微软技术分享 1万+

educoder数字逻辑实训:寄存器设计与应用(Logisim)

第1关:基本寄存器的设计 任务描述 本关任务:在Logisim中,构建由4个D触发器构成的4位基本寄存器,要求上升沿触发,具有异步复位功能。 第2关:移位寄存器的设计 任务描述 本关任务:在Logisim中,构建由4个D触发器构成的4位右移移位寄存器,要求上升沿触发,具有异步复位功能。 第3关:循环移位寄存器的设计 任务描述 本关任务:在Logisim中,构建由4个D触发器构成的4位循环右移移位寄存器,要求上升沿触发,具有异步复位功能以及并行数据同步加载功能。 第4关:并行..

qq_52209002的博客 1万+

基于FPGA的车道线检测系统设计

本文设计了一种基于FPGA的车道线检测系统,采用Altera Cyclone IV EP4CE10F17C8作为主控芯片,结合OV7725摄像头和LCD显示屏实现实时车道线检测。系统通过硬件流水线处理架构,依次完成图像采集、灰度转换、中值滤波、Sobel边缘检测和Hough变换直线识别等功能模块。所有模块均采用Verilog HDL实现,充分利用FPGA的并行处理能力,显著提升了系统响应速度。测试结果表明,该系统能够有效检测道路车道线,满足实时性要求,为ADAS系统提供了一种高效的硬件解决方案。

huanghm88的专栏 123

C++密码库CryptoPP的安装使用

库文件编译时运行库默认选项在 Debug 模式下是 多线程调试 (/MTd) ,Release 模式下是 多线程调试 (/MT),所以如果在库文件编译时没有进行修改则需要在引用项目中进行修改以保持一致。新建一个文件夹 CryptoPP ,在此文件夹下新建三个子文件夹 include、lib 和 bin ,分别存放解压缩文件夹中的所有头文件、生成的 .lib 文件以及 生成的 .dll 文件,在项目中引用即可。(2)选择项目编译动态链接库选择项目 cryptdll,编译静态链接库选择项目 cryptlib。

weixin_66143829的博客 2279

5大步骤!轻松玩转Dorisoy.Rigger:基于.NET Core 6、MAUI和Blazor的多数据库开发框架生成器

各位小伙伴,你们是否厌倦了每次项目启动都要从头配置数据库连接、编写重复的代码?今天,我们就来聊聊如何使用Dorisoy.Rigger这个强大的开发框架生成器,让你的.NET Core 6、MAUI和Blazor项目开发变得简单又高效!准备好迎接开发的新乐趣了吗?让我们一起开始吧!接下来,我们需要定义数据模型。假设我们有一个简单的用户表,包含ID、用户名和密码字段。在项目中创建一个新的类文件,命名为User.csset;set;set;这段代码定义了一个用户模型,其中包含了用户的ID、用户名和密码。

java专栏 1741

C++ CryptoPP使用RSA加解密

Crypto++ (CryptoPP) 是一个用于密码学和加密的 C++ 库。它是一个开源项目,提供了大量的密码学算法和功能,包括对称加密、非对称加密、哈希函数、消息认证码 (MAC)、数字签名等。Crypto++ 的目标是提供高性能和可靠的密码学工具,以满足软件开发中对安全性的需求。RSA(Rivest-Shamir-Adleman)是一种非对称加密算法,由三位密码学家Ron Rivest、Adi Shamir和Leonard Adleman于1977年共同提出。RSA算法被广泛应用于信息安全领域,特别是

微软技术分享 2万+

Cadence virtuos安装教程

本文详细介绍了在Ubuntu 18.04系统上安装Cadence Virtuoso IC617及MMSIM的完整流程。主要内容包括:1)系统环境准备(安装JDK及相关依赖包);2)通过创建软链接和修改系统文件实现RedHat环境兼容;3)共享目录文件操作与分卷压缩包合并解压技巧;4)使用InstallScape工具的安装步骤详解,包括权限处理和配置选项。特别提醒需注意系统兼容性处理(如创建redhat-release文件)和分卷压缩包的特殊解压方法(cat合并)。整个安装过程涉及大量Linux命令操作,需特

wangjie36的博客 299

【推荐100个unity插件】unity易于使用模块化设计的天空、体积云和天气系统——Enviro 3

Enviro 3是一款功能强大的Unity天空与天气系统插件,提供动态天空、体积云、天气模拟等丰富功能。安装时需将预制体拖入场景并配置主相机,URP支持需激活深度纹理和添加渲染特性。模块化设计允许自由添加/移除时间、光照、雾效等模块,并通过API控制参数。推荐配合色调映射(如ACES模式)获得最佳视觉效果。插件支持季节、温湿度模拟及闪电风暴等特效,适用于需要逼真环境渲染的Unity项目。

向宇的博客,专注php/web全栈 unity游戏开发,欢迎大家评论纠错 2094

CryptoPP 使用方法

Crypto++ 使用方法 ——长时间以来,没增加新文章!凡所增加,必属原创。2007-7-24 0 引言为阅读本文,读者需要具备密码学最基本的知识,如:对称加密和非对称加密、数字签名等。还好,准备这些知识,一个下午的时间就足够了。许多朋友问我如何使用CryptoPP(目前最新版本为5.4),我以前也没用过,但一直觉得是个好东西,属于经典的C++库之一。因此,有必要把它

恒 1万+

【Android调试】高通adb识别不到设备的完整排查指南:从驱动到端口一步到位

本文系统梳理高通(Qualcomm)平台Android设备adb无法识别的完整排查流程。从最基础的USB连接检查开始,到Windows设备管理器中驱动状态的判断、高通USB驱动的正确安装与更新方法,再到adb端口被占用、USB调试未开启、驱动签名校验失败等高频场景的解决方案。每一步均配截图和操作命令,文末附常见报错速查表,适合做系统开发、刷机调试或者Android Framework bringup时遇到adb不通的工程师快速定位。

weixin_44081096的博客 284

C++ CryptoPP使用AES加解密

Crypto++ (CryptoPP) 是一个用于密码学和加密的 C++ 库。它是一个开源项目,提供了大量的密码学算法和功能,包括对称加密、非对称加密、哈希函数、消息认证码 (MAC)、数字签名等。Crypto++ 的目标是提供高性能和可靠的密码学工具,以满足软件开发中对安全性的需求。高级加密标准(Advanced Encryption Standard,AES)是一种对称密钥加密标准,用于保护电脑上的敏感数据。AES是由美国国家标准与技术研究院(NIST)于2001年确定的,它取代了过时的数据加密标准(D

微软技术分享 6604

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

Cryptopp是什么

Crypto++(Crypto++ Library)是一个开源的、跨平台的、用 C++ 编写的密码学库。它提供了许多常见的密码学算法的实现,包括对称加密算法(如AES、DES)、哈希函数(如SHA-256、MD5)、公钥加密算法(如RSA、DSA)等。Crypto++ 不仅是一个用于学术和研究的工具,还被广泛应用于实际的软件开发中,特别是需要安全性和密码学支持的应用程序。总的来说,Crypto++ 是一个强大而灵活的密码学库,为开发者提供了一套完整的密码学工具,用于构建安全的软件系统。

m0_61629312的博客 521

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

CryptoPP使用介绍

CryptoPP使用介绍 发表时间:2012年06月15 分类: 编程开发 作者: 天缘 Crypto++是个免费的C++加解密类库,由于资格太老、持续更新,最新版本到了CryptoPP 5.6,对天缘而言,第一眼看到CryptoPP就感觉头大,根目录下放置大量单源文件、编译文件、项目文件,再加上多平台和多编译器支持,文件几乎又多了一倍,而且还是都混到一起,直接就让人望而却步。毕竟Cr

兴趣是最好的老师 2024

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

【crypto++使用】使用crypto++库函数运行RSA非对称加密

crypto++是一个开源密码学函数库,里面含有很多加密函数的库供大家引用,本文记录如何引用crypto++库函数实现RSA加密/签名。

JingYan_Chan的博客 3336

编译cryptopp库

因为我们在自己工程中,往往“属性-》配置属性-》C/C++ -》代码生成-》:基本运行时检查和运行库都分别为:“默认值”和“多线程调试DLL(/MDd)” 或者“默认值”和“多线程调试DLL(/MD)””,不过cryptest.sln工程中cryptlib属性不是这样的,如果不修改,我们自己工程在编译的时候就会报“error LNK2038: 检测到“RuntimeLibrary”的不匹配项”。5. 接着右键crptlib-》清理-》重新生成,生成后指定路径下就会有对应的lib文件。

shenjianhua005的专栏 1362

VS下Crypto++的安装

VS下Crypto++的安装

dwh1094723584的博客 2111

基于Crypto++/Cryptopp的rsa密钥生成,rsa加密、解密,rsa签名、验签

转载于http://www.xdty.org/1678 在项目中需要增加一个注册的功能,想到了用rsa非对称加密的方法。对比了openssl等第三方库,最后采用了Cryptopp。 1.源文件整理 可以在http://www.cryptopp.com/获取库的源文件,解压后将文件重新归档。头文件放置到include文件夹,cpp放到src目录。同时去除所有的test相关的cpp及非c

晴天的专栏 5612
上一篇: Visual Studio 2013编译libiconv-1.14
下一篇: 将libzdb移植到msvc(Visual Studio 2013)
CruiseYoung
博客等级 码龄20年 157粉丝 25原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值