Rijndael alternative for Linux

后端 未结 2 1526
清酒与你
清酒与你 2021-01-27 02:12

I have a project in c#, Windows that uses Rijndael object.

I\'m suppoesd to write it in c++,Linux.

I understood that I\'m supposed to use openssl/aes, but couldn

2条回答
  •  梦谈多话
    2021-01-27 02:29

    have a look at cryptopp. They have Rijndael (AES) "raw" and in block modes (CBC etc.). Look at their wiki documentation, they have many code samples.

    It is a popular crypto library, they have also a Windows version, so you can use on both platforms. If you wish to keep your current implementation on Windows, you may want to have your custom wrapper, so that you can choose an underlying implementation on each platform.

    EDIT: a sample from my code

    using namespace CryptoPP;
    
    CBC_Mode< CryptoPP::AES >::Encryption encryptor;
    
    std::string clearText("hello world");
    std::string encrypted;
    
    StringSource( clearText, true,
        new StreamTransformationFilter( encryptor,
            new StringSink( encrypted )
        )
    );
    

提交回复
热议问题