Beispiel #1
0
            /// <summary>
            /// The Encryption method.
            /// </summary>
            /// <param name="plainText">The string to encrypt.</param>
            /// <param name="password">The password.</param>
            /// <returns>The encrypted string.</returns>
            public string EncryptString(string plainText, string password)
            {
                // 3Rijndael
                RijndaelProvider rp  = RijndaelProvider.Instance;
                string           rp1 = rp.EncryptString(plainText, password);
                string           rp2 = rp.EncryptString(rp1, password);
                string           rp3 = rp.EncryptString(rp2, password);

                // 3RC2
                RC2Provider rc2   = RC2Provider.Instance;
                string      rc2_1 = rc2.EncryptString(rp3, password);
                string      rc2_2 = rc2.EncryptString(rc2_1, password);
                string      rc2_3 = rc2.EncryptString(rc2_2, password);

                // 3DES
                DESProvider des  = DESProvider.Instance;
                string      des1 = des.EncryptString(rc2_3, password);
                string      des2 = des.EncryptString(des1, password);
                string      des3 = des.EncryptString(des2, password);

                // 3AES
                AESProvider aes  = AESProvider.Instance;
                string      aes1 = aes.EncryptString(des3, password);
                string      aes2 = aes.EncryptString(aes1, password);
                string      aes3 = aes.EncryptString(aes2, password);

                return(aes3);
            }
Beispiel #2
0
        /// <summary>
        /// The Encryption method.
        /// </summary>
        /// <param name="plainText">The string to encrypt.</param>
        /// <param name="password">The password.</param>
        /// <returns>The encrypted string.</returns>
        public ReturnStruct EncryptString(string plainText, string partPassword)
        {
            List <int> ril = new List <int>();
            Random     r   = new Random();

            for (int i = 0; i < 6; i++)
            {
                ril.Add(r.Next(0, 10));
            }

            List <string> sl = NumberConverter.IntCollectionToStringList(ril);

            // 3DES
            DESProvider des  = DESProvider.Instance;
            string      des1 = des.EncryptString(plainText, partPassword + sl[0]);
            string      des2 = des.EncryptString(des1, partPassword + sl[1]);
            string      des3 = des.EncryptString(des2, partPassword + sl[2]);

            // 3AES
            AESProvider aes  = AESProvider.Instance;
            string      aes1 = aes.EncryptString(des3, partPassword + sl[3]);
            string      aes2 = aes.EncryptString(aes1, partPassword + sl[4]);
            string      aes3 = aes.EncryptString(aes2, partPassword + sl[5]);

            ReturnStruct rs = new ReturnStruct();

            rs.Result     = aes3;
            rs.RandomKeys = ril.ToArray();

            return(rs);

            // Use Casts: aes(aes(aes(des(des(des($content))))));
        }
Beispiel #3
0
            /// <summary>
            /// The Encryption method.
            /// </summary>
            /// <param name="plainText">The string to encrypt.</param>
            /// <param name="password">The password.</param>
            /// <returns>The encrypted string.</returns>
            public string EncryptString(string plainText, string password)
            {
                // 3AES
                AESProvider aes  = AESProvider.Instance;
                string      aes1 = aes.EncryptString(plainText, password);
                string      aes2 = aes.EncryptString(aes1, password);
                string      aes3 = aes.EncryptString(aes2, password);

                return(aes3);

                // Use Casts: aes(aes(aes($content)));
            }
Beispiel #4
0
            /// <summary>
            /// The Encryption method.
            /// </summary>
            /// <param name="plainText">The string to encrypt.</param>
            /// <param name="password">The password.</param>
            /// <returns>The encrypted string.</returns>
            public string EncryptString(string plainText, string password)
            {
                // 3RC2
                RC2Provider rc2   = RC2Provider.Instance;
                string      rc2_1 = rc2.EncryptString(plainText, password);
                string      rc2_2 = rc2.EncryptString(rc2_1, password);
                string      rc2_3 = rc2.EncryptString(rc2_2, password);

                // 3DES
                DESProvider des  = DESProvider.Instance;
                string      des1 = des.EncryptString(rc2_3, password);
                string      des2 = des.EncryptString(des1, password);
                string      des3 = des.EncryptString(des2, password);

                // 3AES
                AESProvider aes  = AESProvider.Instance;
                string      aes1 = aes.EncryptString(des3, password);
                string      aes2 = aes.EncryptString(aes1, password);
                string      aes3 = aes.EncryptString(aes2, password);

                return(aes3);

                // Use Casts: rc2(rc2(rc2(aes(aes(aes(des(des(des($content)))))))));
            }