Engineering Secure Software. Networks, Crypto, & You.  Most application developers… Don’t implement networking protocols Don’t implement encryption algorithms.

Slides:



Advertisements
Similar presentations
Sonny J Zambrana University of Pennsylvania ISC-SEO November 2008.
Advertisements

Lecture 5: Cryptographic Hashes
Spring 2000CS 4611 Security Outline Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls.
NSRC Workshop Some fundamental security concerns... Confidentiality - could someone else read my data? Integrity - has my data been changed? Authentication.
 Key exchange o Kerberos o Digital certificates  Certificate authority structure o PGP, hierarchical model  Recovery from exposed keys o Revocation.
Cryptography Basic (cont)
Chapter 5 Cryptography Protecting principals communication in systems.
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
Secure communications Week 10 – Lecture 2. To summarise yesterday Security is a system issue Technology and security specialists are part of the system.
CMSC 414 Computer and Network Security Lecture 21 Jonathan Katz.
8-1 What is network security? Confidentiality: only sender, intended receiver should “understand” message contents m sender encrypts message m receiver.
Symmetric Key Distribution Protocol with Hybrid Crypto Systems Tony Nguyen.
Chap 3: Key exchange protocols In most systems, we distinguish the short term keys from the long term ones: –A short term key (session key) is used to.
Encryption An Overview. Fundamental problems Internet traffic goes through many networks and routers Many of those networks are broadcast media Sniffing.
Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m.
Network Security – Part 2 V.T. Raja, Ph.D., Oregon State University.
TrustPort Public Key Infrastructure. Keep It Secure Table of contents  Security of electronic communications  Using asymmetric cryptography.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Encryption. Introduction Computer security is the prevention of or protection against –access to information by unauthorized recipients –intentional but.
Digital Signature Xiaoyan Guo/ Xiaohang Luo/
CSCI 6962: Server-side Design and Programming
Sorting Out Digital Certificates Bill blog.codingoutloud.com ··· Boston Azure ··· 13·Dec·2012 ···
CRYPTOGRAPHY PROGRAMMING ON ANDROID Jinsheng Xu Associate Professor North Carolina A&T State University.
DNSSEC Cryptography Review Track 2 Workshop July 3, 2010 American Samoa Hervey Allen.
1 Cryptography Basics. 2 Cryptography Basic terminologies Symmetric key encryption Asymmetric key encryption Public Key Infrastructure Digital Certificates.
SYSTEM ADMINISTRATION Chapter 13 Security Protocols.
Lecture 19 Page 1 CS 111 Online Symmetric Cryptosystems C = E(K,P) P = D(K,C) E() and D() are not necessarily the same operations.
Masud Hasan Secue VS Hushmail Project 2.
8-1Network Security Chapter 8 roadmap 8.1 What is network security? 8.2 Principles of cryptography 8.3 Message integrity, authentication.
Network Security – Part 2 (Continued) Lecture Notes for May 8, 2006 V.T. Raja, Ph.D., Oregon State University.
Linux Networking and Security Chapter 8 Making Data Secure.
Authentication and Authorization Authentication is the process of verifying a principal’s identity (but how to define “identity”?) –Who the person is –Or,
Crypto Bro Rigby. History
Protecting Internet Communications: Encryption  Encryption: Process of transforming plain text or data into cipher text that cannot be read by anyone.
David Evans CS150: Computer Science University of Virginia Computer Science Class 31: Cookie Monsters and Semi-Secure.
Authentication Applications Unit 6. Kerberos In Greek and Roman mythology, is a multi-headed (usually three-headed) dog, or "hellhound” with a serpent's.
Chapter 17 Security. Information Systems Cryptography Key Exchange Protocols Password Combinatorics Other Security Issues 12-2.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 50 Cryptography, Privacy, and Digital Certificates.
1 Securing Data and Communication. 2 Module - Securing Data and Communication ♦ Overview Data and communication over public networks like Internet can.
23-1 Last time □ P2P □ Security ♦ Intro ♦ Principles of cryptography.
Week 4 - Wednesday.  What did we talk about last time?  RSA algorithm.
Encryption.
Internet-security.ppt-1 ( ) 2000 © Maximilian Riegel Maximilian Riegel Kommunikationsnetz Franken e.V. Internet Security Putting together the.
Encryption Questions answered in this lecture: How does encryption provide privacy? How does encryption provide authentication? What is public key encryption?
Public / Private Keys was a big year… DES: Adopted as an encryption standard by the US government. It was an open standard. The NSA calls it “One.
Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department.
14.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 14 Entity Authentication.
Encryption. Introduction The incredible growth of the Internet has excited businesses and consumers alike with its promise of changing the way we live.
Network Security Continued. Digital Signature You want to sign a document. Three conditions. – 1. The receiver can verify the identity of the sender.
Public Key Encryption, Secure WWW Transactions & Digital Signatures.
© Copyright 2009 SSLPost 01. © Copyright 2009 SSLPost 02 a recipient is sent an encrypted that contains data specific to that recipient the data.
CPS Computer Security Tutorial on Creating Certificates SSH Kerberos CPS 290Page 1.
CSCI 530 Lab Passwords. Overview Authentication Passwords Hashing Breaking Passwords Dictionary Hybrid Brute-Force Rainbow Tables Detection.
 Encryption provides confidentiality  Information is unreadable to anyone without knowledge of the key  Hashing provides integrity  Verify the integrity.
Information Systems Design and Development Security Precautions Computing Science.
Department of Computer Science Chapter 5 Introduction to Cryptography Semester 1.
CRYPTOGRAPHY Cryptography is art or science of transforming intelligible message to unintelligible and again transforming that message back to the original.
Web Applications Security Cryptography 1
Outline The basic authentication problem
Tutorial on Creating Certificates SSH Kerberos
Tutorial on Creating Certificates SSH Kerberos
SSH: SECURE LOGIN CONNECTIONS OVER THE INTERNET
Engineering Secure Software
Applied Cryptography part 2
Chapter 8 roadmap 8.1 What is network security?
Presentation transcript:

Engineering Secure Software

Networks, Crypto, & You.  Most application developers… Don’t implement networking protocols Don’t implement encryption algorithms  Knowing how to safely deploy them, however, is paramount Different situations call for different techniques ○ Types of Authentication ○ One-way digests (hashes) ○ Symmetric-key vs. Public-key ○ Trusting public keys Know Thy Algorithms instead of “just use crypto” © Andrew Meneely

The Basic Problems  The internet is a scary, scary place Anyone can join Anyone can sniff  BUT! “distrust everything all the time” is not feasible  Authentication: are you who you say your are? Trust must be built somehow  Encryption: can someone else listen in?  Authentication & Encryption overlap in techniques How do we encrypt data for someone we do not trust? How do we know nobody else has the key? How do authenticate this machine?

Multi-Factor Authentication  Security experts recommend that we utilize three types of authentication…  Something you know e.g. passwords Can be guessed, though  Something you have Maybe a physical item Maybe a one-time randomly generated key e.g. both: pre-seeded secure PRNG key fob  Something you are Biometrics? Tons of false positives Easier for humans, at least right now (e.g. face recognition)

Hash Digests  Problem: sensitive data needs to be identified only by the original user, nobody else e.g. user wants to authenticate, but we don’t want to store passwords in plain text in case an attacker breaks in  Solution: hash digest algorithms Compute a very large number based on a chunk of data ○ The more numbers it can map to, the better (e.g ) ○ Similar chunks of data should not compute to the same hash Same number? Highly probable it’s the same data

Authentication with Hashes  Use Case: (re)set password User inputs password Server hashes pw Stores the hash  Abuse Case: Break-in Attacker steals plaintext passwords from Database Harm done: can authenticate as any user Mitigation: can’t reverse the hashes  Use Case: Authenticate User inputs password Server computes hash Checks the hashes

Abuse Case: Rainbow Tables  What if an attacker steals the hashes? common passwords + common digests = common hashes Thus, attackers have large databases of pre-computed hashes called rainbow tables  Solution: hashing with salt Today’s VotD

Hash Collisions  By definition, hash digests cannot uniquely map data to a hash Thus, many pieces of data map to the same hash A collision is two known pieces of data that map to the same hash number Can be used to “spoof” a password  MD4, MD5 & SHA1 now considered “broken” Colliding digests can be manufactured Still cannot be reversed, and probably won’t be

Symmetric-Key Cryptography  Encrypt key == Decrypt key So keep that key a secret!! Traditional arrangement  Modern algorithms AES Blowfish 3DES  Traditional usage Encryption of data storage: backups, hard drives, etc. Not typically for networking situations ○ Both parties need the same key ○ Can’t send that key in the open over the wire ○ Could hard-code the keys ahead of time, but what if we need to change the key??

Public-Key Cryptography  Encrypt key is public, Decrypt key is private Anyone in the world can encrypt data and send it do you But they can’t decrypt any other messages sent to you  Most popular modern algorithm: RSA Factorization of two prime numbers Public/private keys generated from computing two very large prime numbers  RSA has never been cracked, although… The algorithms for generating very large primes have been cracked/poorly implemented many times Result of poor PRNG practices (bad algorithms & bad seeds)  Traditional usage: networking (SSH, SSL, PGP)

Public-key Authentication  E[..] is “encrypt” (public) D[..] is “decrypt” (private) D[E[m]]=m is encrypt then decrypt m (normal usage) D[m] is use the decryption on plain text m (strange, but legal)  Scenario: Adam and Eve Adam’s public and private: E Adam [..] and D Adam [..] Eve’s public and private: E Eve [..] and D Eve [..] They know each others’ public keys ○ Adam has access to E Eve [..] ○ Eve has access to E Adam [..]  Adam wants to ensure Eve that the message came from him, So he does: m=“This should be bubbles: D Adam [bubbles]” Sends E Eve [m] to Eve – only Eve can read the message with D Eve [m] Eve checks E Adam [D Adam [bubbles]]=bubbles so that the message came from Adam, and not, say, her son Cain.

Drawbacks of Public Key  Implementation issues Tends to be slower than traditional symmetric key Generating primes with 50+ digits is hard  How do we trust the public key? What if Eve confuses E Adam with E Satan ? Man-in-the-middle attack ○ Satan intercepts it ○ Decrypts it ○ Reads it ○ Re-encrypts it properly ○ Sends it off to Adam

SSH  Secure Shell Used for remote access into machines Ubiquitous for Unix-like systems Uses passwords by default  SSH and public keys Key pairs have a one-time PRNG built in Private key ○ Encrypted with a symmetric cipher ○ Requires a “passphrase” to unlock Trust the public keys? authorized_keys Trust the host? known_hosts

e.g. SSH Key pairs ssh-keygen –t rsa Generating public/private rsa1 key pair... Enter file in which to save the key (~/.ssh/identity): Enter passphrase: Enter same passphrase again: Your public key has been saved in ~/.ssh/id_rsa.pub Your private key has been saved in ~/.ssh/id_rsa The key fingerprint is: 22:bc:0b:fe:f5:06:1d:c0:05:ea:59:09:e3:07:8a:8c  Untrusted public keys? SSH-enabled servers don’t trust any public keys initially Need to copy your public key to the authorized_keys file on the server scp ~/id_rsa.pub ssh cat id_rsa.pub >> ~/.ssh/authorized_keys

SSH and known_hosts  When I SSH into nitron, how do I know that this isn’t a malicious server who changed his network address?  Answer: your known_hosts file Every server has a unique fingerprint First time you sign in, trust the key and add the key to your known_hosts cache Host changes? You’ll get a warning like WARNING: REMOTE HOST IDENTIFICATION HAS IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in- the-middle attack)! It is also possible that the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is 8b:ff:a1:b5:08:2f:8f:fd:2e:2f:67:80:9e:ba:8d:ff. Please contact your system administrator. Add correct host key in /home/bob/.ssh/known_hosts to get rid of this message. Offending key in /home/bob/.ssh/known_hosts:2 RSA host key for has changed and you have requested strict checking. Host key verification failed.

Next time…  More common algorithms Public key: SSL Combination of Public and Symmetric: PGP  Some common cryptanalysis techniques