Ejemplo n.º 1
0
        /// <summary>
        /// Return
        /// </summary>
        /// <returns></returns>
        public static string GetAesKeyAndIv(string aesKey, string aesIv)
        {
            RijndaelManaged aesAlg = new RijndaelManaged {
                IV = RsaService.Decrypt(Convert.FromBase64String(aesIv)), Key = RsaService.Decrypt(Convert.FromBase64String(aesKey))
            };

            return(Convert.ToBase64String(aesAlg.Key) + "$" + Convert.ToBase64String(aesAlg.IV));
        }
Ejemplo n.º 2
0
        private static ICryptoTransform GetAesDecryptor(string aesKey, string aesIv)
        {
            RijndaelManaged aesAlg = new RijndaelManaged {
                IV = RsaService.Decrypt(Convert.FromBase64String(aesIv)), Key = RsaService.Decrypt(Convert.FromBase64String(aesKey))
            };

            return(aesAlg.CreateDecryptor());
        }