LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-15-2021, 03:05 AM   #1
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Rep: Reputation: Disabled
Question Aescrypt vs. OpenSSL


Hi, relative novice here.

If distro built-in OpenSSL supports AES encryption, does a tool like https://www.aescrypt.com/ add any benefit?

Also I was warned about using passwords on binary AES-encrypted files in OpenSSL. Is that a technical problem?
 
Old 04-15-2021, 04:02 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,155

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
aescrypt is simpler to use for encrypt/decrypt of single files. openssl is more a Swiss-army knife. There are a lot of wrong ways to use it.

What did you hear about passwords? openssl has multiple ways of generating a key from a password, so it's another thing that can be done wrong with openssl.
 
Old 04-15-2021, 04:50 PM   #3
gouttegd
Member
 
Registered: Nov 2019
Location: London, UK
Distribution: Slackware
Posts: 94

Rep: Reputation: 161Reputation: 161
Quote:
Originally Posted by JASlinux View Post
If distro built-in OpenSSL supports AES encryption, does a tool like https://www.aescrypt.com/ add any benefit?
As noted above, it’s easier to use. But there are a few things with that tool that bother me.

It uses a custom key derivation function, and a pretty weak one by today’s standards (just hashing the password ~8000 times with SHA2-256). It would be better to use PBKDF2 or, even better, something like scrypt or Argon2.

It uses a custom file format, which to my knowledge is supported by no other tool. This means that any file encrypted by AESCrypt can only be decrypted by AESCrypt. The format is described, but the description does not give all the details that would be required to implement a compatible decryptor (for example, one needs to read the actual source code to find out how the key is derived from the password, because the format documentation does not say a word about it). The format is also vulnerable to ciphertext manipulation attacks, something the developer seems to be in no hurry to fix.

And behaviors such as this:

Quote:
Bug: Typing "aescrypt -d -o input_file.aes" (forgetting to enter the actual output filename) will result in deletion of the input file
would finish to convince me not to approach this tool with a barge pole.

If you want to encrypt files, my advice would be to use GnuPG. It’s present in most if not all distributions (many distributions use it as part of their package distribution systems to ensure package integrity). It’s a well-tested tool which uses a well-described and specified standard format (OpenPGP). While it is primarily intended for public-key cryptography, it can also be used for password-based symmetric encryption if that’s what you want.
 
1 members found this post helpful.
Old 04-15-2021, 05:37 PM   #4
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Original Poster
Rep: Reputation: Disabled
second part
OpenSSL has a "-a" switch, which presumably simplifies the character set of the encryption.

I was warned against encrypting a binary, but I don't know what he meant:

a) 'Don't encrypt any binary file, OpenSSL encryption is for text', OR

b) 'Don't create a binary encrypted file, always use the -a switch.'

Which is the accurate intention?... why?

first part
I read you mean OpenSSL is mainly a more complex tool.

Quote:
Originally Posted by smallpond View Post
aescrypt is simpler to use for encrypt/decrypt of single files. openssl is more a Swiss-army knife. There are a lot of wrong ways to use it.

What did you hear about passwords? openssl has multiple ways of generating a key from a password, so it's another thing that can be done wrong with openssl.

Last edited by JASlinux; 04-15-2021 at 05:39 PM. Reason: grammar
 
Old 04-15-2021, 05:49 PM   #5
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gouttegd View Post
If you want to encrypt files, my advice would be to use GnuPG. It’s present in most if not all distributions (many distributions use it as part of their package distribution systems to ensure package integrity). It’s a well-tested tool which uses a well-described and specified standard format (OpenPGP). While it is primarily intended for public-key cryptography, it can also be used for password-based symmetric encryption if that’s what you want.
I approve of GnuPG for messaging.

My interest in comparing the other two tools is for on-the-fly local encryption of individual files, both text and binary.

Here-to-fore I've been using compression archives (.zip, .gz, etc. ), but was turned onto AES and other specifications.

I'm not sure the limits placed on binary encryption.

Compatibility is critical. AES should be AES no matter which tool we're using.
 
Old 04-16-2021, 03:19 AM   #6
gouttegd
Member
 
Registered: Nov 2019
Location: London, UK
Distribution: Slackware
Posts: 94

Rep: Reputation: 161Reputation: 161
Quote:
Originally Posted by JASlinux View Post
Compatibility is critical. AES should be AES no matter which tool we're using.
But the encryption algorithm is but a small part of what you need to take into account if you care about compatibility.

Just because two tools are using AES does not mean they are compatible. Case in point: A file encrypted with openssl enc cannot be decrypted with aescrypt, and a file encrypted with aescrypt cannot be decrypted with openssl enc.

For compatibility to exist, you need the different tools to agree on the way to use the encryption algorithm, the way to derive the encryption key from the password, the way to store the encrypted data on file…

Specifying this kind of details is the role of a standard encryption format, such as OpenPGP. A file encrypted with an OpenPGP-compliant tool can be decrypted by any other OpenPGP-compliant tool. For example, a file encrypted by GnuPG can be decrypted by Sequoia-PGP, or by any application built using a OpenPGP library (rnp, BouncyCastle, OpenPGP.js…).
 
1 members found this post helpful.
Old 04-18-2021, 07:07 AM   #7
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gouttegd View Post
Just because two tools are using AES does not mean they are compatible. Case in point: A file encrypted with openssl enc cannot be decrypted with aescrypt, and a file encrypted with aescrypt cannot be decrypted with openssl enc.
Point seriously acknowledged.
 
  


Reply

Tags
aes, encryption, openssl



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] new openssl 1.1.0 - broken compatibility with openssl 1.0.1 FranekW Linux - Newbie 2 06-26-2018 10:49 AM
Does recursive mutex lock in openssl will affect other openssl users in same system? T.Selvan Linux - Networking 3 02-09-2016 12:59 AM
openssl: any simple examples no how to use openssl to do some decryption? eantoranz Programming 7 07-26-2012 07:57 PM
install of openssl-0.9.8b-8.3.el5 conflicts with file from package openssl-0.9.8b-8.3 jsaravana87 Linux - Server 1 09-26-2011 01:02 PM
oops openssl-0.9.8e over openssl-0.9.8d bad install now 2 copies? rcorkum Slackware 4 06-29-2007 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration