500 likes | 628 Views
Computer System Security CSE 5339/7339. Lecture 14 October 5, 2004. Contents. A3 in Electronic Signatures (Cont.) Operating Systems Security Protection Authentication Access Control Padmaraj’s presentation. Digital Signature Using RSA.
E N D
Computer System SecurityCSE 5339/7339 Lecture 14 October 5, 2004
Contents • A3 in • Electronic Signatures (Cont.) • Operating Systems Security • Protection • Authentication • Access Control • Padmaraj’s presentation
Digital Signature Using RSA • The RSA public-key cryptosystem can be used to create a digital signature for a message m. • The signer must have an RSA public/private key pair.
RSA Review • C = Pe mod n • P = Cd mod n • P = Cd mod n = (Pe)d mod n = (Pd)e mod n
Key Choice (RSA Review) • We start by selecting n to be a very large integer (product of two large primes p and q) • Next a large integer e is chosen so that e is relatively prime to (p-1) * (q-1). • Finally, select d such that e * d = 1 mod (p-1) * (q-1)
Example (RSA Review) • Select primes p=11, q=3. • n = p* q = 11*3 = 33 • Choose e = 3Check gcd(e, p-1) = gcd(3, 10) = 1 (i.e. 3 and 10 have no common factors except 1),and check gcd(e, q-1) = gcd(3, 2) = 1therefore gcd(e, (p-1)(q-1)) = gcd(3, 20) = 1 • Compute d such that e* d = 1 (mod (p-1)*(q-1))d = 7 • Public key = (n, e) = (33, 3)Private key = (n, d) = (33, 7).
Message Signature Generation (Signer) Redundancy Function Formatted Message Encrypt Private Key Signature
Signature Verification Signature Public Key Decrypt Formatted Message Verify Message
Example (generate signature S) -- Signer end d = 53 e = 413 n = 629 m = 250 Assume that R(X) = X S = R(m)e mod n S = 25053 mod 629 = 411
Example (verify signature with message recovery) Public key (e) = 413 n = 629 S = 411 R(m) = Se mod n R(m) = 411413 mod 629 = 250 The verifier then checks that R(m) has the proper redundancy created by R (none in this case) and recover the message: m = R-1(m) = 250
Creating a forged signature Choose a random number between 0 and n-1 for S S = 323 Use the signer’s public key to decrypt S R(m) = 323413 mod 629 = 85 Invert R(m) to m: m = 85 Note that a valid signature (323) has been created for a random message (85) without the knowledge of the signer’s private key. The choice of a poor redundancy function can make RSA vulnerable to forgery.
Selecting a Good Redundancy Function • A good redundancy function should make forging signatures much harder.
Example (generate signature S) -- Signer end d = 53 e = 413 n = 629 m = 7 Assume that R(X) = XX S = R(m)e mod n S = 7753 mod 629 = 25
Example (verify signature with message recovery) Public key (e) = 413 n = 629 S = 25 R(m) = Se mod n R(m) = 25413 mod 629 = 77 The verifier then checks that R(m) is of the form XX for some message X. It is, and we recover the message: m = R-1(m) = 7
Forging signature (revisited) Choose a random number between 0 and n-1 for S S = 323 Use the signer’s public key to decrypt S R(m) = 323413 mod 629 = 85 However, 85 is not a legal value for R(m), so S = 323 is not a valid signature
Getting a Message Digest from a document Hash Message Digest
Generating Signature Message Digest Signature Encrypt using private key
Appending Signature to document Append Signature
Verifying Signature Hash Message Digest Message Digest Decrypt using public key
Operating System Security (Chapter 4) • Protection in General Purpose OS • Authorization/Authentication • Access Control
Memory and Address Protection Bare Machine 0 user memory n
Memory and Address Protection (cont.) Resident Monitor 0 user Monitor Fence register memory n
Address Protection for a resident monitor Fence register 0 memory CPU address Address >= fence true false error n
Other Issues • Multiprogramming • Multiple users • Relocation • Segmentation, paging, combined
Segmentation Segment Table limit base 0 memory CPU (s,d) < true + false n error
paging Page Table f 0 memory CPU p d f d Logical address Physical address n
User Authentication • Knowledge-based techniques (passwords) • Token-based techniques (smart cards) • Biometric techniques (fingerprint) • Two-factor (Card + PIN)
Passwords • Protected Password table • Unprotected Password table with one way hash functions • Attacks
Access Control Policies • Specification of how each user is authorized to use each resource. • In practice, no computer applies a single policy to manage all of its resources. • Scheduling algorithms for CPU SJF, RR • Storage paging, segmentation
ACCESS Control Matrix Every object to be protected is within one or more protection domains O2 Domain 1 O1 Domain 2 Domain 3 O2 O4 O1 O3
ACCESS Rights <O2, {execute}> <O1, {read,write}> Domain 1 Domain 3 Domain 2 <O1, {execute}> <O3, {read}> <O2, {write}> <O4, {print}>
What does that mean? • O1 can be read and written in domain 1 and executed in domain 3, O2 can be executed in domain 1 and written in domain 2, O3 can be read in domain 3, and O4 can be printed in domains 2 and 3. • At any given time, the domain is which a user is operating determines what actions are and are not permitted. • If Matthew is in domain 1, he is permitted to: • Read or write object 1 • Execute object 2
Access Control Matrix (cont.) • The matrix designates the protection policy. A mechanism is required to enforce the policy. • The OS stores the matrix in memory • Large and sparse matrix • Ordered triples instead
List of Ordered Triples (Domain 1, Object 1, {read,write}) (Domain 1, Object 2, {execute}) (Domain 2, Object 2, {write}) (Domain 2, Object 4, {print}) (Domain 3, Object 1, {execute}) (Domain 3, Object 3, {read}) (Domain 3, Object 4, {print})
List of Ordered Triples (Cont.) For each attempt by a user in Domain i to perform operation O on object j, the OS consults the list of triples. If it finds a triple (i,j,R) where O is a member of the access rights, R, the operation is allowed to proceed; otherwise it is not. The list must be protected from tampering by users Could be very large Search may become a problem Does not take advantage of special grouping of objects
Access lists Object 1: (<Domain 1, {read,write}>, < Domain 3, {execute}>) Object 2: (< Domain 1, {execute} >, < Domain 2, {write} >) Object 3: (<Domain 3, {read}>) Object 4: (<Domain 2, {print}>, < Domain 3, {print} >) An attempt by a user in Domain i to perform operation O on object j causes the OS to consult the entry of the access list for object j. Object j’s list is searched for Domain i’s entry, and the operation is permitted if there is an access right for O.
Default Object 2: (<Default, {read}>, < Domain 1, {execute} >, < Domain 2, {write} >)
Capability List (Object, rights) capability Domain 1: (<Object 1, {read,write}>, < Object 2, {execute}>) Domain 2: (< Object 2, {write} >, < Object 4, {print} >) Domain 3: (<Object 1, {execute>, <Object 3, {read}> < Object 4, {print} >) Users are given a copy of the capability list for the domain in which they are operating .
How does it work? Domain 1: (<Object 1, {read,write}>, < Object 2, {execute}>) Domain 2: (< Object 2, {write} >, < Object 4, {print} >) Domain 3: (<Object 1, {execute>, <Object 3, {read}> < Object 4, {print} >) When a user wants to perform some operation O, on object j, it passes its capability for j as one of the parameters of O. For example, a user might request to write to Object 2 and passes its copy of <object 2, {write}>. The OS verifies.
Encrypting Capabilities • OS must ensure that users cannot create their own capabilities or alter capabilities they are given. • OS may encrypt capabilities using a secret key before giving them to users. • The OS decrypts and checks the capability each time it is used.
HRU Model (cont.) • HRU allows the state of the protraction system to be changed by a well defined set of commands: • Add subject s to M • Add object o to M • Delete subject s from M • Delete object o from M • Add right r to M[s,o] • Delete right r from M[s,o] Owner can change rights of an object
Take Grant Model • Unlimited number of subjects and objects • States and state transitions • Directed graph • Four primitive operations: • take • create • grant • revoke
Take Grant Model (Cont.) S2 read O2 execute Read, write read O1 O3 S1 read execute S3
Create S O S becomes rights
Revoke S O S O becomes r1, r2 r1, r2, r3
Take S2 O S1 read take becomes read S2 O S1 read take
Grant read S2 O S1 grant becomes read S2 O S1 read grant