Online Cryptography Course: Message Integrity and MACs by Dan Boneh
Explore the concept of message integrity and Message Authentication Codes (MACs) in cryptography as explained by Dan Boneh. Understand the importance of ensuring data integrity and learn about different examples where message integrity is crucial. Delve into the role of secure MACs in protecting data from attacks, including chosen message attacks and existential forgery. Discover how secret keys and secure MAC algorithms contribute to maintaining the integrity of messages exchanged between parties. Analyze scenarios where MAC security can be compromised and evaluate the factors that determine the security of MAC algorithms.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Python Data Structures CMSC 201
Built in Types Today we will be talking about some other built in types in python! Tuples Sets Dictionaries
Terms Well Use Here is some vocab we ll be using in today s lecture: Data structure-A way of organizing or storing information. So far, the main data structure we ve seen is the list. Ordered-The data structure has the elements stored in Mutable-The contents of the data structure can be changed.
Tuples Tuples are ordered, immutable collections of elements. The only difference between a tuple and a list is that once a tuple has been made, it can t be changed!
Tuples Making a tuple: a = (1, 2, 3) Accessing a tuple: someVar = a[0] The syntax for access is exactly like a list. However, you can t reassign things.
Tuples So Far We ve already used tuples without knowing it! def myFunc(): return 1, 2 def main(): result = myFunc() print(result) When you return multiple things and store it in a single variable, it comes back as a tuple!
Tuples So Far Why would you want a tuple? Sometimes it s important that the contents of something not be modified in the future. Instead of trying to remember that you shouldn t modify something, just put it in a tuple! A lot of programming is learning to protect you from yourself.
Sets A set is an unordered collection of elements where each element must be unique. Attempts to add duplicate elements are ignored.
Sets Creating a set: mySet = set([ a , b , c , d ]) Or: myList = [1, 2, 3, 1, 2, 3] mySet2 = set(myList) Note that in the second example, the set would consist of the elements {1, 2, 3}
Sets Things we can do with a set: mySet = set([ a ]) mySet.add( b ) # Adds an element mySet.remove( b ) #Removes an element mySet.pop() # Removes and returns a random element
Sets There is also support for combining sets. mySet.union(someOtherSet) this returns a new set with all the elements from both sets. mySet.intersection(someOtherSet) this returns a new set with all the elements that both sets had in common. Tons more methods can be found here: https://docs.python.org/3/tutorial/datastructures.html
Dictionaries Up until now our storage has been done in lists. Lists can be viewed as a structure that map indexes to values. If I make the list: myList = [ a , b , c ] I have created a mapping from 0 to a , 1 to b , and so on. If I put in 0, I ll get a back.
Dictionaries Dictionaries let use whatever kind of keys we want! Instead of having 1 correspond to b , I can have hello correspond to b . Before: Now I can do things like: 0 a 1 b 2 c Hello a 1 b 3.3 c
Dictionaries This looks exactly like you d expect! myDict = {} myDict[ hello ] = a myDict[1] = b myDict[3.3] = c print(myDict[ hello ]) Prints: a
Dictionaries Why would you want to do this? Imagine you have a bunch of university students, and you re storing their grades in all their classes. student = Max Morawski grades = [A, B, C, D, D, C] We can set it up so that if we know a student s name, it s easy to look up their grades! gradeDict = {} gradeDict[student] = grades Now if I access gradeDict[ Max Morawski ], I ll get Max s grades back out. This isn t easy to do with a list!
Dictionaries When you look up something in a dictionary, the thing you re putting in (like the index in a list) is called a key. What we get out is called a value. A dictionary maps keys to values. myDict[ hello ] = 10 ^ Key Value ^
Dictionaries Just like in a list, if you do this: myDict[ hello ] = 10 myDict[ hello ] = 11 print(myDict[ hello ]) Prints: 11
Dictionaries If we want to get just the keys, or just the values, there s a function for that! listOfKeys = myDict.keys() listOfValues = myDict.values()