CIT 380 Securing Computer Systems Passwords CIT 380

  • Slides: 40
Download presentation
CIT 380: Securing Computer Systems Passwords CIT 380: Securing Computer Systems 1

CIT 380: Securing Computer Systems Passwords CIT 380: Securing Computer Systems 1

Topics 1. 2. 3. 4. 5. 6. Password Systems Password Cracking Hashing and Salting

Topics 1. 2. 3. 4. 5. 6. Password Systems Password Cracking Hashing and Salting Password Selection Graphical Passwords One-time Passwords CIT 380: Securing Computer Systems 2

Authentication System A: set of authentication information – information used by entities to prove

Authentication System A: set of authentication information – information used by entities to prove identity C: set of complementary information – information stored by system to validate A F: set of complementation functions f : A → C – generate C from A L: set of authentication functions l: A C→{T, F} – verify identity S: set of selection functions – enable entity to create or alter A or C CIT 380: Securing Computer Systems 3

Password System Example User authenticates with 8 -character alphanumeric password. System compares against stored

Password System Example User authenticates with 8 -character alphanumeric password. System compares against stored cleartext password. A = [A-Za-z 0 -9]{8} C=A F={I} L={=} Not a system that anyone should actually use. CIT 380: Securing Computer Systems 4

Biometric System Example User authenticates with fingerprint. System compares w/ digital fingerprint template. A

Biometric System Example User authenticates with fingerprint. System compares w/ digital fingerprint template. A = { user fingerprints } C = { digital fingerprint templates } F = { fingerprint reader + analog->digital } L = { tunable similarity function } CIT 380: Securing Computer Systems 5

Passwords What you know Sequence of characters Complementation Function – Identity: requires access control

Passwords What you know Sequence of characters Complementation Function – Identity: requires access control to protect C – One-way Hash • easy to compute c = f(a) • difficult to compute a = f-1(c) CIT 380: Securing Computer Systems 6

Classic UNIX Passwords Format: Up to 8 ASCII characters – A contains 6. 9

Classic UNIX Passwords Format: Up to 8 ASCII characters – A contains 6. 9 x 1016 possible passwords – C contains crypt hashes, strings of length 13 chosen from alphabet of 64 characters, 3. 0 x 1023 strings Storage – /etc/passwd (0644) was traditionally used – /etc/shadow (0600) in modern systems CIT 380: Securing Computer Systems 7

Password Cracking Get Hashed Password pwhash word = Next word from list List of

Password Cracking Get Hashed Password pwhash word = Next word from list List of potential passwords. wordhash = Hash(word) wordhash == pwhash False True word is pw CIT 380: Securing Computer Systems 8

Cracking Methods 1. List of common passwords 2. List of English/foreign words 3. Permutation

Cracking Methods 1. List of common passwords 2. List of English/foreign words 3. Permutation rules – Substitute numbers/symbols for letters – Change case, pluralize, reverse words, character shifts, digit/symbol prefix/postfix, joining words 4. Brute force – All possible passwords CIT 380: Securing Computer Systems 9

Making Password Guessing Easier Web sites will e-mail you password if you answer a

Making Password Guessing Easier Web sites will e-mail you password if you answer a simple “secret” question: 1. What is your favorite color? 2. What is your pet’s name? 3. What is your mother’s maiden name? Violation of fail-safe defaults Failover to less secure protocol. How many favorite colors are there? CIT 380: Securing Computer Systems 10

Countering Password Guessing Choose A, C, and F to select suitably low probability P(T)

Countering Password Guessing Choose A, C, and F to select suitably low probability P(T) of guessing in time T. P(T) >= TG / N – G is number of guess per time unit T – T is number of time units in attack – N is number of possible passwords CIT 380: Securing Computer Systems 11

Calculating Minimum Password Length Password System – There are 96 allowable characters in password.

Calculating Minimum Password Length Password System – There are 96 allowable characters in password. – System allows 106 guesses/second. – Requirement: probablility of success guess should be 0. 5 over 365 -day period. What should the minimum password length be? – N >= TG/P – N >= (365 x 24 x 60) x 106 / 0. 5 = 6. 31 x 1013 – N= S S 96 , where i ranges from 1 to length of password i – 96 i >= N = 6. 31 x 1013 is true when largest i >= 8 – The minimum required password length is 8. CIT 380: Securing Computer Systems 12

UNIX Password Hashing crypt() function used for hashing – DES encrypts 64 -bit block

UNIX Password Hashing crypt() function used for hashing – DES encrypts 64 -bit block of 0 s (25 rounds) using your password for the key. • Modified DES incompatible with DES hardware cracking tools. – Limited to 8 characters or less. – If limited to 95 printable characters, only 253 possible passwords. – How to resist dictionary attacks? Salting CIT 380: Securing Computer Systems 13

Salting Adds a 2 -character (12 -bit) random, public data to password to create

Salting Adds a 2 -character (12 -bit) random, public data to password to create key. Any word may be encrypted in 4096 possible ways (i. e. , there are 4096 f F). – Your password always uses same salt. – Someone else with same password (a) probably has different salt, and thus different c = f(a). Number of possible keys increased to 266 – Too small for today; modern UNIX doesn’t use crypt. CIT 380: Securing Computer Systems 14

Salting (cont. ) Prevents pre-calculated dictionary attack – 266 passwords requires millions of terabytes

Salting (cont. ) Prevents pre-calculated dictionary attack – 266 passwords requires millions of terabytes crypt() 218 passwords/second – Brute force would require 8000 machines for 48 days. CIT 380: Securing Computer Systems 15

Modern UNIX Passwords • Format: long ASCII string • Hashing techniques: – MD 5

Modern UNIX Passwords • Format: long ASCII string • Hashing techniques: – MD 5 (unlimited length, 12 -48 bit salt) – SHA 1 (unlimited length, 12 -48 bit salt) – Bcrypt (55 chars, 128 -bit salt, adjustable cost) CIT 380: Securing Computer Systems 16

Windows 2000/XP Passwords Storage – – %systemroot%system 32configsam locked while NT running %systemroot%repairsam_ backup

Windows 2000/XP Passwords Storage – – %systemroot%system 32configsam locked while NT running %systemroot%repairsam_ backup file may be accessible via remote registry calls Format – LAN Manager (LM) Hash – NT (MD 4) Hash CIT 380: Securing Computer Systems 17

Windows LM Hash Algorithm 1. Password fitted to 14 character length by truncating or

Windows LM Hash Algorithm 1. Password fitted to 14 character length by truncating or padding with 0 s. 2. Password converted to upper case. 3. Password divided into two 7 -byte halves. 4. Each half used as DES key to encrypt same 8 -byte constant. 5. Resultant strings merged to form a 16 -byte hash value. CIT 380: Securing Computer Systems 18

Windows LM Hash Problems Last 8 bytes of c known if password < 7

Windows LM Hash Problems Last 8 bytes of c known if password < 7 chars. Dividing password into halves reducing problem of breaking 14 -character password to breaking two 7 character passwords. Conversion to upper case reduces character set. Dictionary of password hashes can be prebuilt – Number of possible passwords much smaller than DES space. – No salt is used. CIT 380: Securing Computer Systems 19

Windows NT Hash Converts to Unicode, MD 4 hashes result Caveat: Often used in

Windows NT Hash Converts to Unicode, MD 4 hashes result Caveat: Often used in conjunction with LM hash, which is required for backwards compatibility. No salt: identical passwords generate identical hashes. CIT 380: Securing Computer Systems 20

Password Selection 1. Random Selection 2. Pronounceable Passwords 3. User Selection CIT 380: Securing

Password Selection 1. Random Selection 2. Pronounceable Passwords 3. User Selection CIT 380: Securing Computer Systems 21

Random Selection Yields equal distribution of passwords for maximum difficulty in cracking – What

Random Selection Yields equal distribution of passwords for maximum difficulty in cracking – What about short passwords? Random passwords aren’t easy to remember – Short term memory holds 7 +/- 2 items – People have multiple passwords – Principle of Psychological Acceptability Requires a good PRNG CIT 380: Securing Computer Systems 22

Random Selection (Bad)Example PDP-11 password generator – – 16 -bit machine 8 upper-case letters

Random Selection (Bad)Example PDP-11 password generator – – 16 -bit machine 8 upper-case letters and digits |P| = 368 = 2. 8 x 1012 At 0. 00156 sec/encryption, 140 years to brute force PRNG had period of 216 – 1 – Only 65, 535 possible passwords – Requires 102 seconds to try all passwords CIT 380: Securing Computer Systems 23

Pronounceable Passwords Generate passwords from random phonemes instead of random characters. – People can

Pronounceable Passwords Generate passwords from random phonemes instead of random characters. – People can remember password as sequence of audible phonemes instead of characters, allowing easy recall of longer passwords. – Fewer pronounceable passwords exist than random passwords. CIT 380: Securing Computer Systems 24

User Selection Allow users to choose passwords. Reject insecure passwords based on ruleset: 1.

User Selection Allow users to choose passwords. Reject insecure passwords based on ruleset: 1. 2. 3. 4. 5. 6. 7. 8. Based on account, user, or host names Dictionary words Permuted dictionary words Patterns from keyboard Shorter than 6 characters Digits, lowercase, or uppercase only passwords License plates or acronyms Based on previously used passwords CIT 380: Securing Computer Systems 25

Human Randomness? CIT 380: Securing Computer Systems 26

Human Randomness? CIT 380: Securing Computer Systems 26

Bad Passwords • • • • 123456 letmein password 12345678 dragon qwerty michael 654321

Bad Passwords • • • • 123456 letmein password 12345678 dragon qwerty michael 654321 harley ranger iwantu xxxxxxx turtle united • • • • porsche guitar black diamond nascar jun 0389 06031989 amanda phoenix mickey tigers purple xmen 94 aaaaaa • • • • CIT 380: Securing Computer Systems prince beach amateur ncc 1701 tennis startrek swimming kitty rainbox 112233 232323 giants enter 0 cupcake • • • • 8675309 marlboro newyork diablo sexsex access 14 abgrtyu 123123 dragon 123 applepie 31415926 99 skip just 4 fun xcvb typewriter 27

How to Select Good Passwords 1. Long passwords, consisting of multiple words. . Use

How to Select Good Passwords 1. Long passwords, consisting of multiple words. . Use nth letter of each word if phrase too long. 2. Themes: 1. 2. 3. 4. 5. 6. 7. Word combinations: 3 blind katz E-mail or URL: yoda@strong-this-password-is. net Phone number: (888) 888 -eight Bracketing: Starfleet -> *!-Starfleet-!* Add a word: shopping -> Goin’ shopping Repetition: Pirate--Pirate. Ship Letter swapping: Sour Grape -> Gour Srape CIT 380: Securing Computer Systems 28

Guessing via Authentication Fns If complements not accessible, attacker must use authentication functions. Cannot

Guessing via Authentication Fns If complements not accessible, attacker must use authentication functions. Cannot be prevented. Increase difficulty of auth function attack: Backoff: increasing wait before reprompting. Disconnection: disconnect after n failures. Disabling: disable account after n failures. Jailing: permit access to limited system, so admins can observe attacker. CIT 380: Securing Computer Systems 29

Password Aging Requirement that password be changed after a period of time or after

Password Aging Requirement that password be changed after a period of time or after an event has occurred If expected time to guess is 180 days, should change password more frequently than 180 days 1. If change time too short, users have difficulty recalling passwords. 2. Cannot allow users to change password to current one. 3. Also prevent users from changing passwords too soon. 4. Give notice of impending password change requirement. CIT 380: Securing Computer Systems 30

Graphical Passwords • Face Scheme: Password is sequence of faces, each chosen from a

Graphical Passwords • Face Scheme: Password is sequence of faces, each chosen from a grid of 9 faces. • Story Scheme: Password is sequence of images, each chosen from a grid of 9, to form a story. CIT 380: Securing Computer Systems 31

Challenge-Response Problem: passwords are reusable, and thus subject to replay attacks. Solution: authenticate in

Challenge-Response Problem: passwords are reusable, and thus subject to replay attacks. Solution: authenticate in such a way that the transmitted password changes each time. CIT 380: Securing Computer Systems 32

One-Time Passwords A password that’s invalidated once used. Challenge: number of auth attempt Response:

One-Time Passwords A password that’s invalidated once used. Challenge: number of auth attempt Response: one-time password Problems – Generation of one-time passwords • Use hash or crytographic function – Synchronization of the user and the system • Number or timestamp passwords CIT 380: Securing Computer Systems 33

S/Key One-time password system based on a hash function h (MD 4 or MD

S/Key One-time password system based on a hash function h (MD 4 or MD 5). User initializes with random seed k. Key generator calculates: h(k) = k 1, h(k 1) = k 2, …, h(kn-1) = kn Passwords, in order used, are p 1 = kn, p 2 = kn-1, …, pn-1= k 2, pn= k 1 CIT 380: Securing Computer Systems 34

S/Key Attacker cannot derive pi+1 from pi since pi = kn-i+1, pi+1 = kn-i,

S/Key Attacker cannot derive pi+1 from pi since pi = kn-i+1, pi+1 = kn-i, and h(kn-i) = kn-i+1 which would require inverting h. Once user has used all passwords, S/Key must be re-initialized with a new seed. CIT 380: Securing Computer Systems 35

S/Key Login 1. User supplies account name to server 2. Server replies with number

S/Key Login 1. User supplies account name to server 2. Server replies with number i stored in skeykeys file 3. User supplies corresponding password pi 4. Server computes h(pi) = h(kn-i+1) = kn-i+2 = pi-1 and compares result with stored password. If match, user is authenticated and S/Key updates number in skeykeys file to i-1 and stores pi CIT 380: Securing Computer Systems 36

S/Key Login Free. BSD/i 386 (example. com) (ttypa) login: <username> s/key 97 fw 13894

S/Key Login Free. BSD/i 386 (example. com) (ttypa) login: <username> s/key 97 fw 13894 Password: Use S/Key calculator on local system to calculate response: % key 97 fw 13894 Enter secret password: WELD LIP ACTS ENDS ME HAAG CIT 380: Securing Computer Systems 37

Other One Time Password Systems Software: OPIE – Backwards compatible with S/Key (if same

Other One Time Password Systems Software: OPIE – Backwards compatible with S/Key (if same hash used). Hardware: RSA Secur. ID card – Displayed password changes every 60 sec. – Password = constant password + Secur. ID CIT 380: Securing Computer Systems 38

Key Points • Good passwords need to be – Complex – Unique – Secret

Key Points • Good passwords need to be – Complex – Unique – Secret – Changed on a regular basis • Stored passwords are secured via – Hashing (crypt, MD 5, SHA 1, bcrypt) – Salting • One-time passwords offer greater security. CIT 380: Securing Computer Systems 39

References 1. 2. 3. 4. 5. 6. 7. 8. Ross Anderson, Security Engineering, Wiley,

References 1. 2. 3. 4. 5. 6. 7. 8. Ross Anderson, Security Engineering, Wiley, 2001. Matt Bishop, Introduction to Computer Security, Addison-Wesley, 2005. Mark Burnett and Dave Kleiman, Perfect Passwords, Syngress, 2006. Lorie Faith Cranor and Simson Garfinkel, Security and Usability, O’Reilly, 2005. Cynthia Kuo et. al. , “Human Selection of Mnemonic Phrase-based Passwords, ” SOUPS 2006, http: //cups. cmu. edu/soups/2006/proceedings/p 67_kuo. pdf, 2006. Neils Provos and David Mazieres, “A Future-Adaptable Password Scheme, ” http: //www. openbsd. org/papers/bcrypt-paper. pdf, 2006. Ed Skoudis, Counter Hack Reloaded, Prentice Hall, 2006. Simson Garfinkel, Gene Spafford, and Alan Schwartz, Practical UNIX and Internet Security, 3/e O’Reilly, 2003. CIT 380: Securing Computer Systems 40