Crypto++ 入门

news2025/4/11 16:29:38

一、简介

Crypto++(也称为CryptoPP、libcrypto++或cryptlib)是一个免费的开源C++库,提供了多种加密方案。它由Wei Dai开发和维护,广泛应用于需要强大加密安全的各种应用程序中。该库提供了广泛的加密算法和协议的实现,包括:

  1. 对称加密算法:AES、DES、3DES、RC2、RC4、RC5、RC6、Blowfish、Twofish等。

  2. 非对称加密算法:RSA、DSA、ElGamal、ECC(椭圆曲线加密)等。

  3. 哈希函数:SHA-1、SHA-2(SHA-224、SHA-256、SHA-384、SHA-512)、MD2、MD4、MD5、RIPEMD-160等。

  4. 消息认证码(MAC):HMAC、CMAC等。

  5. 数字签名算法:DSA、ECDSA、EdDSA等。

  6. 随机数生成器:各种伪随机数生成器和真随机数生成器。

  7. 密码协议:SSL/TLS、SRP(安全远程密码协议)等。

Crypto++的设计目标是提供高性能、高质量的加密算法实现,并且易于集成到C++应用程序中。它是一个跨平台的库,支持多种操作系统,包括Windows、Linux、macOS等。

二、下载

Crypto++下载:

Crypto++ Library 8.9 | Free C++ Class Library of Cryptographic Schemes

或者Tags · weidai11/cryptopp · GitHub

cryptopp-pem下载:

PEM Pack - Crypto++ Wiki ,滚动到页面最下方下载

PEM Pack 是一个消息加密的部分实现,它允许你读取和写入 PEM 编码的密钥和参数,包括加密的私钥。该包额外提供了对 RSA、DSA、EC、ECDSA 密钥以及 Diffie-Hellman 参数的支持。该包包含五个额外的源文件,一个使用 OpenSSL 创建测试密钥的脚本,一个用于测试读取和写入密钥的 C++ 程序,以及一个用于验证由 Crypto++ 写入的密钥的脚本。

最终下载文件如下:

cryptopp-CRYPTOPP_8_7_0.zip

cryptopp-pem-master.zip

三、编译静态库

1、解压cryptopp-CRYPTOPP_8_7_0.zip

再解压cryptopp-pem-master.zip,内容全部拷贝到cryptopp-CRYPTOPP_8_7_0中

2、VS打开cryptest.sln工程

3、往子工程cryptlib中加入pem包

选中cryptlib,右击“Header Files”->添加->现有项:

  • pem.h

  • pem_common.h

右击“Source Files”->添加->现有项:

  • pem_common.cpp

  • pem_read.cpp

  • pem_write.cpp

4、修改属性页-》配置属性-》C/C++ -》代码生成-》运行库 。debug模式选"多线程调试DLL(/MDd) 或者"多线程调试(/MTd)"",release模式选择“多线程DLL(/MD)” 或者"多线程(/MT)"

5、编译生成,右击子工程cryptlib点击“生成”

6、作为SDK发布

创建文件夹cryptopp870,内部创建include文件夹(存放.h文件),创建lib文件(夹存放.lib文件)

cryptopp-CRYPTOPP_8_7_0中所有头文件复制到include中

xxx/cryptopp-CRYPTOPP_8_7_0\x64\Output中的Debug和Release文件夹复制到lib中

 运行库说明:

在 Visual C++ 中,运行库(Runtime Library)有四个主要的选项,它们在编译和链接时使用不同的设置。这些选项主要影响程序的内存管理、异常处理和调试支持等方面。以下是这四个选项的区别:

  1. 多线程 (/MT)

    • 描述:使用静态链接的多线程运行库。

    • 特点

      • 程序在运行时不需要额外的 DLL 支持,因为所有的运行库代码都被静态链接到可执行文件中。

      • 可执行文件较大,因为包含了运行库的所有代码。

      • 适用于发布版本,因为不需要依赖外部 DLL。

    • 适用场景:不需要依赖外部 DLL 的独立应用程序。

  2. 多线程调试 (/MTd)

    • 描述:使用静态链接的多线程调试运行库。

    • 特点

      • /MT 类似,但包含了调试信息,适用于调试版本。

      • 可执行文件较大,因为包含了运行库的所有代码和调试信息。

      • 适用于调试版本,因为可以提供更详细的调试信息。

    • 适用场景:需要详细调试信息的调试版本。

  3. 多线程 DLL (/MD)

    • 描述:使用动态链接的多线程运行库。

    • 特点

      • 程序在运行时需要依赖 msvcrt.dll(Microsoft Visual C++ 运行库 DLL)。

      • 可执行文件较小,因为只包含了程序自身的代码,运行库代码在 msvcrt.dll 中。

      • 适用于发布版本,因为可以减小可执行文件的大小。

    • 适用场景:需要减小可执行文件大小的发布版本。

  4. 多线程调试 DLL (/MDd)

    • 描述:使用动态链接的多线程调试运行库。

    • 特点

      • /MD 类似,但包含了调试信息,适用于调试版本。

      • 程序在运行时需要依赖 msvcrtd.dll(Microsoft Visual C++ 调试运行库 DLL)。

      • 适用于调试版本,因为可以提供更详细的调试信息。

    • 适用场景:需要详细调试信息的调试版本。

总结:

  • /MT/MTd 使用静态链接,适用于不需要依赖外部 DLL 的独立应用程序。

  • /MD/MDd 使用动态链接,适用于需要减小可执行文件大小或依赖外部 DLL 的应用程序。

  • 调试版本通常使用 /MTd/MDd,因为它们包含了调试信息,有助于调试。

在选择运行库选项时,需要根据具体的需求和项目配置来决定使用哪个选项。确保所有相关的库和模块都使用相同的运行库选项,以避免链接错误。

例如,如果你有一个静态库 mylib.lib 是用 /MD 选项编译的,那么任何使用 mylib.lib 的可执行文件或 DLL 也必须使用 /MD 选项进行编译。

四、使用示例

VS配置:

新建一个测试工程,添加依赖库

属性页-》配置属性-》C/C++ -》常规-》附加包含目录,输入头文件路径E:\3rdparty\dist\cryptopp870\include

属性页-》配置属性-》链接器-》常规-》附加库目录,输入lib文件路径E:\3rdparty\dist\cryptopp870\lib\Debug

属性页-》配置属性-》链接器-》输入-》附加依赖项,添加cryptlib.lib

QT配置:


CONFIG(debug, debug|release) {
    QMAKE_CXXFLAGS_DEBUG += /MTd    # 或/MDd
}

CONFIG(release, debug|release) {
    QMAKE_CXXFLAGS_RELEASE += /MT   # 或/MD
}

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/cryptopp870/lib/Release/ -lcryptlib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/cryptopp870/lib/Debug/ -lcryptlib

INCLUDEPATH += $$PWD/cryptopp870/include
DEPENDPATH += $$PWD/cryptopp870/include

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/cryptopp870/lib/Release/libcryptlib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/cryptopp870/lib/Debug/libcryptlib.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/cryptopp870/lib/Release/cryptlib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/cryptopp870/lib/Debug/cryptlib.lib

4.1、RSA非对称加密

#include <iostream>
#include <string>
#include <rsa.h>
#include <osrng.h>
#include <base64.h>
#include <files.h>
#include <pem.h>

using namespace std;
using namespace CryptoPP;

class RSAKeyManager {
public:
    RSAKeyManager() {}

    void GenerateKeys(int keySize = 2048) {
        AutoSeededRandomPool rng;
        privateKey.GenerateRandomWithKeySize(rng, keySize);
        publicKey = RSA::PublicKey(privateKey);
    }

    std::string GetPrivateKeyPEM() const {
        std::string privateKeyPEM;
        StringSink privateKeySink(privateKeyPEM);
        PEM_Save(privateKeySink, privateKey);
        return privateKeyPEM;
    }

    std::string GetPublicKeyPEM() const {
        std::string publicKeyPEM;
        StringSink publicKeySink(publicKeyPEM);
        PEM_Save(publicKeySink, publicKey);
        return publicKeyPEM;
    }

    void SavePrivateKey(const char* filename) const {
        FileSink file(filename);
        PEM_Save(file, privateKey);
    }

    void SavePublicKey(const char* filename) const {
        FileSink file(filename);
        PEM_Save(file, publicKey);
    }

    void LoadPrivateKey(const char* filename) {
        FileSource file(filename, true);
        PEM_Load(file, privateKey);
    }

    void LoadPublicKey(const char* filename) {
        FileSource file(filename, true);
        PEM_Load(file, publicKey);
    }

    void LoadPrivateKeyFromString(const std::string& privateKeyPEM) {
        StringSource source(privateKeyPEM, true);
        PEM_Load(source, privateKey);
    }

    void LoadPublicKeyFromString(const std::string& publicKeyPEM) {
        StringSource source(publicKeyPEM, true);
        PEM_Load(source, publicKey);
    }

    std::string Encrypt(const std::string& message) const {
        AutoSeededRandomPool rng;
        std::string encrypted;
        RSAES_OAEP_SHA_Encryptor encryptor(publicKey);
        StringSource(message, true,
            new PK_EncryptorFilter(rng, encryptor,
                new StringSink(encrypted)
            )
        );
        return encrypted;
    }

    std::string Decrypt(const std::string& encrypted) const {
        AutoSeededRandomPool rng;
        std::string decrypted;
        RSAES_OAEP_SHA_Decryptor decryptor(privateKey);
        StringSource(encrypted, true,
            new PK_DecryptorFilter(rng, decryptor,
                new StringSink(decrypted)
            )
        );
        return decrypted;
    }

private:
    RSA::PrivateKey privateKey;
    RSA::PublicKey publicKey;
};

int main() {
    try {
        RSAKeyManager keyManager;

        // 生成密钥对
        keyManager.GenerateKeys();

        // 将私钥和公钥转换为PEM格式
        std::string privateKeyPEM = keyManager.GetPrivateKeyPEM();
        std::cout << "RSA Private Key:" << std::endl;
        std::cout << privateKeyPEM << std::endl;

        std::string publicKeyPEM = keyManager.GetPublicKeyPEM();
        std::cout << "RSA Public Key:" << std::endl;
        std::cout << publicKeyPEM << std::endl;

        // 从字符串加载密钥对
        RSAKeyManager loadedKeyManager;
        loadedKeyManager.LoadPrivateKeyFromString(privateKeyPEM);
        loadedKeyManager.LoadPublicKeyFromString(publicKeyPEM);

        // 加密
        string message = "Hello, World!";
        string encrypted = loadedKeyManager.Encrypt(message);

        // 解密
        string decrypted = loadedKeyManager.Decrypt(encrypted);

        // 输出结果
        cout << "Original message: " << message << endl;
        cout << "Encrypted message: " << encrypted << endl;
        cout << "Decrypted message: " << decrypted << endl;
    }
    catch (const Exception& e) {
        cout << "Crypto++ exception: " << e.what() << endl;
    }
    catch (const std::exception& e) {
        cout << "Standard exception: " << e.what() << endl;
    }
    catch (...) {
        cout << "Unknown exception" << endl;
    }
    return 0;
}

4.2、RSA签名

生成密钥对、签名数据以及验证签名

#include <iostream>
#include <string>
#include <rsa.h>
#include <osrng.h>
#include <base64.h>
#include <files.h>
#include <pem.h>
#include <sha.h>
#include <hex.h>
#include <pssr.h>

using namespace std;
using namespace CryptoPP;


void GenerateKeyPair(RSA::PrivateKey& privateKey, RSA::PublicKey& publicKey) {
    AutoSeededRandomPool rng;
    privateKey.GenerateRandomWithKeySize(rng, 2048);
    publicKey = RSA::PublicKey(privateKey);
}

bool SignMessage(const string& message, const RSA::PrivateKey& privateKey, string &signature) {
    try
    {
        AutoSeededRandomPool rng;
        RSASS<PSS, SHA256>::Signer signer(privateKey);

        StringSource(message, true,
            new SignerFilter(rng, signer,
                new StringSink(signature)
            )
        );
    }
    catch (const Exception& e)
    {
        cout << "Sign exception: " << e.what() << endl;
        return false;
    }
    return true;
}

bool VerifyMessage(const string& message, const string& signature, const RSA::PublicKey& publicKey) {
    try {
        RSASS<PSS, SHA256>::Verifier verifier(publicKey);
        /* 解签使用内容+签名 */
        StringSource ss(message + signature , true,
            new SignatureVerificationFilter(verifier,
                NULL,
                SignatureVerificationFilter::THROW_EXCEPTION | SignatureVerificationFilter::PUT_MESSAGE
            )
        );
    }
    catch (const Exception& e) {
        cout << "Verifier exception: " << e.what() << endl;
        return false;
    }
    return true;
}

struct LicenseData {
    string message = "2024/6/19, 2024/7/19";
    string signature;   /* 数字签名,验证数据是否被修改 */
    string publicKey;   /* 公钥 */
};


int main() {
    try {
        RSA::PrivateKey privateKey;
        RSA::PublicKey publicKey;

        // 生成密钥对
        GenerateKeyPair(privateKey, publicKey);

        // 要签名的消息
        string message = "Hello, World!";

        // 签名消息
        string signature;
        bool b = SignMessage(message, privateKey, signature);
        cout << "signature:" << b << endl << signature << endl;

        // 验证签名
        b= VerifyMessage(message, signature, publicKey);
        if (b) {
            cout << "Signature is valid." << endl;
        }
        else {
            cout << "Signature is invalid." << endl;
        }
    }
    catch (const Exception& e) {
        cout << "Crypto++ exception: " << e.what() << endl;
    }
    catch (const std::exception& e) {
        cout << "Standard exception: " << e.what() << endl;
    }
    catch (...) {
        cout << "Unknown exception" << endl;
    }
    return 0;
}

4.3、 Base64 编码和解码

#include <iostream>
#include <string>

#include <rsa.h>
#include <osrng.h>
#include <base64.h>
#include <files.h>
#include <pem.h>

using namespace std;
using namespace CryptoPP;

class Base64 {
public:
    static std::string encode(const std::string& data) {
        std::string encoded;
        CryptoPP::Base64Encoder encoder;
        encoder.Attach(new CryptoPP::StringSink(encoded));
        encoder.Put((const byte*)data.data(), data.size());
        encoder.MessageEnd();
        return encoded;
    }

    static std::string decode(const std::string& encoded) {
        std::string decoded;
        CryptoPP::Base64Decoder decoder;
        decoder.Attach(new CryptoPP::StringSink(decoded));
        decoder.Put((const byte*)encoded.data(), encoded.size());
        decoder.MessageEnd();
        return decoded;
    }
};


int main()
{
    try {
        // 原始数据
        std::string data = "Hello, World!";

        // Base64 编码
        std::string encoded = Base64::encode(data);
        std::cout << "Encoded data: " << encoded << std::endl;

        // Base64 解码
        std::string decoded = Base64::decode(encoded);
        std::cout << "Decoded data: " << decoded << std::endl;

    }
    catch (const Exception& e) {
        cout << "Crypto++ exception: " << e.what() << endl;
    }
    catch (const std::exception& e) {
        cout << "Standard exception: " << e.what() << endl;
    }
    catch (...) {
        cout << "Unknown exception" << endl;
    }
    return 0;
}

4.4、AES对称加密

#include <iostream>
#include <string>
#include <aes.h>
#include <modes.h>
#include <filters.h>
#include <hex.h>
#include <osrng.h>

using namespace std;
using namespace CryptoPP;

class AESCipher {
public:
    AESCipher(const string& key, const string& iv) : key(key), iv(iv) {}

    string Encrypt(const string& plainText) {
        string cipherText;
        try {
            CBC_Mode<AES>::Encryption encryptor;
            encryptor.SetKeyWithIV((byte*)key.data(), key.size(), (byte*)iv.data());

            StringSource(plainText, true,
                new StreamTransformationFilter(encryptor,
                    new StringSink(cipherText)
                )
            );
        }
        catch (const Exception& e) {
            cerr << "Encryption error: " << e.what() << endl;
        }
        return cipherText;
    }

    string Decrypt(const string& cipherText) {
        string plainText;
        try {
            CBC_Mode<AES>::Decryption decryptor;
            decryptor.SetKeyWithIV((byte*)key.data(), key.size(), (byte*)iv.data());

            StringSource(cipherText, true,
                new StreamTransformationFilter(decryptor,
                    new StringSink(plainText)
                )
            );
        }
        catch (const Exception& e) {
            cerr << "Decryption error: " << e.what() << endl;
        }
        return plainText;
    }

private:
    string key;
    string iv;
};

int main() {
    // 生成随机的密钥和初始化向量(IV)
    AutoSeededRandomPool rng;
    byte key[AES::DEFAULT_KEYLENGTH];
    byte iv[AES::BLOCKSIZE];
    rng.GenerateBlock(key, sizeof(key));
    rng.GenerateBlock(iv, sizeof(iv));

    string keyStr(reinterpret_cast<char*>(key), sizeof(key));
    string ivStr(reinterpret_cast<char*>(iv), sizeof(iv));

    AESCipher aes(keyStr, ivStr);

    string plainText = "Hello, World!";
    string encryptedText = aes.Encrypt(plainText);
    string decryptedText = aes.Decrypt(encryptedText);

    cout << "Original Text: " << plainText << endl;
    cout << "Encrypted Text: " << encryptedText << endl;
    cout << "Decrypted Text: " << decryptedText << endl;

    return 0;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1858917.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【通用技巧】自动获取日志存放路径,无需手动修改配置文件

我们在部署环境的时候&#xff0c;常常会手动修改一些配置文件的存放地址&#xff0c;比如日志的路径、截图的路径&#xff0c;这是因为我们的环境不一样&#xff0c;部署应用的位置也不一样导致的。如果位置写死了&#xff0c;那么就会造成通用性很差&#xff0c;所以我们经常…

明明设置允许跨域,为什么还会出现跨域请求的问题

一、问题 在微服务项目中&#xff0c;明明已经设置允许跨域访问&#xff1a; 为什么还会出现跨域请求问题&#xff1f; 二、为什么 仔细查看错误提示信息&#xff1a;When allowCredentials is true, allowedOrigins cannot contain the special value "*" since t…

NestJs连接数据库

文章目录 一、下载 MySql 数据库二、下载VsCode插件查询、插入数据 一、下载 MySql 数据库 NestJS连接数据库我选择的是MySql&#xff0c;首先先安装nestjs/typeorm 、typeorm、 mysql2 执行命令&#xff1a; pnpm install nestjs/typeorm typeorm mysql2 -S 连接数据库需要你…

C语言小例程28/100

题目&#xff1a;利用递归方法求5!。 程序分析&#xff1a;递归公式&#xff1a;fnfn_1*4! #include <stdio.h>int main() {int i;int fact(int);for(i0;i<6;i){printf("%d!%d\n",i,fact(i));} } int fact(int j) {int sum;if(j0){sum1;} else {sumj*fac…

震惊!这样制作宣传册,效果竟然如此惊人!

在当今社会&#xff0c;宣传册作为一种重要的宣传手段&#xff0c;其制作质量直接影响到宣传效果。而令人震惊的是&#xff0c;现在有些制作宣传册的方法&#xff0c;其效果竟然如此惊人&#xff01;今天&#xff0c;教大家如何制作宣传册吧&#xff01; 首先&#xff0c;我们要…

南京邮电大学计算机网络实验二(网络路由器配置RIP协议)

文章目录 一、 实验目的和要求二、 实验环境(实验设备)三、 实验步骤四、实验小结&#xff08;包括问题和解决方法、心得体会、意见与建议等&#xff09;五、报告资源 一、 实验目的和要求 掌握思科路由器的运行过程&#xff0c;掌握思科路由器的硬件连线与接口&#xff0c;掌…

【研究】国内外大模型公司进展

2022年11月&#xff0c;OpenAI推出基于GPT-3.5的ChatGPT后&#xff0c;引发全球AI大模型技术开发与投资热潮。AI大模型性能持续快速提升。以衡量LLM的常用评测标准MMLU为例&#xff0c;2021年底全球最先进大模型的MMLU 5-shot得分刚达到60%&#xff0c;2022年底超过70%&#xf…

稀奇古怪的解压视频都哪里找的?6个古怪稀奇解压素材网站分享

在这个信息泛滥的时代&#xff0c;解压视频已经成为我们日常生活中的调味剂。特别是那些奇特而有趣的视频&#xff0c;它们能够立刻抓住我们的眼球&#xff0c;带来独一无二的视觉享受和心理上的放松。但你可能会好奇&#xff0c;这些引人注目的解压视频都可以在哪里找到呢&…

华为eNSP模拟器下载地址

一、依赖程序 VirtualBox&#xff1a;https://cloud.rsecc.cn/softlink/VirtualBox-5.2.26-128414-Win.exe WinPcap&#xff1a;https://cloud.rsecc.cn/softlink/WinPcap_4_1_3.exe Wireshark&#xff1a;https://cloud.rsecc.cn/softlink/Wireshark-win64-3.0.6.exe 需要…

代码随想录-Day38

509. 斐波那契数 斐波那契数 &#xff08;通常用 F(n) 表示&#xff09;形成的序列称为 斐波那契数列 。该数列由 0 和 1 开始&#xff0c;后面的每一项数字都是前面两项数字的和。也就是&#xff1a; F(0) 0&#xff0c;F(1) 1 F(n) F(n - 1) F(n - 2)&#xff0c;其中 …

【Android】我的手机在...自己下载...那个(浅析Intent基础运用)

【Android】我的手机在…自己下载…那个&#xff08;浅析Intent基础运用&#xff09; 在Android开发中&#xff0c;Intent&#xff08;意图&#xff09;是一个非常重要的概念。它不仅仅是用于在应用程序的各个组件之间进行通信的工具&#xff0c;也是启动新的Activity、Servic…

FydeOS导入VMware虚拟机之后,如何扩展系统硬盘大小?

前言​ 最近查询FydeOS系统的小伙伴不在少数啊&#xff01;可见这个系统是相当nice的&#xff0c;小伙伴们都是尝试尝试。 看到有不少小伙伴通过VMware虚拟机使用FydeOS&#xff0c;那么你就肯定知道官方包导入VMware之后&#xff0c;硬盘只显示分区了20GB。 如果这时候使用Fy…

【Java核心技术13】Java中的构造器与析构器:深入解析与代码示例

引言 所有文章均为原创验证&#xff0c;您随手的 关注、点赞、收藏 是我创作最大的动力。 示例代码地址&#xff1a;https://gitee.com/code-in-java/csdn-blog.git 在面向对象编程语言中&#xff0c;构造器和析构器是类生命周期管理的关键部分。构造器负责初始化新创建的对象&…

Java NIO(一) 概述

NIO主要用于以少量线程来管理多个网络连接&#xff0c;处理其上的读写等事件。在大量连接情况下&#xff0c;不管是效率还是空间占用都要优于传统的BIO。 Java NIO 由以下几个核心部分组成&#xff1a; Channel Buffer Selector Selector 如果你的应用打开了多个连接&#x…

Hack The Box-Axlle【更新中】

总体思路 XLL-EXEC->hta反弹shell->重置用户密码->重写二进制文件 信息收集&端口利用 nmap -sSVC axlle.htb开放了一大堆端口&#xff0c;这里先挑重点的80端口和445端口查看 80端口主页只有一个邮箱账号&#xff0c;对其目录扫描和子域名扫描 dirsearch -u h…

Python统计实战:3D散点图绘制

为了解决特定问题而进行的学习是提高效率的最佳途径。这种方法能够使我们专注于最相关的知识和技能&#xff0c;从而更快地掌握解决问题所需的能力。 &#xff08;以下练习题来源于《统计学—基于Python》。联系获取完整数据和Python源代码文件。&#xff09; 练习题 用以下数…

【力扣】从前序与中序遍历序列构造二叉树

&#x1f525;博客主页&#xff1a; 我要成为C领域大神 &#x1f3a5;系列专栏&#xff1a;【C核心编程】 【计算机网络】 【Linux编程】 【操作系统】 ❤️感谢大家点赞&#x1f44d;收藏⭐评论✍️ 本博客致力于分享知识&#xff0c;欢迎大家共同学习和交流。 给定两个整数数…

测评:【ONLYOFFICE】版本更迭与AI加持下的最新ONLYOFFICE桌面编辑器8.1

你是否还在为没有一款合适的在线桌面编辑器而苦恼&#xff1f;你是否还在因为办公软件的选择过少而只能使用WPS或者office&#xff1f;随着办公需求的不断变化和发展&#xff0c;办公软件也在不断更新和改进。ONLYOFFICE 作为一款全功能办公软件&#xff0c;一直致力于为用户提…

视图(views)

自学python如何成为大佬(目录):https://blog.csdn.net/weixin_67859959/article/details/139049996?spm1001.2014.3001.5501 下面通过一个例子讲解在Django项目中定义视图&#xff0c;代码如下&#xff1a; from django.http import HttpResponse # 导入响应对象 impo…

android-aidl4

转&#xff1a;Android Aidl的使用_android aidl使用-CSDN博客 一.准备 Parcelable&#xff0c;可以理解成只是把car整个对象在aidl中进行传递&#xff0c;就理解成一个car的一个类吧&#xff0c;和其他类使用一样就行了&#xff0c;回调&#xff1a;把接口作为参数放在函数参…