18 votes
Accepted

How can I encrypt / decrypt AES-256 CBC with OpenSSL?

Prepare input text: echo "We're blown. Run" >input.txt Encrypt: openssl enc -aes-256-cbc -nosalt -e \ -in input.txt -out input.txt.enc \ -K '2222233333232323' -iv '...
SergA's user avatar
  • 336
16 votes
Accepted

Does AES 256 GCM have any restricted byte sequences imposed on its cypher text?

Except for some special (and very rare) 'format-preserving' modes, all modern encryption algorithms, including AES-GCM, can handle any byte sequence in plaintext and produce any byte sequence as ...
dave_thompson_085's user avatar
11 votes

Is it better to use Bitlocker or the built-in-drive-encryption that my SSD offers?

Old question, but since then several new developments have been found concerning Bitlocker and drive encryption (used either alone or in combination), so I will turn couple of my comments on the page ...
DocWeird's user avatar
  • 1,294
10 votes

Does AES 256 GCM have any restricted byte sequences imposed on its cypher text?

Any block cipher that can encrypt arbitrary binary data must be able to produce all byte sequences in its output, or its output must be larger than its input for at least some inputs. But AES-GCM ...
Peter Cordes's user avatar
  • 5,920
8 votes
Accepted

How to check AES speed on Ubuntu?

While it's not listed in the man page of openssl speed, it can still measure aes speed (on my machine at least). Running openssl speed {some random value} will print an error message that includes the ...
user2313067's user avatar
  • 2,515
7 votes
Accepted

LibreSSL aes encryption incompatible with OpenSSL?

Found the solution, posting here in case it helps anyone else facing the same problem. Apparently, in a later version of OpenSSL (later LibreSSL) the default hashing algorithm for key derivation was ...
RocketNuts's user avatar
  • 1,122
7 votes

How to encrypt txt files with AES256 via Windows 7z command line?

To make the answer simple just use the switch -p which means Set Password with the default encryption which is AES. The example below will encrypt the file or folder and prompt for a password: 7z a -...
Jason Swartz's user avatar
6 votes
Accepted

Unable to decrypt AES with OpenSSL

Because openssl uses PKCS#7 padding by default, and your plaintext doesn't contain PKCS#7 padding. If your plaintext has been padded then it has been padded with bytes of value 5F. Use the option -...
Maarten Bodewes's user avatar
4 votes
Accepted

Upgrading from loop-aes to cryptsetup

For those who landed on this page with the same problem, do the following: cryptsetup open _path_to_file_or_device_ SOME_NAME --type plain -c aes -s 128 -h sha256 mount /dev/mapper/SOME_NAME /...
VanagaS's user avatar
  • 171
4 votes
Accepted

Equivalent hashcat commands for a openssl-enc command?

So what you need to be aware of here is that this is not a simple "brute-force MD5" operation. Instead, the general brute-force process would have to be: Generate input "password" ...
Bob's user avatar
  • 61.7k
3 votes

Unable to decrypt AES with OpenSSL

Well, you might want to consider using python or any other scripting/programming language to do such things. The advantages of doing it programmatically are: Whenever you'll need to redo something ...
Lery's user avatar
  • 231
2 votes

HMAC GCM failure

IPsec doesn't allow you to do both GCM and ESP-SHA256-HMAC on the same SA. If you're configuring GCM - an authenticated cipher, you have no need to do HMAC. The authentication tag of GCM already ...
poncho's user avatar
  • 121
2 votes

Unable to decrypt AES with OpenSSL

decode base64 by echo 8LBUVZfDfI6wnggG1uUYuQsRoGd08pGwHCN++R5rabMW9PJmWHWcSrjy5Tfffj6L | base64 -D > aesdata.dat (the -D is a mac OS quirk. Linux tends to use -d or --decode instead). Similarly:...
Henno's user avatar
  • 669
2 votes
Accepted

What is the default encryption key-size for dm-crypt / cryptsetup in LUKS mode?

Neither. The default is equivalent to issuing --key-size 256 as this refers to the key data handled by cryptsetup itself, but because XTS-AES requires two independent AES keys (one for the data and ...
u1686_grawity's user avatar
2 votes

OpenSSL performance test on a specific file

For a specific size, this is possible using the -bytes size argument simply: $ openssl speed -bytes $(ls -l picture.jpg | cut -d " " -f5) aes-128-cbc des md5 Doing md5 for 3s on 1023 size blocks: ...
Lery's user avatar
  • 231
2 votes
Accepted

UEFI Encrypt disk on boot

In general, having the system firmware handle decryption of the disk is tricky. At some point, the operating system takes over handling the processing of data from the drive, and it will ...
bk2204's user avatar
  • 2,626
1 vote

Generate symmetric key in openssl

You can use this answer as reference. The command is: openssl rand -hex 16
Romeo Ninov's user avatar
  • 6,305
1 vote

How is the IV embedded in an encrypted file when you do not indicate it?

The key and IV are both calculated from the password using a PBKDF. In the case of OpenSSL the method used is EVP_BytesToKey. This is a function akin to PBKDF1 which doesn't use many iterations. The ...
Maarten Bodewes's user avatar
1 vote

Decrypt video encrypted with FFmpeg cenc-aes-ctr using other non-FFmpeg tool

GPAC project support cenc-aes-ctr enc./dec. and probably also cbc too. It may be what you're looking for: MP4Box -crypt drm_file.xml movie.mp4 -out movie_encrypted.mp4 MP4Box -decrypt drm_file.xml ...
the kamilz's user avatar
1 vote
Accepted

Aes256-cbc encoding/decrypting error

There are multiple ways to represent such characters as bytes – e.g. the letter "š" becomes {c5 a1} when encoded using UTF-8 (which JavaScript uses), but it could also be {f0} in ISO-8859-13 or ...
u1686_grawity's user avatar
1 vote

How to encrypt txt files with AES256 via Windows 7z command line?

7za u -mx -mhe -pPASSWORD ARCHIVE-FILE-NAME.7Z SOURCE-FILE-SPEC Any time you use the .7z format, the file is AES-256 encrypted. Arguments explained: -pPASSWORD: setting the password PASSWORD. u: ...
K7AAY's user avatar
  • 9,633
1 vote

OpenSSL gives "iv undefined" for AES-256-ECB

It is as it says you did not define the iv Try like this: -iv 0 openssl enc -aes-128-cbc -e -in test.txt -out output.txt -K 1234567812346578 -iv 0 -p
Geomorillo's user avatar
1 vote

Script for using AesCrypt on a lot of files

I'm not quite sure you can use pure bash to encrypt. I'm sure it's possible, but I can offer another solution for you. Bash Solution: openssl enc -nosalt -aes-128-cbc -in test -out test.enc -p ...
Christian's user avatar
  • 144
1 vote

Is it possible to encrypt a file when adding it to an old zipped folder with 7zip?

Right-Click on file you want to add to open context menu 7zip--> add to archive.. Select the archive you want to add your file to Select Encryption, enter a password Click Ok I got this from a ...
Benedict Schnitzler's user avatar
1 vote

Is it possible to encrypt a file when adding it to an old zipped folder with 7zip?

So, after a bit of experimentation I found a work around. If anybody here is having the same problem I was then this is how to fix it: First extract your archives (a pain, but you'll only do this ...
user71416's user avatar
  • 173
1 vote

Is it better to use Bitlocker or the built-in-drive-encryption that my SSD offers?

I'v been doing some research on this and have a half complete answer for you. It is always better to use hardware based encryption on a self encrypting drive, if you use the software based ...
colin's user avatar
  • 27

Only top scored, non community-wiki answers of a minimum length are eligible