Passwords

advertisement
Hiding Information + Keeping Secrets = Security
Background
Often in Computing we need to hide information, for example our passwords. Also, we may want to share
our secrets with friends, but only with friends. In this activity we will explore these ideas. First we shall
think about passwords. How do we choose our passwords? Also how does a computer hide our passwords so
they are hard to guess? Finally we shall see how to put a secret message into an image, which you can send
to a friend who will be able to read your message.
Passwords
Choosing a Password
How do you choose a new password? Let’s find out! Choose a new password to
join a new discussion group. Write down your new password below
Your New Password:
Now let’s see how your classmates chose their passwords. Perhaps several
themes emerged. Note these down as we chat:
Hiding a Password –
Encryption
When you type in your password it is encrypted on the computer. That means
that the characters you have chosen are changed to other characters which are
stored on the computer. So, for example, if your password was missford this
could be encrypted as bellring. The password is changed using a key which
instructs the computer how to change each character. Let’s have a look at how
this works.
Now run the application EncryptDecrypt which is in the folder Passwords on
the pen drive.
You will be asked to enter your password. It must be in lower case with no
numbers. Just for fun, type in missford. Then you will be asked for your key.
Type in 1. Look at the encrypted password and compare it with missford. Can
you see how each character has changed? Hint: What has happened to the ‘m’?
What has happened to the ‘s’? Write down what you have found. If you can’t get
it, then try again with a password bbccdd with a key of 1 and see what you get.
Your findings:
Now let’s see how to encrypt a message to send to your friend and only your
friend. Use the same application EncryptDecrypt and input a password, but
choose any number between 1 and 25 for the key.
Give the encrypted password and the key to your friend. Ask your friend to run
the application Decrypt which is in the Passwords folder. Your friend should
enter the encrypted password and the key to recover your password.
Now give the encrypted password but not the key to someone else. Ask them to
run the application Decrypt which is in the Passwords folder. They should enter
the encrypted password but they don’t have the key, so they have to guess it.
How many tries does it take to decrypt your password?
Make some notes on what happened.
Password Cracking.
One way of breaking into your account which is protected by a password is to
get a computer program to try all possible combinations of letters to guess your
password. This approach will eventually find your password and crack your
account  but the question is how long does this take? Let’s explore this.
Here you will be asked to run the application PasswordCracker which you can
find in the Passwords folder on your pen drive. You will be asked to type in a
password consisting of either 1 or 2 or 3 or 4 or 5 or 6 or 7 characters and the
program will crack your password. It will tell you how long it took to do that in
seconds. This idea is to discover how long it takes to crack a password of
different lengths. Off we go.
Run the application PasswordCracker and type in a password of four
characters (eg “nice”). Note down how long it takes to crack your password in
seconds. Repeat this three times. Write your results in the table below.
Now repeat this for a password of five characters, and write down your results in
the table. (Remember to repeat three times) Now do this this for a password of
one, two, three, six and seven characters and complete the table (repeating three
times for each length).
Table of Results:
Characters
1
2
3
4
5
6
7
Times
Look at your results. What do they tell you? Do you understand why you should
choose a long password? Write down your thoughts.
Steganography – Hiding messages in an Image
What is an Image?
You know that an image is a grid of pixels where each pixel has a colour. If all
the pixels had colour blue then you would be looking at water, mmm. But what
is a pixel’s colour really? Well it’s a number. The number tells you the colour.
But when you write some words into a document, eg missford, then how does
the computer store these words? Well they are numbers! So we now know that
images and text are all numbers inside the computer. So, perhaps we could
change some of the image numbers into word numbers, and so hide our words
within an image? That’s what we are going to do now. Here is an image which I
guess you will know:
Let’s hide a secret message in this image.
Go to the folder Passwords on your pen drive and look for the image
DrWho1.bmp. Open it up in an image editor (eg Photoshop) to check it really
is and image. Exit.
Now, right-click on the image and open it using Notepad++. You will see a load
of gobbly-gook, since you are looking at the image numbers as text numbers.
Some text is highlighted in black. Keep away from this !!. Find an area of grey
text. You will have to scroll down a lot. On your keyboard hit the “insert” key
and type in a short message in a grey text area, to overwrite what you see. Do
not use backspace to correct! Then hit the “insert” key when you are done, and
save your file with a new name such as DrWho2.bmp. NB Make sure you give
the file the extension .bmp.
Now open up your new image in Photoshop to confirm it really is an image.
Exit.
Finally, open up your new image using Notepad++ and look for your hidden
message.
So you now know how to hide text in images, and you can share your secrets
with your friends.
Download