17
Information Hiding & Abstraction Don’t Panic.

Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Embed Size (px)

Citation preview

Page 1: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Information Hiding & Abstraction

Don’t Panic.

Page 2: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Information Hiding

• Not every piece of data is freely available for anyone to view. Consider Government Intelligence – some of this data is critical to keeping the general populous safe.

• With the increase of computerized data flow, how is this information kept safe?

Page 3: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Why is Data Encrypted?

• Personal details may be used for illegal or immoral use

• Data may be sensitive – eg. Bank data, government data, medical data

• Peace of mind – not every unencrypted piece of data is going to be hijacked by terrorists! BUT, knowing your data is safe while it travels the internet gives the user security.

Page 4: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

How is Data Encrypted?

• All official methods of encryption use a ‘standard’ encryption that conforms to a triple 32 bit algorithm, or more recently AES (Advanced Encryption System).

• Data sent using other encryption methods may be treated as suspicious.

• Most Governments hire teams of expert codebreakers to not only deal with suspicious data but to test their own encryption to breakpoint

Page 5: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

The Enigma Machine

In WW2 the Enigma machine was one of the first encryption (and decryption) machines made. In fact, models were made as early as 1920.

It’s theory was simple, swap one letter for another to create a secret message by creating an algorithm to swap letters.

Page 6: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Create The Enigma

• How will your message be encrypted?– Simple letter swap or mathematical swap?

• Draw out how you intend to do this:

– Eg. Where X = letter, L = left, R = right

If (x = odd) true Then

X = X L2

Else

X = X R2

• How would your message be decrypted?

Page 7: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Creating Enigma In C#

• Open Visual Studio – create a new C# winforms project

• Drag a textbox, a label and a button onto your form

• The next page shows c# code– Use this to make your own form– How could you change this to create your own machine

that follows your pseudo code?– How would you add in a decryption device?

Page 8: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government
Page 9: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Odd / Even

• int Num = 5;

if(Num % 2 == 0) • // % operator checks for remainder in an integer value

{// It's even}else{// It's odd}

Page 10: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

What’s This?

How did you know?

Page 11: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

What About Here?

• Abstraction is our brain’s ability to recognise objects despite much of their context being removed.

• Where else do

humans use

abstraction?

Page 12: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Royal Institute Lectures

• This video is taken from the 2008 Royal Institute Christmas Lectures presented by Professor Chris Bishop

– This introduces the principals of abstraction in computation (the video is also uploaded to the course website for revision)

• HOMEWORK: visit www.rigb.org register and watch the 2008 lecture ‘Digital Intelligence’ (about 40 mins)

Page 13: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Computers Use Abstraction!

… for categorisation and representation (tb pg 8)

‘Categorisation’ or ‘generalisation’ creates a hierarchy into which different objects may be sorted:

Page 14: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Your Own Abstraction

• Using the top level of ‘Communication Device’, in two groups extend this to create a generalisation diagram.

• hint: somewhere in your diagram should be –– Mobile phone– Public phonebox– Social network site

Page 15: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

The Pigeonhole Principle

• Given two natural numbers n and m • With n > m• If n items are put into m pigeonholes at least one

pigeonhole must contain more than one items

• Think! 5 A-Side FootballWhere n = players and m = teams with available places and everyone must play

Where n = 5 and m = 4, one instance of m must contain multiple instances of n

Page 16: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

Hashing

• Hash table algorithms calculate an index from the data item's key and use this index to place the data into the array

• In the strategy known as separate chaining, direct chaining, or simply chaining, each slot of the bucket array is a pointer to a ‘linked list’

Page 17: Information Hiding & Abstraction Don’t Panic.. Information Hiding Not every piece of data is freely available for anyone to view. Consider Government

HOMEWORKDue in Next Wednesday!

1. Use the internet to research the hashing technique – why is this an example of the pigeonhole principal?

2. Write an explanation of Generalisation when used in Computing Abstraction – provide a diagram of how this is achieved

3. What is the difference between computing abstraction and mathematical abstraction? (hint… read your textbooks!)