title: AES256 encription Without RijndaelManaged in .Net core 1.1
body: <p>I want to do AES256 Encryption in .net core 1.1. RijndaelManaged is not supporting with the .net core 1.1. So I'm using here <code>AES aes = new AES.create()</code></p>
  
  <p>This part of code create the random private key for the encryption</p>
  
  <pre><code>public string GenaratePassPharse()
      {
          RandomNumberGenerator rngCryptoServiceProvider = RandomNumberGenerator.Create();
          byte[] randomBytes = new byte[KEY_SIZE];
          rngCryptoServiceProvider.GetBytes(randomBytes);
          string plainPassPharse = Convert.ToBase64String(randomBytes);
  
          return plainPassPharse;
      }
  </code></pre>
  
  <p>and here the AES() encryption method. What I want to do is pass my generated key (which is return from above method)instead of the <code>aesAlg.Key</code> as an encryption key. </p>
  
  <pre><code> static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
      {
          // Check arguments.
          if (plainText == null || plainText.Length &lt;= 0)
              throw new ArgumentNullException("plainText");
          if (Key == null || Key.Length &lt;= 0)
              throw new ArgumentNullException("Key");
          if (IV == null || IV.Length &lt;= 0)
              throw new ArgumentNullException("IV");
          byte[] encrypted;
  
          // Create an Aes object
          // with the specified key and IV.
          using (Aes aesAlg = Aes.Create())
          {
              aesAlg.Key = Key;
              aesAlg.IV = IV;
              aesAlg.BlockSize = 128;
              aesAlg.KeySize = 128;
  
  
  
              // Create an encryptor to perform the stream transform.
              ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
  
              // Create the streams used for encryption.
              using (MemoryStream msEncrypt = new MemoryStream())
              {
                  using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
                  {
                      using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))
                      {
                          //Write all data to the stream.
                          swEncrypt.Write(plainText);
                      }
                      encrypted = msEncrypt.ToArray();
                  }
              }
          }
  
  
          // Return the encrypted bytes from the memory stream.
          return encrypted;
  
      }
  </code></pre>
  
  <p>And any another way to use AES256 Encryption algorithms?</p>