title: AES 128 Encryption for a String and generating Binary return in Swift
body: <p>I have a string of data that I want to encrypt in AES 128 and the encrypted data should be in binary. I have tried using CryptoSwith to do so. But the issue I am getting is that the encryption code that I found from an online help converts in into HexString. I tried looking for the conversion to binary but couldn't find a working solution. The code I am using is below :</p>
  
  <pre><code>func encrypt(data: String) -&gt; String?  {
          if let aes = try? AES(key: "0101010101010101", iv: "0000000000000000"),
              let encrypted = try? aes.encrypt(Array(data.utf8)) {
              return encrypted.toHexString()
          }
          return 
      }
  </code></pre>
  
  <p>Would really appreciate the help.</p>