Exemple #1
0
        /// <summary>
        ///     Encrypt the result received and retrieve it.
        /// </summary>
        /// <param name="idAlgo"></param>
        /// <param name="result"></param>
        /// <param name="key"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public static string GetEncryptedResultManual(string idAlgo, string result, string key, int size)
        {
            try
            {
                switch (idAlgo)
                {
                case ClassAlgoEnumeration.Rijndael:

                    return(Rijndael.EncryptStringManual(result, key, size));

                case ClassAlgoEnumeration.Xor:
                    break;
                }
            }
            catch (Exception erreur)
            {
#if DEBUG
                Debug.WriteLine("Error Encrypt of " + result + " : " + erreur.Message);
#endif
                return(ClassAlgoErrorEnumeration.AlgoError);
            }

            return(ClassAlgoErrorEnumeration.AlgoError);
        }