Contents
Is CBC encryption safe?
Microsoft believes that it’s no longer safe to decrypt data encrypted with the Cipher-Block-Chaining (CBC) mode of symmetric encryption when verifiable padding has been applied without first ensuring the integrity of the ciphertext, except for very specific circumstances.
Is OpenSSL encryption secure?
OpenSSL is a library which has implementations for a variety of cryptographic algorithms, both for strong and for weak algorithms. Thus, the security first depends on which algorithm you use. You are trying to use symmetric encryption where the same key is needed for encryption and decryption.
Why is using the CBC mode a good way to encrypt a long message?
CBC has the advantage over the ECB mode in that the XORing process hides plaintext patterns. Even if the first plaintext block and third plaintext block were the exact same segment of plaintext, it is highly unlikely that the first ciphertext block and third ciphertext block would be the same.
How to derive an AES key from OpenSSL?
As mentioned in the other answers, previous versions of openssl used a weak key derivation function to derive an AES encryption key from the password.
What should I use instead of OpenSSL for encryption?
Security Warning: AES-256-CBC does not provide authenticated encryption and is vulnerable to padding oracle attacks. You should use something like age instead. You likely want to use gpg instead of openssl so see “Additional Notes” at the end of this answer.
Is it safe to use OpenSSL default key derivation?
For details, see the openssl (1) docs. DO NOT USE OPENSSL DEFAULT KEY DERIVATION. Currently the accepted answer makes use of it and it’s no longer recommended and secure. It is very feasible for an attacker to simply brute force the key. PBKDF1 applies a hash function, which shall be MD2 [6], MD5 [19] or SHA-1 [18], to derive keys.
What’s the difference between GPG and OpenSSL encryption?
Though you have specifically asked about OpenSSL you might want to consider using GPG instead for the purpose of encryption based on this article OpenSSL vs GPG for encrypting off-site backups? To use GPG to do the same you would use the following commands: Note: You will be prompted for a password when encrypting or decrypt.