コード例 #1
0
        public static string GetLock_L(string password)
        {
            string lock_password = string.Empty;

            foreach (char str in password)
            {
                lock_password = str + RandomStr.NextString(random, 1, false) + lock_password;//倒序
            }
            return(MyAlgorithm.Encode(lock_password));
        }
コード例 #2
0
        public static string GetLock(string password, string ckey)
        {
            string lock_password = string.Empty;

            foreach (char str in password)
            {
                lock_password = str + "." + lock_password;//倒序
            }

            lock_password = RandomStr.NextString(random, 1, false) + lock_password + RandomStr.NextString(random, 1, false);//前后任意添加1位大写字符
            return(MyAlgorithm.Encrypt(lock_password, ckey));
        }
コード例 #3
0
        public static string RealseLock_L(string lock_password)
        {
            string password = string.Empty;
            string get_str  = MyAlgorithm.Decode(lock_password);//得到解密后的字符串
            int    sum      = 0;

            foreach (char str in get_str)
            {
                sum++;
                if (sum % 2 == 0)
                {
                    continue;
                }
                else
                {
                    password = str + password;
                }
            }
            return(password);
        }
コード例 #4
0
        public static string RealseLock(string lock_password, string ckey)
        {
            string password = string.Empty;
            string get_str  = MyAlgorithm.Decrypt(lock_password, ckey);//得到解密后的字符串
            int    count    = get_str.Length - 2;

            get_str = get_str.Substring(1, count);
            foreach (char str in get_str)
            {
                if (str.Equals('.'))
                {
                    continue;
                }
                else
                {
                    password = str + password;
                }
            }
            return(password);
        }
コード例 #5
0
        public static string RealseLock_S(string lock_password, string ckey)
        {
            string password = string.Empty;
            string get_str  = MyAlgorithm.Decrypt(lock_password, ckey);//得到解密后的字符串
            // int count = get_str.Length - 2;
            //  get_str = get_str.Substring(1, count);
            int sum = 0;

            foreach (char str in get_str)
            {
                sum++;
                if (sum % 2 == 0)
                {
                    continue;
                }
                else
                {
                    password = str + password;
                }
            }
            return(password);
        }