title: Encrypting in Angular and Decrypt on C#
body: <p>I am having the code to encrypt data on Angular,
  But I don't know how to decrypt on server side</p>
  
  <pre><code>  var panno = CryptoJS.AES.encrypt("FEAPS8905Q", "myPassword").toString();
  </code></pre>
  
  <p>Encrypted as <code>U2FsdGVkX19mi5mXlJ14Lj0XcJBbqMPDzi/UeNXK4Cw=</code>in angular,
  after sending the encrypted using Http.post method, I am not getting the exact data, instead, getting <code>楀뢖᷈鍩ԏ건뫨샞일䜍钚䁞</code></p>
  
  <p>I used this reference also <a href="https://www.codeproject.com/Articles/5719/Simple-encrypting-and-decrypting-data-in-C" rel="nofollow noreferrer">Decrypting on C#</a>, but I am getting some data like  <code>壓섢⻫捼笺ﵑ戛ꔉ됒퍿誁累♟꘶콒ꚦ</code></p>
  
  <pre><code>public string Decrypt(string cipherText)
      {
          string EncryptionKey = "myPassword";
          cipherText = cipherText.Replace(" ", "+");
          byte[] cipherBytes = Convert.FromBase64String(cipherText);
          using (Aes encryptor = Aes.Create())
          {
              Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] {  
              0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76  });
              encryptor.Key = pdb.GetBytes(32);
              encryptor.Padding = PaddingMode.None;
              encryptor.IV = pdb.GetBytes(16);
              using (MemoryStream ms = new MemoryStream())
              {
                  using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write))
                  {
                      cs.Write(cipherBytes, 0, cipherBytes.Length);
                      cs.Close();
                  }
                  cipherText = Encoding.Unicode.GetString(ms.ToArray());
              }
          }
          return cipherText;
      }
  </code></pre>