public static string AutoKeyCipher(string text, string key, ref string generateKey, ref AutoKeyCipher autoKeyCipher, AutoKeyCipherType autoKeyCipherType, CryptType cryptType)
        {
            string result = string.Empty;
            if (autoKeyCipher == null) autoKeyCipher = new AutoKeyCipher(key, autoKeyCipherType);
            switch (cryptType)
            {
                case CryptType.Encrypt:
                    result = autoKeyCipher.Encrypt(text);
                    generateKey = autoKeyCipher.PrimaryKey;
                    break;
                case CryptType.Decrypt:
                    result = autoKeyCipher.Decrypt(text);
                    generateKey = autoKeyCipher.PrimaryKey;
                    break;
            }

            return result;
        }
 public AutoKeyCipher(string primaryKey, AutoKeyCipherType typeAutoKeyCipher)
 {
     this.PrimaryKey        = primaryKey;
     this.typeAutoKeyCipher = typeAutoKeyCipher;
 }