|
||||||
Improving Internet Account Password SecurityHow to Reduce the Chances of Criminals Obtaining PasswordsThe steps required to improve Internet account security are simple, and secure passwords can be generated with an easy piece of programming. Safer than the cat's name
The Daily Telegraph has reported that there is a security risk as people use same password on all websites. They say that:
It is, therefore, no surprise that criminals are having a field day:
The answers are, of course, very simple:
However, as the Daily Telegraph article points out, most people find numerous passwords difficult to remember. And this is where the programmer can step in to say "We can help". They can help by:
In that way the user can use individual passwords for each web site but only needs to remember one. And so the first part of such a project is to generate a random password. The Makeup of a Random PasswordA typical password will consist of a mixture of:
And all of this can be used by using the random number generators built into many programming languages. Generating a Random NumberVBScript (or Visual Basic Script) is a programming language built into Microsoft Windows and is therefore useful in creating programming examples. It can also be used to generate a random number lying within a range of numbers: function generate_random_number (min, max)
randomize
generate_random_number = Int((max - min + 1) * Rnd + min)
end function
It's worth noting that no number is truly random. A random number is always generated by using a set formula and always uses another number as its seed. The randomize statement sets this seed to the system timer. The function can then be used to generate a random number between 0 and 9: function random_number
random_number = generate_random_number (0, 9)
end function
And then this can be used to generate a sequence of random numbers: function generate_sequence (numb_chars)
Dim n, x
for n = 1 to numb_chars
x = x & random_number
next
generate_sequence = x
end function
It's now a simple matter of asking the user for the length of the password and providing them with a number of random sequences: Dim n, numb_letters
Wscript.StdOut.Write "Enter number of characters: "
numb_letters = Wscript.StdIn.ReadLine
for n = 1 to 10
Wscript.Echo generate_sequence (numb_letters)
next
The result of running this code can be seen in figure 1 at the bottom of this article. However, that's only part of the solution. The password requires letters as well. Generating a Random LetterASCII stands for American Standard Code for Information Interchange and is an internationally accepted numerical code for both printed characters (such as a,1, * and #) and non-printed characters (such as tabs and carriage returns) so that:
These can be used with the random number generator to produce random letters: function random_uc_letter
random_uc_letter = chr(generate_random_number (65, 90))
end function
function random_lc_letter
random_lc_letter = chr(generate_random_number (97, 122))
end function
Here the chr function returns a character derived from the random number. And then the final step is to amend the generate_sequence function so that it randomly produces a number, an uppercase letter or a lowercase letter: function generate_sequence (numb_chars)
Dim n, x, r
for n = 1 to numb_chars
r = generate_random_number (1, 3)
select case r
case 1
x = x & random_number
case 2
x = x & random_uc_letter
case 3
x = x & random_lc_letter
end select
next
generate_sequence = x
end function
The new results can be seen in figure 2, and these show that each time the generate_sequence is called the script returns a random string consisting of numbers and lowercase or uppercase letters. The programmer can then carry out the relatively simple task of saving these in a password protected database (for example) and then displaying then to the user as required. The user then just has to remember the password to the database and not all of the different passwords for the web pages, safeguarding their accounts and reducing the chances of infiltration by any criminal elements. BNC101
The copyright of the article Improving Internet Account Password Security in Computer Programming Tutorials is owned by Mark Alexander Bain. Permission to republish Improving Internet Account Password Security in print or online must be granted by the author in writing.
|
||||||
|
|
||||||
|
|
||||||