An answer about AES encryption starts with a disclaimer:
Please note: You can use this to hide birthday-gift-ideas.txt from your roommate, but don't expect it to be secure against a determined attacker!
What exactly makes it unsafe to use to prevent unauthorized person from reading the file?
I suppose that this comment to the answer is relevant, but I'm not sure I have the required skills to understand it, neither do I know what else should I do to make the encryption secure:
-1 For recommending low-level OpenSSL use. It does not provide any HMAC functionality and as @Lekensteyn points out, it lacks proper KDF.
In other words:
If I have a strong password generated by running
cat /dev/urandom | tr -dc a-fA-Z0-9 | head -c 45
,And one would assume the password is kept secure,
how do I encrypt a file while being sure that a determined attacker won't be able to decrypt it?
Here's a concrete example. I'm doing off-site backups on a cloud server. Before being uploaded, the backup files are encrypted locally using a password generated from /dev/urandom
, and the password is never stored on the cloud server. Is openssl aes-256-cbc -in ... -out ... -pass file:1.key
inappropriate to prevent someone from the company hosting the cloud server to peek in the contents of the backup?