Using the built in crypto classes in .NET can be surprisingly complicated. You need a lot of understanding of what you are doing to get it right and how to work in a secure manner. The choice of algorithm, what cipher mode, key length, block size and understand what salt is and how to use it and also how to hash a password to a proper key are some things you need to deal with. Hopefully, this article will make your life a lot easier.
- private void ImageSearch()
- {
- if (txtSearch.Text.Trim().Equals(""))
- {
-
- txtSearch.Focus();
- Warning.Text = "Please enter the keyword to search";
-
- return;
- }
- else
- {
- int check = Process.CheckStopWord(txtSearch.Text.Trim());
-
- if (check == 0)
- {
- txtSearch.Focus();
- Warning.Text = "No stop word found";
- }
- else
- {
- txtSearch.Focus();
- Warning.Text = "Found Stop word";
- }
- }
- }
- public static int CheckStopWord(string keyword)
- {
- string check = "0";
- string query = "SELECT COUNT (stopword) FROM stopwordtb WHERE [stopword] like '" + keyword + "'";
-
- accessDB dbaccess = new accessDB();
- DataSet ds = dbaccess.queryData(query);
- DataTable dt = ds.Tables[0];
- if (dt.Rows[0][0].ToString() == check)
- {
- return 0;
-
-
- }
- else
- {
- return 1;
-
- }
- }