Hashing and compression have in common that they shrink the information to smaller size. Stegnography is hiding information from the sight. it can be used to hide malware. Compression can be used to hide stegnography if you need to send information to someone you have to use asymmetic algorithm like RSA Application area for asymmetric encryption key exchange digital signatures with copyrights we can ex protect manuals and it is not good idea to protect source code patent it is possible to get patent for software. Patent måste man ansöka om. Idén är skyddad. Fram till för 20 år sedan kunde man inte patentera mjukvara, men reglerna ändras långsamt, i usa kan man patentera mjukvaran, i EU är det lite svårare. Du kan patentera idén bakom mjukvaran tex. skillnaden var ju att patent var på idén och copyright på uttrycket av en idé if you are external consultant a contract should make it obvious who has the right of the produced product program security objectives is protecting the program from flows and protecting the program from outsider files, applications, networks anynomuns p # Lecture 1 ## The Information Security Domain ![](https://i.imgur.com/BQQV71E.png) ## Security Goals ![](https://i.imgur.com/LagK9vO.png) ![](https://i.imgur.com/EChA0pj.png) ![](https://i.imgur.com/TrF6S0r.png) ## Cost-benefit analysis ![](https://i.imgur.com/eoexDgX.png) ## Assets ![](https://i.imgur.com/YaKQZhp.png) ![](https://i.imgur.com/sDhBHQB.png) ## More Security not alawys better ![](https://i.imgur.com/s4mXfL5.png) ## Humans Factor ![](https://i.imgur.com/h2pR8Oh.png) ## Policies ![](https://i.imgur.com/o0vpwbR.png) ## Prevention not the only concern ![](https://i.imgur.com/xRgXUdS.png) ## Controls/Countermeasures ![](https://i.imgur.com/hnyvsXC.png) ## Multiple Controls ![](https://i.imgur.com/S87dhb4.png) ## Trusting Trust ![](https://i.imgur.com/xRrYs2G.png) ## Attackers developing ![](https://i.imgur.com/f6KmiNa.png) ## Threat ![](https://i.imgur.com/EVDn3WY.png) ## What is attacked ![](https://i.imgur.com/z3UsDRt.png) ## Changes of incidents over time ![](https://i.imgur.com/77jbG2k.png) ![](https://i.imgur.com/mijeYLl.png) ## Motivation ![](https://i.imgur.com/4htK9sM.png) # Lectures 2,3 and 4 # Cryptography # Substitution Cipher ## Simple Substitution Cipher (Caesar Cipher) ![](https://i.imgur.com/1v0moZs.png) #### Encryption: 1. write down all alphabets and give them values **0-25**. You can also use 1-26 instead 2. Assume **P (Plain Text)** = Hello world, **K(key is given)** = 3 and **Cipher Text C** 3. Formula for encruption is : **C = (P + K) mod 26** 4. We don't preform modulas opretation if remainder would be in decimal point #### Example for encryption: 1. We start with H. The value of H from the picture is 7 2. (7 + 3 "key") mod 26 => 10 mod 26 => 10 because of step 4 3. The value 10 corresponds the letter K from the picture that means: H => K #### Decryption: **P = (C - K) mod 26** #### Example for decryption: 1. Cipher text ABC. Key k=3 2. A = 0 => 0-3 => -3 3. Negative is not allowed so we add 26 4. (26 - 3) mod 26 => 23 mod 26 => 23 5. From the picture 23 corresponds X ![](https://i.imgur.com/gwY4few.png) ## Monoalphabetic Cipher ![](https://i.imgur.com/1x4QlWV.png) Hackers identify the english letter frequencies so if E is the moste common in plain text what is the most common letter in cipher text? ## Polyalphabetic Cipher ![](https://i.imgur.com/y48girm.png) ![](https://i.imgur.com/3KuqLa2.png) ![](https://i.imgur.com/4Xp4vhc.jpg) 1. Make a table with alphabets in row and column 2. In every row We drop the first letter from the previous one and add the next one at the end #### Example Encryption: P = CAD (plain text) K = ADD (key) 1. from the plain text and key we decide the limit of the table we see it is A-D 2. We make a table of this range. Row is Key and column is Plain text ![](https://i.imgur.com/VwC4QDY.png) 3. Take the cross of the letter from key and letter from plain text to generate cipher text => A from Key + C from Plain text => C in Cipher text. D from Key + A from Plain text => D in Cipher text.D from Key + D from Plain text => G in Cipher text C = CDG #### Example Decryption: C (Cipher text) = CDG K = ADD 1. The same table for encryption but now key is the column and plain text is the row ![](https://i.imgur.com/p4qU5Pj.png) 2. A in key C from Cipher text => C plain text. D in key D from Cipher text => A plain text D in key G from Cipher text => D plain text P = CAD ## Playfair Cipher ![](https://i.imgur.com/7hd0D9L.png) Some books are different but most books put I and J togetuib I/J. But you can put any two alphabets together #### Example Encryption: P = WORLD K = SECURE C=? 1. Create 5 x 5 table 2. Count letters in Key then in Plain Text P = 5, K =6 3. Add padding (usually X) to the end of the word in Plain Text P = WO RL DX = 6 (Only in case the P letters are not even number. You don't need to add padding if it is ex 6 8 or 12) 4. Now P = WORLDX 5. Fill the 5 letters from K in the first row of the matrix and then other letters without repeating any letter ![](https://i.imgur.com/c5qWd9N.png) 6. Now we takes letters as pairs from P= WO RL DX 7. Now apply this roles in pic ![](https://i.imgur.com/K9jnbwd.png) 8. WO => EW, RL=> UM, DX=>KC 9. C = EWUMKC #### Example Decryption: Now we have to find P from C= EW UM KC, K= SECURE ![](https://i.imgur.com/QH04hVV.png) 1. if the two letters in the same column we take the letter above in decryption (opposite of encryption) EW=> WO, KC=>DX 2. if the letters are not on the same column or same row, each letter is replaced by the one in its tow in the column of the other letter UM=> RL 3. P= WO RL DX. X is the padding and it should be discarded 4. P= WORLD ![](https://i.imgur.com/4SM39o5.png) ## One-Time Pads (Vernam Cipher) ![](https://i.imgur.com/T3kCDJX.png) ![](https://i.imgur.com/aKcpKfj.jpg) #### Example Encryption: P = DANDAPANI K = ERISHPAUL C = P + K ex for the first letter D=> 3 E=>4 C= 3+4=>7 #### Example Decryption: P = C - K P = 7-4 = 3 =>D ![](https://i.imgur.com/ivNPcih.png) # Transposition Cipher ![](https://i.imgur.com/Iqzs7Ks.png) ![](https://i.imgur.com/ZOLasWO.png) # Summary ![](https://i.imgur.com/FZnmpWX.png) # Stream and Block Ciphers ![](https://i.imgur.com/33vJe8d.png) ![](https://i.imgur.com/KhvyBPK.png) ## Feistel Cipher (block cipher) ![](https://i.imgur.com/3BT6Xin.png) ![](https://i.imgur.com/AOD2jtN.png) It is symetric encryption. The key would be the same The rectangle is XOR ![](https://i.imgur.com/ikQAU47.png) ![](https://i.imgur.com/kKUCaWe.png) ## Subkey generator ![](https://i.imgur.com/6l4T4fi.png) - 64 bits key divided into 8 different blocks - Drop 1 bit from each block. 54 bits left - Divide into left half and right half 28 bits each - Decide round key by shifting. One bit leftshift at a time for rounds 1, 2, 9 and 16. Other rounds two bits leftshift. - We need only 48 bits and not 28+28 = 56. So we use Compression P-box ## Round Function ![](https://i.imgur.com/DLOMsT7.png) - Initial Permutation means that we are dividing 64 bits into 32bits x 2 - R0 is 32 bits and that is not enough because in block cipher block and key must have same size. the subkey is 48bits and that is why we have expand R0 in Expansion Permutation - When both R0 and K1 are 48bits now we can use XOR operation - Store 48 bits in Substitution box - Preform substitution operation to convert 48 bits to 32 bits - That is how we got R1 after the the XOR and L0 ![](https://i.imgur.com/P09FwYd.png) ![](https://i.imgur.com/jteRhak.png) ## DES TYPES 1. DES 2. 3DES 3. AES ![](https://i.imgur.com/3BgG0Ty.png) ### DES ![](https://i.imgur.com/CW6omWp.png) ![](https://i.imgur.com/0YZgVuJ.png) ### Double DES ![](https://i.imgur.com/kJXPTHE.png) ### Attack in double encryption of DES ![](https://i.imgur.com/KzTGlvm.png) ### Triple DES ![](https://i.imgur.com/ZVVrHwn.png) ### AES - Advanced Encryption Standard ![](https://i.imgur.com/EdhCTGC.png) - The input size is 128 bits (16 byte) - The key sizes can be 128, 192 or 256 bits (depends on round) - 10 rounds => 128 bits key, 12 =>192 and 14=> 256 ![](https://i.imgur.com/ZwzZ0Jx.png) ![](https://i.imgur.com/F5Ezwji.png) - A constant matrix in step 3 ### Example AES ![](https://i.imgur.com/nEL6Muv.png) - Because it is 10 rounds so the key is 128 bits - 10 rounds means that we need 11 subkey (we start with key for initial round, and then for each round we need a key) ### Compare DES, AES and Blowfish ![](https://i.imgur.com/VTsDL4I.png) ## Modes of operation / Arbitrary length for blocks **It can be bigger or smaller block size** ![](https://i.imgur.com/uhnlC83.png) ![](https://i.imgur.com/pY739bU.png) ### Modes of operation types ![](https://i.imgur.com/3decovx.png) ### ECB - Electronic codebook mode ![](https://i.imgur.com/Odasd4a.png) ![](https://i.imgur.com/z4AMwNR.png) - Same K for every block ### ECB strength, weakness and uses ![](https://i.imgur.com/io5G3fL.png) ### Example ECB ![](https://i.imgur.com/RyB7EM9.png) ### CBC Cipher Block Chaining + Uses ![](https://i.imgur.com/PLJLqjr.png) ![](https://i.imgur.com/cGJ3oyZ.png) ### CFB Cipher Feedback Mode ![](https://i.imgur.com/e19Kqqu.png) - It has more than CBC : shift register, temperoray register and after that we are using it as key - We are getter different key for each operation internally - The produced C1 will become IV for the next operation and so on # SYMMETRIC-KEY DISTRIBUTION ![](https://i.imgur.com/8poestj.png) ### KDC - Key distribution cneter ![](https://i.imgur.com/VlVEqeW.png) ### Flat Multiple KDCs Multiple KDCs to make it more secure ![](https://i.imgur.com/4RV17R2.png) ### Hierarchical Multiple KDCs ![](https://i.imgur.com/UNvlVhU.png) ### Session Key - Member <=> KDC ![](https://i.imgur.com/DRfFdST.png) ### Simple Protocol using KDC ![](https://i.imgur.com/Jj3GxZu.png) # Asymmetric/Public encryption ![](https://i.imgur.com/xLUD5bb.png) ### Popular algorithms ![](https://i.imgur.com/LeyTW5l.png) ### 1. RSA ![](https://i.imgur.com/OjAMqSi.png) - Ciphertext would be availabe to everyone, but not the encrypted message inside it ![](https://i.imgur.com/T5khiNz.png) ### RSA Explaination - RSA is block cipher. Block B is encoded with integer T using function g. where 0 < T < n. where n = pq - Euler phi function ![](https://i.imgur.com/JaFWDDk.png) The Euler totient function f(n) is the number of positive integers less than n that are relatively prime to n - Important formula ![](https://i.imgur.com/ZJZNbIl.png) - Finally calculate the values of public/private keys ![](https://i.imgur.com/qhZYe0d.png) ### RSA Example ![](https://i.imgur.com/hNFjYEm.png) ![](https://i.imgur.com/HWxMbO0.png) Think: 7 * d mod 20 =1 => what is the value of d if the reminder for 7*d %20 will be one => 7*d=21 => d= 3 ![](https://i.imgur.com/h7yC3Z6.png) ![](https://i.imgur.com/VN9QkNi.png) ![](https://i.imgur.com/x6dnaYO.png) ![](https://i.imgur.com/PiFB2N9.png) ### 2. Diffie-Hellman key exchange ![](https://i.imgur.com/gIGxGaB.png) ![](https://i.imgur.com/8oPSey4.png) ![](https://i.imgur.com/vrxn7u0.png) ### Diffie-Hellman Explanation Try with 3: (numbers in result should not repeat) ![](https://i.imgur.com/E2AEibZ.png) Try with 2: (Got repeated so 2 is not the primitiv root) ![](https://i.imgur.com/B5bokUZ.png) ![](https://i.imgur.com/50ABYZN.png) - alpha and q are public like yellow in the colors example ### Example (important for exam) ![](https://i.imgur.com/ZVmracu.png) KA= KB so they securely sent the secret key # Man-in-the-middle MITM attack Not the same as Meet in the middle attack taht we saw it in double DES ![](https://i.imgur.com/qIiKpN0.png) ![](https://i.imgur.com/OZd9pzf.png) # Need for hash function ![](https://i.imgur.com/lxG1iZy.png) # Ways for authentication ![](https://i.imgur.com/ojBgF2S.png) ## Message Encryption ![](https://i.imgur.com/QT24F4o.png) 1. When the message is encrypted using A private key and everyone has A public key. You got the authentication. It is from A, because no one else than A can use the private key for A. But it is a message over network and anyone can decrypt it by the public key of the sender so we lost confidentiality ![](https://i.imgur.com/KHlm9gv.png) 2. When we encrypt using B public key and B decrypt it using its private key. We lose authentication because everyone has B public key but we got confidentiality because only B can decrypt the message using its private key. 3. The third way when A encrypt the M with A private key and then with B public Key. B decrypt the first layer with own private key then the second layer with A public key. We got both the confidentiality and authentication ## Hash Function ![](https://i.imgur.com/CVPHwMZ.png) ![](https://i.imgur.com/ihEVv5h.png) ![](https://i.imgur.com/LQRG12g.png) ![](https://i.imgur.com/K2dAwLN.png) ![](https://i.imgur.com/HeIqBdv.png) ## Hash Function Properties ![](https://i.imgur.com/OxeDn6j.png) # Hashing VS Encryption ![](https://i.imgur.com/Xtu2nIh.png) # Hash Algorithm ## Motivation ![](https://i.imgur.com/sfpSMZS.png) ## Usage ![](https://i.imgur.com/chC2rlN.png) # Hash Function & Message Authentication(Integrity) ![](https://i.imgur.com/uN6aArg.png) By comparing the hash code that what we got from the sender with our hash code generated with the same hash function on the plain text can we verify if the message has been modified . # Hash Function & Digital Signature - PKPK ![](https://i.imgur.com/ykiy7DC.png) 1. First one(Public and private keys) - Encrypt Hash code with the sender A private key and send it with the plain M to the receiver. - The receiver will hash M and produce hash code. Preform Decryption on the encrypted hashcode using A public key. Compare the two hashes.We got the authentication but not the confidentialty because everyone has A public key 2. Second one(Common shared key) - The sender is addionally applying encryption on the plain message M and the encrypted hashcode - The receiver decrypt with the common key so we got confidentiality. # MAC - Message Authentication Code ![](https://i.imgur.com/g6XDyRY.png) ![](https://i.imgur.com/pUBGl4b.png) ![](https://i.imgur.com/gZ4hy1u.png) ![](https://i.imgur.com/IDDKBzo.png) # Digital Signature ![](https://i.imgur.com/km6OiOS.png) ![](https://i.imgur.com/4FA0gpx.png) Digital signature is good property but you have to have someone in the middle to handle it. # Certification Authority ![](https://i.imgur.com/HvC4LMr.png) # Lecture 5 # Program Security ## What is Program Security? ![](https://i.imgur.com/oBJ6mwW.png) ## Objectives ![](https://i.imgur.com/cJjXHDN.png) ## Error, Fault and Failure ![](https://i.imgur.com/4aatjta.png) Example: error: wrong variable name in the code fault: we expect two digits and we got one failure:the system crashes ![](https://i.imgur.com/JVgdPQl.png) ## Permanent/Transient faults Permanent fault: Means that is we run the system once again the same fault will happen. we can reproduce it Transient fault: Sometimes we got the fault and sometimes not. ## Testing Security ![](https://i.imgur.com/E2XlOXA.png) ![](https://i.imgur.com/Ze3nLfu.png) ## Fauilure seen by outsiders ![](https://i.imgur.com/w1At7nK.png) ![](https://i.imgur.com/pj4W4Vy.png) ## Inadvertent faults/failures ![](https://i.imgur.com/OKg2o87.png) ## Problems with program behaviour testing ![](https://i.imgur.com/va4Q0Tm.png) ## Types of Program Flaws ![](https://i.imgur.com/CSPmqGD.png) Intentional but non malicious like adding feature that is not in specification ## Unintentional flaws ![](https://i.imgur.com/uwgcaXy.png) ## Common non-malicious program errors ![](https://i.imgur.com/AFc0fAr.png) ## Buffer Overflows Buffer overflows often come from innocent programmer oversights or failures to document and check for excessive data. ### Overwriting memory If you write an element past the end of an array or you store an 11-byte string in a 10-byte area, that extra data has to go somewhere; often it goes immediately after the last assigned space for the data. A buffer (or array or string) is a space in which data can be held. A buffer resides in memory. Because memory is finite, a buffer’s capacity is finite For this reason, in many programming languages the programmer must declare the buffer’s maximum size so that the compiler can set aside that amount of space First, the attacker may replace code in the system space. By replacing a few instructions right after returning from his or her own procedure, the attacker regains control from the operating system, possibly with raised privileges. This technique is called **privilege escalation**. ![](https://i.imgur.com/WJ0lhUn.png) ![](https://i.imgur.com/aBbcRFb.png) ![](https://i.imgur.com/kkI8rBf.png) ![](https://i.imgur.com/sdVOjO3.png) ![](https://i.imgur.com/GjasplO.png) ## Buffer Overflow Countermeasures ![](https://i.imgur.com/TqYS9xo.png) ### Programing Controls against Buffer Overflow ![](https://i.imgur.com/tWS0asX.png) ### Language Features against Buffer Overflow ![](https://i.imgur.com/QOEwLzS.png) Some programming languages have features that preclude overflows. For example, languages such as Java, .NET, Perl, and Python generate code to check bounds before storing data. The unchecked languages C, C++, and assembler language allow largely unlimited program access. ### Code Analyzer Software developers hope for a simple tool to find security errors in programs. Such a tool, called a static code analyzer, analyzes source code to detect unsafe conditions. ### Seperation ![](https://i.imgur.com/KPXlPBZ.png) ## Incomplete Mediation Mediation means checking: the process of intervening to confirm an actor’s authorization before it takes an intended action check the total price before placing order ![](https://i.imgur.com/GEBH5Hc.png) We have to check data that comes to our server ![](https://i.imgur.com/XiPNmHv.png) ## Time-of-check to Time-of-use errors ![](https://i.imgur.com/Red68FU.png) ## Protecting from Time-of-check to Time-of-use errors ![](https://i.imgur.com/Q6XjjVs.png) ## Malicious code are also programs ![](https://i.imgur.com/ow10GP4.png) ## Definititions for types of Malware ![](https://i.imgur.com/zk1gNxN.png) ![](https://i.imgur.com/pTsJdso.png) ## History of Malware **A bot** (short for robot), is a kind of worm used in vast numbers by search engine hosts like Bing and Google A virus that can change its appearance is called a **polymorphic virus** A simple variety of polymorphic virus uses encryption under various keys to make the stored form of the virus different. These are sometimes called **encrypting viruses** ![](https://i.imgur.com/43CQJ7D.png) ![](https://i.imgur.com/vLnDWA4.png) ## How Viruses Work ![](https://i.imgur.com/NGpJC8M.png) ## Viruses Detection & Prevention ![](https://i.imgur.com/YCU1ztc.png) ## Virus Cause/Effect ![](https://i.imgur.com/or1aOE1.png) ## The Morris Worm ![](https://i.imgur.com/d89vtRL.png) ## Exploitation of Flows: استغلال العيوب ![](https://i.imgur.com/l7QdlNo.png) ![](https://i.imgur.com/aKdPuUq.png) ## Types of Controls & Preventing Security Flaws ![](https://i.imgur.com/sw7jwPs.png) ## Developmental Controls ![](https://i.imgur.com/ls3PuZi.png) ### Fundamental principles of sw engineering ![](https://i.imgur.com/EV44wrt.png) ![](https://i.imgur.com/FYzOpCd.png) ### Modularity Modularity means dividing the sytem into simple modules ![](https://i.imgur.com/GOSQMUo.png) ### Encapsulation ![](https://i.imgur.com/MCNrPrm.png) ### Information Hiding ![](https://i.imgur.com/LHsSahM.png). I/O input and output ### Another controls ![](https://i.imgur.com/FzVPpEb.png) ### Three types of reviews ![](https://i.imgur.com/MUiAZxr.png) ### Hazard Analysis تقييم المخاطر ![](https://i.imgur.com/eV4F952.png) ### Testing Phases Testing is a process activity that concentrates on product quality: It seeks to locate potential product failures before they actually occur ![](https://i.imgur.com/7NIGEUk.png) ### Types of Testing Black box tester work as hacker because he doesn't know about the implementation ![](https://i.imgur.com/niE3H6T.png) ### Good Design ![](https://i.imgur.com/qXHl7HH.png) ### Fault-tolerant Apporach ![](https://i.imgur.com/BJtqPJY.png) ### Example ![](https://i.imgur.com/9WicXGv.png) ### Handling Failure ![](https://i.imgur.com/YlVcjvU.png) ### Using Design Patterns ![](https://i.imgur.com/erLuGbL.png) ### Value of Good Design ![](https://i.imgur.com/xlQhyAK.png) ### Risk Prediction and Management ![](https://i.imgur.com/fSbgpfy.png) ### Static Analysis Tool to examine our code while ![](https://i.imgur.com/ndLFUjE.png) ### Dynamic Analysis Examine our code while it is running ### Configuration Management ![](https://i.imgur.com/aeoIQQM.png) ### Additional Developmental Controls ![](https://i.imgur.com/5RiwZVz.png) ## The role of the program language ![](https://i.imgur.com/DIMm0aP.png) ## Operating System Controls for Security ![](https://i.imgur.com/7QLAx1J.png) ![](https://i.imgur.com/aWf4fWW.png) ### key characteristics ![](https://i.imgur.com/NPddiBF.png) ![](https://i.imgur.com/ybkmdtE.png) ### Mutual Suspicion ![](https://i.imgur.com/h4SDEev.png) ### Confinement الحبس ![](https://i.imgur.com/rOp0Y6s.png) ### Access Log ![](https://i.imgur.com/aVp9H4a.png) ## Adminstrative Controls for Security ![](https://i.imgur.com/7obfEOx.png) ![](https://i.imgur.com/ax5cWZ1.png) ![](https://i.imgur.com/suApEh3.png) ![](https://i.imgur.com/kOW8hOk.png) ## Consclusion ![](https://i.imgur.com/NzkIY0l.png) ![](https://i.imgur.com/r1pUkiQ.png) # Lecture 6 # Privacy ## Privacy and Data Protection ![](https://i.imgur.com/vO6IKOV.png) ## Privacy Personal Data What one person considers private is that person’s decision: There is no universal standard of what is private. ![](https://i.imgur.com/YTUdHBn.png) ## Computer-Related Privacy Problems ![](https://i.imgur.com/aolQNZ3.png) ## Other Threats to Privacy ![](https://i.imgur.com/Q5hjbdN.png) ## Information Stakeholder Concerns ![](https://i.imgur.com/HY9nErZ.png) ## Main Actors and Roles ![](https://i.imgur.com/sM837Qp.png) ## Privacy Principles | Fair Information Practices These principles describe the rights of individuals, not requirements on collectors; that is, the principles do not require protection of the data collected. Fair information principles describe privacy rights of individuals to sensitive data. ![](https://i.imgur.com/EVJDVCA.png) ## Protect Stored Data ![](https://i.imgur.com/ON0MOMI.png) ## Privacy Principles and Laws ![](https://i.imgur.com/d7Sc6BQ.png) ## U.S. Data Privacy Laws ![](https://i.imgur.com/BTygaPm.png) ![](https://i.imgur.com/lVIzpD9.png) ## Deceptive Practices خادع Privacy notices are enforceable: A site that says it will not release data must abide by that rule, but a site that says nothing is not constrained. ## European Union Data Directive ![](https://i.imgur.com/tsc1k2A.png) ## European Union Data Protection Regulation ![](https://i.imgur.com/mLB8SPx.png) ![](https://i.imgur.com/fTiWCT9.png) ## Conflicting Laws Different laws in different jurisdictions will inevitably clash. Relations between the European Union and the United States have been strained over privacy because the E.U. law forbids sharing data with companies or governments in countries whose privacy laws are not as strong as those of the E.U(The United States and the European Union have agreed to a set of “safe harbor” principles that let U.S. companies trade with European countries in spite of their not meeting all European privacy laws.) ## Privacy in Common Criteria and Controls ## Individual Actions to Protect Privacy ![](https://i.imgur.com/i5bcqM7.png) **Multiple Identities-Linked** Most people already have multiple identities. To your bank, you are your account number. To your motor vehicles bureau, you are your driver’s license number. And to your credit card company, you are your credit card number. Pseudonymity اسم مستعار discuss the use of email aliases to maintain privacy. These uses, called pseudonymity, protect our privacy because we do not have to divulge what we consider sensitive data. The Swiss bank account provides a classic example of pseudonymity. Each customer has only a number to identify and access the account, and only a few selected bank employees are allowed to know your identity; all other employees see only your account number ![](https://i.imgur.com/jIgElnH.png) ## Consequences: Not Protecting Personal Data ![](https://i.imgur.com/KoyIjuG.png) ## Steps to Protect Against Privacy Loss ![](https://i.imgur.com/HBAqZDv.png) ## Authentication, identity and attribute **Authentication is** confirming an asserted identity. Inferring an identity from authentication data is far harder and less certain. An **identity** is a character string or similar descriptor, but it does not necessarily correspond to a single person, nor does each person have only one name we authenticate an attribute if we verify that a person has that **attribute**. An attribute is a characteristic, such as a fingerprint or a DNA profile ## Privacy-Preserving Data Mining Because data mining can threaten privacy, researchers have looked into ways to protect privacy during data-mining operations. A naïve and ineffective approach is trying to remove all identifying information from databases being mined. Sometimes, however, the identifying information is necessary for the mining and may even be the goal of data mining Data mining usually employs two approaches—correlation and aggregation. We examine techniques to preserve privacy with each of those approaches. ### Privacy for Correlation Data swapping can help maintain reasonable privacy while providing usable data for research. ex. Swapping all addresses for people in DB would defeat the ability to draw any correct conclusions. ### Privacy for Aggregation Aggregation need not directly threaten privacy. an aggregate (such as sum, median, or count) often depends on so many data items that the sensitivity of any single contributing item is hidden. Government statistics show this well: Census data, labor statistics, and school results show trends and patterns for groups but do not violate the privacy of any single person. ## Organizational Response ![](https://i.imgur.com/iCqbzAS.png) ## The Information Life Cycle ![](https://i.imgur.com/OmhQjMq.png) ## Mapping of ISO/IEC 27000 Standards with GDPR ![](https://i.imgur.com/UF5NPzz.png) ## Risk Assessment ![](https://i.imgur.com/GwBNLS0.png) ## Privacy Impact Assessments (PIA) ![](https://i.imgur.com/6SlHkX0.png) ## Four Core Component of the PIA Process ![](https://i.imgur.com/QwiLSvX.png) ![](https://i.imgur.com/waIMY3M.png) ## Privacy by Design ![](https://i.imgur.com/9xHUs5G.png) ## Web Surfing ![](https://i.imgur.com/Dd3pJBa.png) ## Cookies ![](https://i.imgur.com/jdbXRZ7.png) ![](https://i.imgur.com/zKdqLP1.png) ![](https://i.imgur.com/5KIHJRy.png) ## Flash Cookies ![](https://i.imgur.com/LKCd7gt.png) ## Web Beacons ![](https://i.imgur.com/eeFiAHZ.png) ## Web bugs vs cookies ![](https://i.imgur.com/bRrEVRP.png) ## Spyware ![](https://i.imgur.com/kWEfoQp.png) ![](https://i.imgur.com/0NLbeAD.png) ## Email ![](https://i.imgur.com/AwgZzYE.png) ![](https://i.imgur.com/Kd4Qisy.png) ![](https://i.imgur.com/cv7LmMU.png) ![](https://i.imgur.com/qLhG1yP.png) ## Remailer ![](https://i.imgur.com/QLyMncR.png) ### extra ![](https://i.imgur.com/11QIfK0.png) ## Emerging Technologies ![](https://i.imgur.com/0gQJ4sv.png) ## Radio Frequency Identification (RFID) ![](https://i.imgur.com/PoQdLnM.png) We have already described two of RFID’s major privacy issues: the ability to track individuals wherever they go and the ability to discern sensitive data about people. There are other related issues, including correctness and prediction. ![](https://i.imgur.com/6eSWvNo.png) ![](https://i.imgur.com/SbincjZ.png) ### Voting ![](https://i.imgur.com/wZjOUAv.png) ### Cloud Computing # Lecture 7 # Management and Incidents ## Organizational Security Policy ![](https://i.imgur.com/Wvne4ev.png) ### Audience and Contents ![](https://i.imgur.com/woP2M31.png) ### Characteristics ![](https://i.imgur.com/EIWNIhW.png) ## Security Planning **A security plan** is a document that describes how an organization will address its security needs. The plan is subject to periodic review and revision as the organization’s security needs change ![](https://i.imgur.com/teAnKVZ.png) ### Requirements for Secrurity Planning ![](https://i.imgur.com/9zJXJJk.png) ![](https://i.imgur.com/m3ZdbuX.png) ### Content of a Security Plan Current State: The organization can determine the vulnerabilities by performing a risk analysis: a systematic investigation of the system, its environment, and the things that might go wrong. ![](https://i.imgur.com/UPptkcl.png) ### Inputs to the Security Plan ![](https://i.imgur.com/6huD2dn.png) ### Responsibility for Implementation ![](https://i.imgur.com/5JYVRfI.png) ### Team Members ![](https://i.imgur.com/SCM847w.png) ### Guarantee Support, Assuring Commitment to a Security Plan ![](https://i.imgur.com/ajTLcLe.png) ## Business Continuity Planning ![](https://i.imgur.com/YSs1IbI.png) Business continuity planning guides response to a crisis that threatens a business’s existence ### Activities Business continuity planning forces a company to set base priorities. ![](https://i.imgur.com/VMEvpsk.png) ## Incident Response Plan (IRP) (similar to business security plan but doesn't think about the business) ![](https://i.imgur.com/qcZBdkw.png) ### Computer Security Incident Response Team (CSIRTs) ![](https://i.imgur.com/Dqyy6di.png) ### CSIRT Skills ![](https://i.imgur.com/axLnN5h.png) ## Definitions ![](https://i.imgur.com/WO7LdKT.png) ## Risk Analysis ![](https://i.imgur.com/ezDqYTD.png) ### Strategies for Dealing with Risk ![](https://i.imgur.com/QN1oLri.png) ### Risk Exposure Example ![](https://i.imgur.com/WOWkzyo.png) ### Risk Leverage نفوذ ![](https://i.imgur.com/bwj7vVS.png) ex. The leverage measures value for money spent: A risk reduction of $100 for a cost of $10, a 10:1 reduction, is quite a favorable result. If the leverage value of a proposed action is not high enough, then we look for alternative but less costly actions or more effective reduction techniques. ### Threat Modelling ![](https://i.imgur.com/2naW3sn.png) ### Threat Modelling : Data Flow Diagram ![](https://i.imgur.com/XD11qO7.png) ### Threat Modelling: Attack Tree ![](https://i.imgur.com/AahJCmu.png) ### Threat Modelling : STRIDE (not too important) ![](https://i.imgur.com/EMr27C9.png) ![](https://i.imgur.com/0dAOTyY.png) ## Steps for Risk Analysis ![](https://i.imgur.com/jfoRH6t.png) ### Identify Assets ![](https://i.imgur.com/kFetubW.png) ![](https://i.imgur.com/QpKOhqV.png) ### Determine Vulnerabilities ![](https://i.imgur.com/KF5WlwA.png) ### Estimate Likelihood of Exploitation ![](https://i.imgur.com/rFma8At.png) ### Risk Analysis Methodologies 1. Quantitative 2. Qualitative ![](https://i.imgur.com/Ya7QvmB.png) Qualitative assessment is more appropriate in situations where it is difficult to quantify risk, for example, for the likelihood that a meteor might crash into a building. Often, qualitative risks are then assigned a numeric value, for example, 1 for improbable and 5 for highly likely. These numbers are a simple shorthand notation, and sometimes they are used in the next step of risk analysis, in which risk likelihoods are used to predict potential loss Neither of these two approaches is “right” nor is one necessarily better than the other. s699 ![](https://i.imgur.com/vKYCYr5.png) ## Compute Expected Loss ![](https://i.imgur.com/Wu3esIv.png) Legal fees: ![](https://i.imgur.com/mhKhDTk.png) ## Survey and Selecting Controls ![](https://i.imgur.com/Pt76Mwl.png) ## Project Costs and Savings ![](https://i.imgur.com/vDHD7A1.png) ## Example: Access Control Software Cost ![](https://i.imgur.com/kKt9xng.png) ![](https://i.imgur.com/iDnL7Zh.png) ## Physical Security ![](https://i.imgur.com/ZglqTBk.png) ## Contingency Planning ![](https://i.imgur.com/uUIygMY.png) **Revolving backups**, in which the last several backups are kept. Each time a backup is done, the oldest backup is replaced with the newest one. There are two reasons to perform revolving backups: to avoid problems with corruptedn media (so that all is not lost if one of the disks is bad) and to allow users or developers to retrieve old versions of a file. Another form of backup is a selective backup, in which only files that have been changed (or created) since the last backup are saved **Offsite Backup** Keeping a backup version separate from the actual system reduces the risk of its loss **Cold Site** ![](https://i.imgur.com/S5ObSbn.png) **Hot Site** ![](https://i.imgur.com/AxketTx.png) To activate a hot site, the team has only to load software and data from offsite backup copies # Lecture 8 # Legal Issues and Ethics ## Protecting Programs and Data ![](https://i.imgur.com/1LaBADh.png) ## Copyrights ![](https://i.imgur.com/NUTLwfy.png) ![](https://i.imgur.com/Xi8fcWH.png) The copyrighted expression must also be in some tangible medium ex. Dictionaries can be copyrighted in this way, too; the authors do not claim to own the words, just their expression in a particular dictionary. Unfair use of a copyrighted item is called **piracy**. Fair use allows copies for scholarship and research. The copyright law also has the concept of a **first sale**: after having bought a copyrighted object, the new owner can give away or resell the object ![](https://i.imgur.com/CsSYk9R.png) --------------- ![](https://i.imgur.com/nkXBkHu.png) ## Patents ![](https://i.imgur.com/VePJ3IQ.png) patent is designed to protect the device or process for carrying out an idea, not the idea itself. Patents protect inventions, tangible objects, not their design or idea. ![](https://i.imgur.com/Ktc3q5u.png) ![](https://i.imgur.com/oxUCUbG.png) ![](https://i.imgur.com/Q3p1lL9.png) . ![](https://i.imgur.com/YHq74jl.png) ## Trade Secrets ![](https://i.imgur.com/jKYagXU.png) Trade secret protection does not cover copying a product (specifically a computer program), so it cannot protect against a pirate who sells copies of someone else’s program without permission. However, trade secret protection makes it illegal to steal a secret algorithm and use it in another product. The difficulty with computer programs is that reverse engineering works. Decompiler and disassembler programs can produce a source version of an executable program ![](https://i.imgur.com/lJP9EcV.png) ## Comparing ![](https://i.imgur.com/qeJAlbh.png) ## EXamples ### Source code ![](https://i.imgur.com/vHgY3BD.png) ### Web Content ![](https://i.imgur.com/RlXnPgO.png) ## Trademark Domain names, URLs, company names, product names, and commercial symbols are protected by a **trademark**, which gives exclusive rights of use to the registered owner of such identifying marks. ## Intellectual Property Issues and Computer Security ![](https://i.imgur.com/JQ1UX4C.png) ![](https://i.imgur.com/EztiIVj.png) ## Information and the Law ![](https://i.imgur.com/pg9lGzc.png) The marginal cost of an item is the cost to produce another one after having produced some already. unlike a newspaper, information is far more feasible for a buyer to resell. A copy of digital information can be perfect, indistinguishable from the original, the same being true for copies of copies of copies of copie ![](https://i.imgur.com/peEfMTB.png) ## Different Legal Systems ![](https://i.imgur.com/BgoC9FB.png) ## Different Types of Laws : Protecting Information **Statutes** are laws that state explicitly that certain actions are illegal. **Criminal law** involves a wrongful action against society. **Civil law** involves harm to an individual or a corporation. **Tort law** is the unwritten body of standards of proper behavior, documented in prior court decisions. **contracts** ![](https://i.imgur.com/rV9Uwv1.png) ![](https://i.imgur.com/NzS8IU1.png) ## Cybersecurity Laws ![](https://i.imgur.com/fmgaO2k.png) ## In Civil Law System in Sweden ![](https://i.imgur.com/UBqUuOo.png) ## Ownerships Rights of Employees and Employers An employment contract clarifies for both parties an employee’s rights to computer products. In a **work for hire** situation, the employer, not the employee, is considered the author of a work ![](https://i.imgur.com/XMSoiX9.png) ## Licenses and trade secret ![](https://i.imgur.com/eN37mVu.png) ## Redress for Software Failures ![](https://i.imgur.com/YFv0B14.png) ![](https://i.imgur.com/KRQPiaU.png) ## Example Guarantees and returns ![](https://i.imgur.com/xfBRwVM.png) ## Reporting Software Flaws ![](https://i.imgur.com/eZWnb8H.png) A third party—such as a computer emergency response center—called a “coordinator” could also play a role when a power issue or conflict arises between reporter and vendor. Basically, the process requires reporter and vendor to do the following: ![](https://i.imgur.com/YQ9gLLv.png) ## Software Licenses ![](https://i.imgur.com/aTsRCNm.png) ## Computer crime ![](https://i.imgur.com/xQiXHoX.png) ![](https://i.imgur.com/vGQbPOd.png) **Forensic analysis** is a field in which computer security experts examine artifacts such as disk drives, log files, program code, even volatile memory, to discern facts about datacontained. ## Examples of Computer Crimes ![](https://i.imgur.com/XkfjTWa.png) ## Computer Crime is Hard to Prosecute ![](https://i.imgur.com/kbxoUic.png) ## Comparison of Law and Ethics ![](https://i.imgur.com/eMTfIo1.png) ## Ethical Issues in Computer Security ![](https://i.imgur.com/UEK4WC3.png) ## Examining a Situation for Ethical Issues ![](https://i.imgur.com/yTYGzuK.png) ## Rule-Based Ethics ![](https://i.imgur.com/CDhu1MR.png) ## Consequence-Based Ethics ![](https://i.imgur.com/60i0dNw.png) ![](https://i.imgur.com/I4X4uzl.png) ## Ethics of Hacking or Cracking ![](https://i.imgur.com/1hW7h9M.png) ## Certified Information System Security Porfessional ![](https://i.imgur.com/Ovc0br7.png) ## Are you Ethics Contextual? ![](https://i.imgur.com/2SJsdMj.png) ## Ten Commandments of Computer Ethics ![](https://i.imgur.com/2Rgsrl3.png) ## Software Protection ![](https://i.imgur.com/ZmF4JJi.png) # Lecture 9 # Protection in Operating Systems ## OS Functions The operating system is the fundamental controller of all system resources—which makes it a primary target of attack, as well. Gaining control before the protector means that the protector’s power is limited. In that case, the attacker has near-complete control of the system: The malicious code is undetectable and unstoppable. Because the malware operates with the privileges of the root of the operating system, it is called a **rootkit**. the system addresses several particular functions that involve computer security: * Enforced sharing. Resources should be made available to users as appropriate * Interprocess communication and synchronization. Executing processes sometimes need to communicate with other processes or to synchronize their accesses to shared resources * Protection of critical operating system data * Guaranteed fair service. All users expect CPU usage and other service to be provided so that no user is indefinitely starved from receiving service * Interface to hardware * User authentication. * Memory protection. * File and I/O device access control. * Allocation and access control to general objects ![](https://i.imgur.com/aetvvmt.png) ## History of OS The first operating systems were simple utilities, called **executives,** designed to assist individual programmers and to smooth the transition from one user to another ![](https://i.imgur.com/qlQgx0O.png) ## Portected Objects ![](https://i.imgur.com/yYv6Jx1.png) ## OS Layered Desgin Operating System Design to Protect Objects The critical functions of controlling hardware and enforcing security are said to be in lower or inner layers, and the less critical functions in the upper or outer layers. ![](https://i.imgur.com/ebALTke.png) ## Functions Spanning Layers The functions listed would occur at different levels of the operating system. Thus, the user authentication functions are implemented in several places ![](https://i.imgur.com/pau88qY.png) ## Modular OS Desgin ![](https://i.imgur.com/9FMbuQo.png) ## Virtualization it is one of Operating System Tools to Implement Security Functions **Hypervisor** A hypervisor, or virtual machine monitor, is the software that implements a virtual machine. It receives all user access equests, directly passes along those that apply to real resources the user is allowed to access, and redirects other requests to the virtualized resources. ![](https://i.imgur.com/eI6Kjxj.png) ## Sandbox A concept similar to virtualization is the notion of a sandbox. As its name implies, a sandbox is a protected environment in which a program can run and not endanger anything else on the system. ## Honeypot Honeypot: system to lure an attacker into an environment that can be both controlled and monitored ## Seperation and Sharing nowadays, simple systems might use physical separation because it is very costy otherwise we have the logical separation ![](https://i.imgur.com/j8maTHh.png) ### Methods of Seperation ![](https://i.imgur.com/qEOCBz0.png) ### Methods of supporting separation/sharing ![](https://i.imgur.com/zvE3aS4.png) ## Hardware Protection of Memory Memory protection implements both separation and sharing. **a fence** is a method to confine users to one side of a boundary. In fixed Fence: If less than the predefined space was required, the excess space was wasted. Conversely, if the operating system needed more space, it could not grow beyond the fence boundary. ![](https://i.imgur.com/zLCwndI.png) ## Fence Registers if we update the OS and it needs more space the fence registers change to change the limit for the OS A fence register protects in only one direction. In other words, an operating system can be protected from a single user, but the fence cannot protect one user from another user A major advantage of an operating system with fence registers is the ability to relocate ![](https://i.imgur.com/PGOWfL0.png) ## Base/Bound Registers The relocation register solves the problem by providing a base or starting address. All addresses inside a program are offsets from that base address. A variable fence register is generally known as a **base register**. a second register is often added, as shown in Figure 5-8. The second register, called a **bounds register**, is an upper address limit, in the same way that a base or fence register is a lower address limit Each program address is forced to be above the base address because the contents of the base register are added to the address; each address is also checked to ensure that it is below the bounds address. ![](https://i.imgur.com/llblx76.png) Handle data and code separately ![](https://i.imgur.com/CcbkdiM.png) ![](https://i.imgur.com/g8ROi1S.png) ## Tagged Architecture This will improve the security at the cost of wider memory and all mechanisms to keep it updated and use it in good way. So it is not used very much **tagged architecture**, in which every word of machine memory has one or more extra bits to identify the access rights to that word. These access bits can be set only by privileged (operating system) instructions. The bits are tested every time an instruction accesses that location. ![](https://i.imgur.com/lIVWAPZ.png) ## Virtual Memory: Segmentation, Paging ## Segmentation More modern way to handle memory. Each logical part of a program we handle separately segmentation, involves the simple notion of dividing a program into separate pieces. In other words, segmentation allows a program to be divided into many pieces having different access rights. The operating system must maintain a table of segment names and their true addresses. ![](https://i.imgur.com/uJAV3Zq.png) ![](https://i.imgur.com/ThjYxrX.png) We should have translation table. When those programmes are finished we can remove those segments. And when new programmes are added we can use those holes. But we have problem when we have segments that need bigger space than those segments ![](https://i.imgur.com/N7Z68lm.png) ## Paging Each logical part of program (segment) needs many memory pages. We don't split the program in the logical size but we just split it in pages. These approch allow these pages to be used easily by any other program when the current program is done and its pages are removed. But it hard to get the security, because if the given segement is divided into 1000 pages we have to replicate those security things in all pages for this segement from book: The program is divided into equal-sized pieces called pages, and memory is divided into equal-sized units called page frames. Each address is again translated by a process similar to that of segmentation: The operating system maintains a table of user page numbers and their true addresses in memory. Paging allows the security advantages of segmentation with more efficient memory management. ![](https://i.imgur.com/LBpn7dc.png) ### Difficlty to apply security on Paging ![](https://i.imgur.com/mMZv0kI.png) ## Best of both Segmentation and Paging We do both.The program is splitted in segments, and we have segement table where we can put the security and before putting them in memory we can split them into pages. In reality all those translations can be fetched from cache ![](https://i.imgur.com/si7tc8O.png) ## Authentication • Identification is the act of asserting who a person is. • Authentication is the act of proving that asserted identity: that the person is who she says she is. Identities are typically public or well known. Authentication should be private ![](https://i.imgur.com/ZLmFaqt.png) ## Something you know **Dictionary Attacks** Several network sites post dictionaries of phrases, science fiction character names, places, mythological names, Chinese words, Yiddish words, and other specialized lists. These lists help site administrators identify users who have chosen weak passwords, but the same dictionaries can also be used by attackers of sites that do not have such attentive administrators. **Rainbow table**: precomputed list of popular values, such as passwords **Salt**: user-specific component joined to an encrypted password to distinguish identical passwords ![](https://i.imgur.com/Zaq4kpZ.png) ## Distribution of Password Types ![](https://i.imgur.com/Nh0zO0x.png) ## Password Storage ![](https://i.imgur.com/N3U0Cz8.png) ## Biometrics (Something the user is) **False positive**: incorrectly confirming an identity. **False negative**: incorrectly denying an identity Biometric matches are not exact; the issue is whether the rate of false positives and false negatives is acceptable. ![](https://i.imgur.com/0QWai7W.png) ![](https://i.imgur.com/9Rx6azr.png) ![](https://i.imgur.com/vAxCA98.png) ## Tokens (Something the user has) **passive tokens** do nothing, and active ones take some action. A photo or key is an example of a passive token in that the contents of the token never change. **An active token** can have some variability or interaction with its surroundings The value of a **static token** remains fixed Tokens are vulnerable to an attack called skimming. **Skimming** is the use of a device to copy authentication data surreptitiously and relay it to an attacker **Dynamic tokens** have computing power on the token to change their internal state. ![](https://i.imgur.com/H79nqBT.png) Each token generates a distinct, virtually unpredictable series of numbers that change every minute, so the authentication system knows what number to expect from your token at any moment. In this way, two people can have SecurID tokens, but each token authenticates only its assigned owner. Entering the number from another token does not pass your authentication. And because the token generates a new number every minute, entering the number from a previous authentication fails as well. ## Federated Identity Management Someone else is authenticating you and allow you to get into the system **A federated identity management** scheme is a union of separate identification and authentication systems Federated identity management unifies the identification and authentication process for a group of systems. ![](https://i.imgur.com/1Hq2kE8.png) ## Single Sign-On Single sign-on takes over sign-on and authentication to several independent systems for a user. ![](https://i.imgur.com/7Oh25vi.png) The difference between these two approaches is that federated identity management involves a single identity management module that replaces identification and authentication in all other systems. Thus all these systems invoke the identity management module. With single sign-on, systems still call for individual identification and authentication, but the umbrella task performs those interactions on behalf of the user. ## Access Control Access control: limiting who can access what in what ways ![](https://i.imgur.com/AOW89XZ.png) ## Access Policies Least privilege: access to the fewest resources necessary to complete some task Tracking: Has someone been around for a long time and so has acquired a large number of no-longer-needed rights? By granularity we mean the fineness or specificity of access control ![](https://i.imgur.com/7awuJXA.png) ## Reference Monitor **Reference monitor**: access control that is always invoked, tamperproof, and verifiable Each access should be checked by this reference monitor. And it has to be tamperfri The reference monitor separates subjects and objects, enforcing that a subject can access only those objects expressly allowed by security policy. A reference monitor is not necessarily a single piece of code; rather, it is the collection of access controls for devices, files, memory, interprocess communication, and other kinds of objects ![](https://i.imgur.com/QDkU7Fh.png) ![](https://i.imgur.com/L1RmIRc.png) ## Access Control Directory Each user has this directory. Each user has a file directory, which lists all the files to which that user has access. ![](https://i.imgur.com/m1PDEMw.png) ## Access Control Matrix (privilege list) we can use an access control matrix, a table in which each row represents a subject, each column represents an object, and each entry is the set of access rights for that subject to that object It makes it easier than access control directory. We have all users and all files in matri. so if the file is deleted we can delete it from the matrix and no need to delete it from every single user separately. But if we have many users and many files it will be giant matrix which will make it hard to manage it ![](https://i.imgur.com/miSMj2F.png) ## Access Control List There is one such list for each object, and the list shows all subjects who should have access to the object and what their access is. it is more compact than Matrix becuase in Martrix we have many empty fields, but the access control list only contains what we actually have ![](https://i.imgur.com/Z8X4XPj.png) ## Capability Capability: Single- or multi-use ticket to access an object or service ## Principles of Secure OS Design **Layered Design**: a nontrivial operating system consists of at least four levels:hardware, kernel, operating system, and user. Each of these layers can include sublayers. **Layering ensures that a security problem affects only less sensitive layers.** ![](https://i.imgur.com/wX7s2DX.png) ## Kernelized Design primitive functions of an operating system are called **kernel functions**, because they are basic to enforcing security as well as the other higher-level operations an operating system provides ![](https://i.imgur.com/vTgZVTg.png) ![](https://i.imgur.com/iCPG4cY.png) ## Trusted Systems ![](https://i.imgur.com/Ky8sYRU.png) ## Trusted Computing Base TCB The **trusted computing base**, or TCB, is the name we give to everything in the trusted operating system that is necessary to enforce the security policy. **TCB Design** The division of the operating system into TCB and non-TCB aspects is convenient for designers and developers because it means that all security-relevant code is located in one (logical) part. code outside the TCB can be changed at will, without affecting the TCB’s ability to enforce security ![](https://i.imgur.com/gNCYFFY.png) ## Trusted Platfrom Module TCB: Trusted Computing Base ![](https://i.imgur.com/v7J7ULd.png) ## Other Trusted Sytem Characteristics The trusted path in Windows is like if you enter: alt + ctrl + delete and you come to task manager so you know that you are communicating with windows Secure startup ensures no malicious code can block or interfere with security enforcement. ![](https://i.imgur.com/3qLqkcv.png) ## History of Trusted Systems ![](https://i.imgur.com/Nuc4HgH.png) ## Common Criteria **Common Criteria**: Multinational standard for security evaluation separates criteria into functionality and effectiveness ![](https://i.imgur.com/AyzGBQE.png) ![](https://i.imgur.com/5fwQJ6x.png) ![](https://i.imgur.com/aGY6XwS.png) ![](https://i.imgur.com/TiaUcdc.png) ## CC Functional Requirements ![](https://i.imgur.com/lg3fppp.png) ## CC Assurance Requirements ![](https://i.imgur.com/MXOqibQ.png) ## Protection Profiles ![](https://i.imgur.com/EA8bkjS.png) ![](https://i.imgur.com/uV8RJ7M.png) ## Security Targets (ST) ![](https://i.imgur.com/LdqrZSK.png) ## Commoin Criteria Classes, Families and Components ![](https://i.imgur.com/FWHKBoc.png) ![](https://i.imgur.com/hu4AycM.png) ![](https://i.imgur.com/Q87kIY0.png) ## Evaluation Assurance Level 1 - 4 ![](https://i.imgur.com/ftQqcWA.png) ## Evaluation Assurance Level 5 - 7 ![](https://i.imgur.com/aneKfJj.png) ## Example: Windows 2000 EAL 4+ it has been tested agains Common Criteria ![](https://i.imgur.com/fso4oeA.png) they got the certificate ![](https://i.imgur.com/OT92xqR.png) ![](https://i.imgur.com/BUoDP1A.png) Problem with CC that it is only test a specific version but those systems has updates continously ## Examples EAL7 products ![](https://i.imgur.com/2JE9Tua.png) ## CC Critcisms ![](https://i.imgur.com/uLiN7p5.png) ## Where is CC going now? ![](https://i.imgur.com/n2x7r2K.png) ![](https://i.imgur.com/UlcaZdM.png) ## EU Cybersecurity Act ![](https://i.imgur.com/jXHT9SS.png) ## Rootkit Rootkit: Tool or script that obtains privileges of root Splicing: a technique allowing third-party code to be invoked to service interrupts and device driver calls # Lecture 10 # Database ## Database Terms ![](https://i.imgur.com/GGUv2ma.png) **A database** is a collection of data and a set of rules that organize the data by specifying certain relationships among the data **A database administrator** is a person who defines the rules that organize the data and also controls who should have access to what parts of the data. The user interacts with the database through a program called a database manager or a **database management system (DBMS)** The database file consists of **records**, each of which contains one related group of data. Each record contains fields or elements The logical structure of a database is called **a schema**. A particular user may have access to only part of the database, called a **subschema** The rules of a database identify the columns with names. The name of each column is called an **attribute** of the database. A **relation** is a set of columns. Relations in a database show some connection among data in tables. ## Example ![](https://i.imgur.com/bokKS5o.png) ![](https://i.imgur.com/JRf2BY1.png) ## Queries ![](https://i.imgur.com/kx4Ebj6.png) ## Example ![](https://i.imgur.com/JqBRCyL.png) ## Advantages ![](https://i.imgur.com/HB6aW7n.png) ## Distributed Databases ![](https://i.imgur.com/IRxMj6M.png) ## Multilevel Databases ![](https://i.imgur.com/5R7Zma0.png) ## Database Security Requirements ![](https://i.imgur.com/Uj6qvdO.png) ![](https://i.imgur.com/9N7nV3Y.png) The third means of providing database integrity is maintaining **a change log** for the database. A change log lists every change made to the database; it contains both original and modified values ## Reliability and Integrity ![](https://i.imgur.com/uxx2o4O.png) ## Two-Phase Update ![](https://i.imgur.com/nzCsgrh.png) ## Other Database Security Concerns ![](https://i.imgur.com/mKJ39pC.png) ## Sensitive Data ![](https://i.imgur.com/1pXCWue.png) ## Inference A database manager can control access by direct queries; disclosure can occur in more subtle ways that are harder to control. **Inference** is a way to infer or derive sensitive data from nonsensitive data. The inference problem is a subtle vulnerability in database security. ![](https://i.imgur.com/RIXWI1O.png) ### Direct Attack ![](https://i.imgur.com/ZErEhzW.png) ### Example ![](https://i.imgur.com/dbgfDVl.png) ![](https://i.imgur.com/zDpXrxy.png) ### Indirect Attack ![](https://i.imgur.com/nqmgTC2.png) **A tracker attack** can fool the database manager into locating the desired data by using additional queries that produce small results. The tracker adds additional records to be retrieved for two different queries; the two sets of records cancel each other out, leaving only the statistic or data desired Inference is difficult to control because it can occur from algebraic calculations beyond the scope of database management systems. ### Example ![](https://i.imgur.com/JF6CSAw.png) ![](https://i.imgur.com/6v0Cl0j.png) ![](https://i.imgur.com/mbFuBnn.png) ![](https://i.imgur.com/gMMmNEv.png) ## Types of Disclosures ![](https://i.imgur.com/pjTDZIl.png) Aggregation is similar to inference Related to the inference problem is **aggregation**, which means building sensitive results from less sensitive inputs Aggregation is nearly impossible for a database management system to control because combining the data can occur outside the system, even by multiple colluding users. ## Security vs Precision precision, aims to protect all sensitive data while revealing as much nonsensitive data as possible. ![](https://i.imgur.com/VfQcvu9.png) ## Suppression Techniques Suppression and concealing are two controls applied to data items. **With suppression**, sensitive data values are not forthcoming; the query is rejected without response. **With concealing**, the answer is close to but not exactly the actual value. **Limited response suppression** eliminates certain low-frequency elements from being displayed example for combined results: **ranges:** ![](https://i.imgur.com/T6LMEWE.png) **Rounding** ![](https://i.imgur.com/Ussf7eZ.png) With **random sample** control, a result is not derived from the whole database; instead the result is computed on a random sample of the database **Blocking Small Sample Sizes** Organizations that publish personal statistical data, such as the U.S. Census Bureau, do not reveal results when a small number of people make up a large proportion of a category. **Swapping** like swapping the user id, or any other field ex. The sex for Bailey and Chin might be interchanged, ![](https://i.imgur.com/ae3ZQTM.png) ## Conclusions on Inference ![](https://i.imgur.com/b65Ezg3.png) ## Multilevel Databases ![](https://i.imgur.com/D6H8pyW.png) ## Proposals for Multilevel Security partitioning have problem with syncing Encryption is costly to do on every query ![](https://i.imgur.com/7ODd7hE.png) ## Data Mining Use of massive amounts of data from varied sources is often referred to as **big data** ![](https://i.imgur.com/JdwKDs4.png) ## Data Mining Challenges Correcting: One important goal of databases is to have a record in one place so that one correction serves all uses. With data mining, a result is an aggregate from multiple data bases. There is no natural way to work backward from the result to the amalgamated databases to findand correct errors Privacy: Inference works on big data just as it does in databases. Granular Access Control: A process can access only those objects or the specific data consistent with security policy and necessary for the task at hand Secure Data Storage: If one data store becomes so full that performance suffers, controllers utomatically split the data and move some elsewhere. The application developer generally does not know, much less care, where the data are physically stored. suppose the data are housed in a country whose ruler decides to nationalize all foreign-held assets. Or consider a locale where hungry citizens storm an installation to steal anything they can later resell as scrap in order to buy food. Transaction Logs: Determining what to track is challenging, however: Too little tracking can limit the usefulness of the access logs, but too much data can overwhelm humans and technology, making it difficult to find the proverbial needle in a haystack of accesses. Tracking access is expensive, especially if accesses are numerous; detailed access auditing is uncommon for big data. Real-time security monitoring: Big data architectures involve nimble movement of data and computation, but the connecting network may be a large shared network, often the Internet. Real-time security monitoring is not intended for complex, shared, fluid network architectures Performance tends to outweigh accuracy or security for data-mining applications. ![](https://i.imgur.com/gMi58gR.png) ## SQL Injection Attacks ![](https://i.imgur.com/UGTByOW.png)