title: How to encrypt plaintext with AES-256 CBC in PHP using OpenSSL?
body: <p>I am trying to encrypt sensitive user data like personal messages in my php powered website before entering into the database. I have researched a bit on the internet and I have found the few important things to remember:</p>
  
  <ol>
  <li><p>Never use mcrypt, it's abandonware.</p></li>
  <li><p>AES is based on the Rijndael algorithm and has been unbroken till now.</p></li>
  <li><p>AES has also been recommended by NSA and used in US Government data encryption, but since the NSA is recommending it, there's a chance they might sneak upon my user data easily. </p></li>
  <li><p>Blowfish has been unbroken as well, but slow and less popular.</p></li>
  </ol>
  
  <p>So, I decided I will give it a try first with AES-256 cbc. But I am still not sure if I should not consider Blowfish a better option. So any recommendations are welcome.</p>
  
  <p>And my primary concern is, how to encrypt the data in php? I don't find a good manual about this in the php documentation. What is the correct way to implement it?</p>
  
  <p>Any help is heavily appreciated.</p>