title: What's the shell command to encrypt a text on aes-128-cbc correctly?
body: <p>I think it's probably openssl, but I just cannot get the correct parameters.</p>
  <p>For example, I can get the correct output by this online tool</p>
  <p><a href="https://www.devglan.com/online-tools/aes-encryption-decryption" rel="nofollow noreferrer">https://www.devglan.com/online-tools/aes-encryption-decryption</a>, <a href="https://i.stack.imgur.com/1mMJS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1mMJS.png" alt="enter image description here" /></a></p>
  <p>The output is correct as I expect, but by commands:</p>
  <pre><code># echo -n &quot;abcd&quot; |openssl enc -aes-128-cbc -K EEEEEEEEEEEEEEEE -iv FFFFFFFFFFFFFFFF -nopad | xxd
  bad decrypt
  139769171543968:error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:data not multiple of block length:evp_enc.c:479:
  
  # echo -n &quot;abcd&quot; |openssl enc -aes-128-cbc -K EEEEEEEEEEEEEEEE -iv FFFFFFFFFFFFFFFF | xxd
  0000000: 37fa 2274 4251 cd91 66ad 761c a7ed bbc5  7.&quot;tBQ..f.v.....
  
  # echo -n &quot;abcd&quot; |openssl enc -aes-128-cbc -K EEEEEEEEEEEEEEEE -iv FFFFFFFFFFFFFFFF
  7ú&quot;tBQ͑f­v§í»År
  </code></pre>
  <p>I cannot get the same output, so would you help to provide a shell command(openssl preferred) which can give the same output?</p>
  <p><strong>Update:</strong></p>
  <p>Thanks to Bob's answer, I can get the encryption command, but what's the decryption command to get &quot;abcd&quot;? Below doesn't work:</p>
  <pre><code>echo -n &quot;f72bbb809d7648fa2010a2fb55602185&quot; |openssl enc -aes-128-cbc -d -K 45454545454545454545454545454545 -iv 46464646464646464646464646464646
  bad decrypt
  139672610080672:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:611:
  </code></pre>