180 likes | 365 Views
Information Hiding & Abstraction. Don’t Panic. 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.
E N D
Information Hiding & Abstraction Don’t Panic.
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?
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.
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
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.
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?
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?
Odd / Even • int Num = 5;if(Num % 2 == 0) • // % operator checks for remainder in an integer value {// It's even}else{// It's odd}
What’s This? How did you know?
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?
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)
Computers Use Abstraction! … for categorisation and representation (tb pg 8) ‘Categorisation’ or ‘generalisation’ creates a hierarchy into which different objects may be sorted:
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
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 Football Where 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
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’
HOMEWORKDue in Next Wednesday! • Use the internet to research the hashing technique – why is this an example of the pigeonhole principal? • Write an explanation of Generalisation when used in Computing Abstraction – provide a diagram of how this is achieved • What is the difference between computing abstraction and mathematical abstraction? (hint… read your textbooks!)