Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenSSL Authenticated Encryption

I'm trying to use OpenSSL for authenticated encryption. Specifically, I'm trying to use AES-256-GCM (or CCM).

However, when I run openssl list-cipher-commands, I don't see it. The only AES ciphers shown are these:

aes-128-cbc
aes-128-ecb
aes-192-cbc
aes-192-ecb
aes-256-cbc
aes-256-ecb

I'm on openssl 1.0.1e, so it should be supported.

like image 644
LanguagesNamedAfterCofee Avatar asked Aug 08 '13 03:08

LanguagesNamedAfterCofee


People also ask

Does OpenSSL support AES-GCM?

If you don't mind writing your own software, there are plenty of crypto libraries supporting AES-GCM, such as OpenSSL itself (even if not available from the command line tool).

Does OpenSSL use AES?

Encrypting: OpenSSL Command Line To encrypt a plaintext using AES with OpenSSL, the enc command is used. The following command will prompt you for a password, encrypt a file called plaintext. txt and Base64 encode the output. The output will be written to standard out (the console).

What does EVP mean in OpenSSL?

That's right - the EVP_* functions are "envelope encryption".

Is OpenSSL used for encryption?

There is an open source program that I find online it uses openssl to encrypt and decrypt files. It does this with a single password. The great thing about this open source script is that it deletes the original unencrypted file by shredding the file.


1 Answers

OpenSSL supports aes-256-gcm as an algorithm, but it does not support aes-256-gcm as a command tool. The difference is that you can enter openssl aes-256-cbc in the command line to encrypt something. On the other hand, there are no such openssl aes-256-gcm command line tool.

You can use the EVP interface to call aes-256-gcm algorithm, as this answer shows.

By the way, you may try to use openssl enc aes-256-gcm in the command line. That does not work either, because no additional authenticated data will be handled by the enc command. See more information here.

like image 192
onemouth Avatar answered Sep 30 '22 22:09

onemouth