Tuesday, 20 August 2013

How do i generate a random password using the UTF 16 characters in java?

How do i generate a random password using the UTF 16 characters in java?

ou have been hired as a system administrator for the computing lab of a
major university, and being a diligent admin, you have noticed that many
users set extremely weak passwords. This has led to many accounts in the
computing lab being compromised by hackers. You are determined to fix
this, and you write a program that will generate good passwords for users.
One approach is to generate random strings as passwords. So, you are asked
to write a Java program that takes as input the length of the password –
at least 6 characters in length – and generates a totally random string of
the specified length. Given that we are interested in multi-lingual
support, this translates to generating a Unicode string of the specified
length, consisting of a sequence of random UTF-16 characters. Write a Java
program that accomplishes this task, and a test to make sure a) the
program is generating random strings, and b) a valid UTF-16 character set
is being used – not just ASCII or some subset of UTF-16. To make it easy
for you (and for us) the following code template is to be used – do not
change the class name, and the functions listed. You are, of course,
allowed to add more variables/functions if necessary.

No comments:

Post a Comment