How to do encryption using AES in Openssl

后端 未结 4 1572
野趣味
野趣味 2020-12-02 07:28

I am trying to write a sample program to do AES encryption using Openssl. I tried going through Openssl documentation( it\'s a pain), could not figure out much. I went throu

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 07:53

    My suggestion is to run

    openssl enc -aes-256-cbc -in plain.txt -out encrypted.bin
    

    under debugger and see what exactly what it is doing. openssl.c is the only real tutorial/getting started/reference guide OpenSSL has. All other documentation is just an API reference.

    U1: My guess is that you are not setting some other required options, like mode of operation (padding).

    U2: this is probably a duplicate of this question: AES CTR 256 Encryption Mode of operation on OpenSSL and answers there will likely help.

提交回复
热议问题