American University of Beirut**We aren't endorsed by this school
Course
CMPS 396Y
Subject
Computer Science
Date
Dec 20, 2024
Pages
4
Uploaded by DukeSpider4755
Faculty of Arts & Sciences Department of Computer Science CMPS 396Y Computer and Information Security Fall 2024/2025- HW1 Due date: October 17 (Typed Via LMS/Moodle)Problem 1 a)Consider the following general code for allowing access to a resource: DWORD dwRet = IsAccessAllowed(...); if (dwRet == ERROR_ACCESS_DENIED) { // Security check failed. // Inform user that access is denied. } else { // Security check OK. } a.Explain the security flaw in this program. b.Rewrite the code to avoid the flaw Hint: Consider the design principle of fail-safe defaults. b)Explain the suitability or unsuitability of the following passwords: 1.YK 334 2.mfmitm (for “my favorite movie is tender mercies) 3.Natalie1 4.Washington 5.Aristotle 6.tv9stove 7.12345678 8.dribgib c)1.Using the Vigenère table that you can find on Wikipedia (search for Vigenère Cipher, https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher), encrypt the phrase: ALLGOODMENHELPEDALLGOODBYWOMEN using the key SPSU. In a paragraph or so, tell what you observe about the relationship of the ciphertext to the plaintext. (The plaintext and key were constructed such that there is a relationship, so look until you find it. You could, of course, do the encoding with a program; please don't. You will learn more about how the cipher works by doing this part and the next with a pencil.) 2.Encrypt the same phrase using the key QIECHLAMOEDLASPIASTOANLADROUFL. Tell, in a paragraph or so, what is different about the ciphertext in this case and give an explanation for the difference.
d)Read the below about Caesar Cipher then use it to encrypt THELAZYFOX e)As soon as Barack took office, he decided to embrace modern technology by communicating with cabinet members over the Internet using a device that supports cryptographic protocols. In a first attempt, Barack exchanges with Tim brief text messages, encrypted with public-key cryptography, to decide the exact amounts of bailout money to give to the largest 10 banks in the country. Let pBand pTbe the public keys of Barack and Tim, respectively. A message msent by Barack to Tim is transmitted as EpT(m)and the reply rfrom Tim to Barack is transmitted as EpB(r). The attacker can eavesdrop the communication and knows the following information: Public keys pBand pTand the encryption algorithm, such that there is exactly one ciphertext for each plaintext. The total amount of bailout money authorized by congress is $900B The names of the largest 10 banks The amount each bank will get is a multiple of $1B Messages and replies are terse exchanges of the following form: Barack: How much to Citibank? Tim: $144B. Barack: How much to Bank of America? Tim: $201B. _ _ _ Describe how the attacker can learn the bailout amount for each bank even if he cannot derive the private keys. f)As public-key cryptography is computationally intensive and drains the battery of Barack's device, he comes up with an alternative approach. First, he shares a secret key k with Hillary but not with Bill. Next, together with a joke x, he sends over the value d = h(k||x), where h is a cryptographic hash function. Does value d provide assurance to Hillary that Barack is the author of x and that x was not modified by Bill? Justify your answer.
Problem 2 a)Benny is a thief who tried to break into an Automated Teller Machine (ATM) using a screwdriver, but was only able to break five different keys on the numeric keypad and jam the card reader, at which point he heard Alice coming, so he hid. Alice walked up, put in her ATM card, successfully entered her 4-digit PIN, and took some cash. But she was not able to get her card back, so she drove off to find help. Benny then went back to the ATM, and started entering numbers to try to discover Alice's PIN and steal money from her account. What is the worst-case number of PINs that Benny has to enter before correctly discovering Alice's PIN? b)An early attempt to force users to use less predictable passwords involved computer-supplied passwords. The passwords were eight characters long and were taken from the character set consisting of lowercase letters and digits. They were generated by a pseudorandom number generator with 215possible starting values. Using the technology of the time, the time required to search through all character strings of length 8 from a 36- character alphabet was 112 years. Unfortunately, this is not a true reflection of the actual security of the system. Explain the problem. c)Assume that passwords are limited to the use of the 95 printable ASCII characters and that all passwords are 10 characters in length. Assume a password cracker with an encryption rate of 6.4 million encryptions per second. How long will it take to test exhaustively all possible passwords on a UNIX system? d)Assume that on a computer system, each user chooses a password with a length of four characters, inclusive. Password characters must be either a capital letter or a digit and must contain at least one digit. Determine how many possible passwords are there. e)Assume that 10,000 passwords can be tested per second. The system administrators want to expire passwords once they have a probability of 0.10 of having been guessed. Assume that the system allows the user to choose a password with a length of one to ten characters, inclusive and password characters must be digits. determine the expected time to meet the above probability. f)Consider the Bloom filter discussed in Chapter 3. Define k = number of hash functions; N = number of bits in hash table; and D = number of words in dictionary. 1.Show that the expected number of bits in the hash table that are equal to zero is expressed as Φ=(1-k/N)D2.Show that the probability that an input word, not in the dictionary, will be falsely accepted as being in the dictionary is P = (1- Φ)k3.Show that the preceding expression can be approximated as P ≈ (1 - e-kD/N)k
g)The inclusion of the salt in the UNIX password scheme increases the difficulty of guessing by a factor of 4096. But the salt is stored in plaintext in the same entry as the corresponding ciphertext password. Therefore, those two characters are known to the attacker and need not be guessed. Why is it asserted that the salt increases security? h)Assuming you have successfully answered the preceding problem and understand the significance of the salt, here is another question. Wouldn’t it be possible to thwart completely all password crackers by dramatically increasing the salt size to, say, 24 or 48bits? i)Assuming you can do 220encryptions per second and the key size is 40 bits, how long would a brute force attack take? Give a scenario where this would be practical and another where it wouldn’t. What happens if you double the key size?j)Consider a sensor X that periodically sends a 64-octet measurement to a receiver Y. One day the administrator decides that X should encrypt the measurement data using DES in CBC mode. How many octets does X now send for each measurement? Explain your answer. k)Public-key algorithms are usually used for encrypting short messages. But if we need to encrypt a longer message we can split it into blocks, use RSA for each block and use a block cipher mode. Which of the two modes, CBC and Counter, would you recommend in such a situation?