Monthly Archives: July 2015

A few tips for security in .NET framework

Hello everybody, I am back with another good article for covering security in .NET framework for passwords of users. Although I was very much disappointed by the articles and resources published previously by many editors and authors. So I thought I must publish an article that covers all of the parts, that a good article needs.

I wrote an article for C# Corner community specifically, titled as: Efficiently Storing Passwords in .NET Framework. In that article I have discussed a lot of points and topics that a reader is trying to get in an article about Cryptography. A few major points are:

  1. What is cryptography? Why protect the passwords?
  2. How password should be protected?
  3. What algorithms are there to protect my password.
  4. Which of those algorithms are out-dated and which are expensive for my company?
  5. Where would the algorithms in .NET framework work.

And many more similar things are discussed there. Another major thing to understand is the usage of Salt. A salt is a random string generated to prevent password cracking attacks, such as Rainbow Table attack, Dictionary attack and many more. Salt just prevents any of them from happening.

Hashing, is an algorithm function that generates a random alphanumeric string for a password that is impossible to convert back to plain-text password, easily. Note the term, “easily”. Although a hash algorithm is designed to never run backward, still computer can run such algorithms that can get the password string back or at least try as much combinations to get the same hash value!

You should read the article from C# Corner, and learn how to protect passwords and other sensitive data in .NET framework.

Efficiently Storing Passwords in .NET Framework

Formatting and working with Date objects in JavaScript

Recently I have posted a new article on C# Corner about date objects in JavaScript. I have always found more questions from beginners about Date objects in JavaScript, as compared to questions for Date objects in a server-side language.

Date object in JavaScript has many things that cause it to lag behind Date objects in server-side languages. Or maybe, it is true to say that JavaScript doesn’t need to be provided with enough tools as a server-side programming language must have. Date object in, for example, C# has many members and functions that allow us to work around with the date in a very compact and easy way. For example, finding the age of a user by his age is as simple as,

var age = (DateTime.Now - dateOfBirth).TotalDays / 365.25; // Might require a cast

This, would give you the answer for age. For example if dateOfBirth holds my date of birth it would provide me with 19 as an answer. However, doing the same doesn’t work in JavaScript. Similarly, there is a function getMonth in JavaScript’s Date object. Which provides you with (zero based) Number for the month; starting with January at zero. So, to write the dates in a formatted way you would again need to use some other function to get the month’s name in string.

I have written an article on C# Corner, that covers these two topics. You can read the article at, Calculating and Formatting Date in JavaScript (I think, the title would have been, “Formatting the Date and Calculating age in JavaScript“, well authors don’t follow my words).

  1. Formatting date in JavaScript.
  2. Calculating the age of user in JavaScript.

Read the article, provide with feedback and share it. 🙂

Five steps rule!

I was just working around a simple algorithm to create good forms that can be used for Desktop, mobile or web applications. Although this is not a very general one but a specific one for developers only — Developers are requested to contact UI and UX designers while working around. You will find this Five steps rule helpful in most scenarios. 🙂



The above image demonstrates the rule for you. I would try to explain them in a form they are meant to be explained.

  1. First of all you need to make a list of questions or items you need feedback in form of. This is the most important part of a form. If your feedback form doesn’t even provide you with enough details and answers, or if you have to create more than one form for one subject. Then it is not very much good enough.
  2. Mostly, feedback or reports are generated by software itself; logging. Software would generate everything itself. But in some scenarios you have to ask user to provide some input. In such cases you have to generate UI for him. In such scenarios, you are required to create a UI in a very compact, yet efficient manner. I have also explained this stage in a box above. Read it.
  3. You must not refrain from your UX rules. The controls and theme that you chose for your feedback pages must conform to UX and UI guidelines for your application. You should always consider testing your application for good UI and UX standards.
  4. Next stage is somewhat optional that is why it is being added as a catalyst only. Mostly targeted audience is same throughout application cycle. But, you should always consider this stage if your application has to worry about globalization and language or other requirements. But if your application doesn’t consider such changes then you don’t have to work on this stage.
  5. Final stage is the output.

To get good reports forms, you should always consider focusing on Step 1, 2 and 3 only. Making a change in Step 2 only would ensure that your application has a great form of reports page. You should always try to work around with UI and UX team to get suggestions for layout of controls and how should they be in order to get good UX and UI standards for your application.