CS255 Programming Assignment #1. Due: Friday Feb 10 th (11:59pm) –Can use extension days Can work in pairs –One solution per pair Test and submit on Sweet.

Slides:



Advertisements
Similar presentations
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Advertisements

CS470, A.SelcukStream Ciphers1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
CS470, A.SelcukCryptographic Authentication1 Cryptographic Authentication Protocols CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Spring 2000CS 4611 Security Outline Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls.
Secure Socket Layer.
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
J. Wang. Computer Network Security Theory and Practice. Springer 2009 Chapter 5 Network Security Protocols in Practice Part II.
1 Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell.
1 Supplement III: Security Controls What security services should network systems provide? Confidentiality Access Control Integrity Non-repudiation Authentication.
Implementation of a Two-way Authentication Protocol Using Shared Key with Hash CS265 Sec. 2 David Wang.
Mar 19, 2002Mårten Trolin1 This lecture On the assignment Certificates and key management SSL/TLS –Introduction –Phases –Commands.
Security Overview Hofstra University University College for Continuing Education - Advanced Java Programming Lecturer: Engin Yalt May 24, 2006.
Java Security Model Lab#1 I. Omaima Al-Matrafi. Safety features built into the JVM Type-safe reference casting Structured memory access (no pointer arithmetic)
Andy’s Basic Crypto Course (ABC) Part 1 - Introduction.
Feb 25, 2003Mårten Trolin1 Previous lecture More on hash functions Digital signatures Message Authentication Codes Padding.
Chapter 5 Cryptography Protecting principals communication in systems.
Wired Equivalent Privacy (WEP)
Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m.
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Feb 19, 2002Mårten Trolin1 Previous lecture Practical things about the course. Example of cryptosystem — substitution cipher. Symmetric vs. asymmetric.
Network Security. Contents Security Requirements and Attacks Confidentiality with Conventional Encryption Message Authentication and Hash Functions Public-Key.
Computer Science CSC 774Dr. Peng Ning1 CSC 774 Advanced Network Security Topic 2. Review of Cryptographic Techniques.
Encryption Methods By: Michael A. Scott
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
CS255 Programming Project 1. Programming Project 1 Due: Friday Feb 8 th (11:59pm)‏ – Can use extension days Can work in pairs – One solution per pair.
What is in Presentation What is IPsec Why is IPsec Important IPsec Protocols IPsec Architecture How to Implement IPsec in linux.
CRYPTOGRAPHY PROGRAMMING ON ANDROID Jinsheng Xu Associate Professor North Carolina A&T State University.
Csci5233 Computer Security1 GS: Chapter 6 Using Java Cryptography for Authentication.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
Wireless security & privacy Authors: M. Borsc and H. Shinde Source: IEEE International Conference on Personal Wireless Communications 2005 (ICPWC 2005),
Message Authentication Requirements Disclosure Release of message contents to any person or process not possessing the appropriate cryptographic key Traffic.
1 Section 10.9 Internet Security Association and Key Management Protocol ISAKMP.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
A Survey of Authentication Protocol Literature: Version 1.0 Written by John Clark and Jeremy Jacob Presented by Brian Sierawski.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
Chapter 31 Cryptography And Network Security Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
WEP Protocol Weaknesses and Vulnerabilities
WEP AND WPA by Kunmun Garabadu. Wireless LAN Hot Spot : Hotspot is a readily available wireless connection.  Access Point : It serves as the communication.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Wireless LAN Security. Security Basics Three basic tools – Hash function. SHA-1, SHA-2, MD5… – Block Cipher. AES, RC4,… – Public key / Private key. RSA.
Network Security David Lazăr.
Modes of Usage Dan Fleck CS 469: Security Engineering These slides are modified with permission from Bill Young (Univ of Texas) 11 Coming up: Modes of.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Chapter 7 – Confidentiality Using Symmetric Encryption.
Chapter 7 Confidentiality Using Symmetric Encryption.
Based on Bruce Schneier Chapter 8: Key Management Dulal C Kar.
SSL (TLS) Part 2 Generating the Premaster and Master Secrets + Encryption.
Enterprise Security API (ESAPI) 2.0 Crypto Changes
Attacking IPsec VPNs Charles D George Jr. Overview Internet Protocol Security (IPSec) is a suite of protocols for authenticating and encrypting packets.
1 Session 3 Module 4: Java Security Module 5: Cryptography.
INFORMATION SECURITY MANAGEMENT P ROTECTION M ECHANISMS - C RYPTOGRAPHY.
Presentation Road Map 1 Authenticated Encryption 2 Message Authentication Code (MAC) 3 Authencryption and its Application Objective Modes of Operation.
Dan Boneh Introduction Course Overview Online Cryptography Course Dan Boneh.
Authentication has three means of authentication Verifies user has permission to access network 1.Open authentication : Each WLAN client can be.
Lecture 4 Page 1 CS 236 Stream and Block Ciphers Stream ciphers convert one symbol of plaintext immediately into one symbol of ciphertext Block ciphers.
Network Security Lecture 3 Secret Key Cryptography
EE 122: Lecture 24 (Security) Ion Stoica December 4, 2001.
INFORMATION SECURITY MANAGEMENT P ROTECTION M ECHANISMS - C RYPTOGRAPHY.
Dan Boneh Authenticated Encryption CBC paddings attacks Online Cryptography Course Dan Boneh.
Part 1  Cryptography 1 Integrity Part 1  Cryptography 2 Data Integrity  Integrity  detect unauthorized writing (i.e., modification of data)  Example:
1 Example security systems n Kerberos n Secure shell.
Outline Desirable characteristics of ciphers Stream and block ciphers
Block Cipher Modes CS 465 Make a chart for the mode comparisons
Security Of Wireless Sensor Networks
Review of Cryptography: Symmetric and Asymmetric Crypto Advanced Network Security Peter Reiher August, 2014.
Presentation transcript:

CS255 Programming Assignment #1

Due: Friday Feb 10 th (11:59pm) –Can use extension days Can work in pairs –One solution per pair Test and submit on Sweet Hall machines –SCPD students: get SUNet ID! sunetid.stanford.edu

Big Picture Provider distributes content in freely available encrypted files Clients obtain decryption keys from the Authority Server Authority Server authenticates Clients based on their username and password

Execution Scenario Provider PasswordsContent PasswordsContent ClientServer Authentication Token Content Key Content

Security Requirements Attacker cannot obtain content or passwords –Encryption Attacker cannot modify content or passwords –MAC Only registered users can obtain content –Authentication Prevent replay attacks on the Server –Server does not respond to same token twice

Components: Provider 1.Generates three key pairs: –K-temp, K-MAC-temp(from randomness K) –K-cont, K-MAC-cont(from masterPwd) –K-pass, K-MAC-pass(from masterPwd) 2.Protects content with K-temp –Includes K in the header protected with K-cont 3.Protects passwords with K-pass –You choose the design

Protected Content A = Enc[K-cont, K] Mac[K- MAC-cont, A] B = Enc[K-temp, Content] Mac[K- MAC-temp, B]

Components: Client 1.Generates key pair: –K-user, K-MAC-user(from userPwd) 2.Reads the header from the protected content file 3.Sends the authentication token to the server 4.Verifies and decrypts the content key 5.Verifies and decrypts the content

Components: Authority Server 1.Generates key pairs: –K-cont, K-MAC-cont(from masterPwd) –K-pass, K-MAC-pass(from masterPwd) 2.Verifies and decrypts the password file 3.For every client that connects 1.Generates key pair from users password 2.Verifies the authentication token 3.Decrypts and sends the content key

Authentication Protocol A = Enc[K-cont, K] Mac[K-MAC-cont, A] C = R || username Mac[K- MAC-user, C] D = Enc[K-user, K] Mac[K- MAC-user, D]

Generating Keys From Passwords You choose the design What NOT to do: –Use passwords as keys directly (weak keys) –Split passwords in half (easier to guess the password) Goal: Finding the key should be as hard as guessing the password –Even if related keys are compromised Tools available: –Block cipher (PRP), PRG, MAC, Cryptographic hash

Java Cryptography Extension Implementations of crypto primitives Cipher Pseudo-random Generator SecureRandom Message Authentication Code Mac Cryptographic Hash MessageDigest

JCE: Using Ciphers 1.Select the algorithm 2.Initialize with desired mode and key 3.Encrypt/Decrypt // Create and initialize the cipher Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding"); cipher.init(Cipher.ENCRYPT_MODE, enckey); // Encrypt the message byte [] msg = "Content is here.".getBytes(); byte [] enc = cipher.doFinal(msg);

JCE: Generating Random Keys 1.Start the PRG (random seed set by default) 2.Initialize KeyGenerator with the PRG 3.Generate the key // Generate a random encryption key SecureRandom prng = SecureRandom.getInstance("SHA1PRNG"); KeyGenerator enckeygen = KeyGenerator.getInstance("AES"); enckeygen.init(prng); SecretKey enckey = enckeygen.generateKey();

Counter Mode Not supported in JCE, must implement it yourself To get a “plain” cipher use ECB mode with no padding –Warning! CBC mode used by default –Need to specify “…/ECB/NoPadding” You can use any available block cipher

Networking Starter code communicates text, you need to send data Can use data streams // Setup data streams toServer = new DataOutputStream(clientSocket.getOutputStream()); fromServer = new DataInputStream(clientSocket.getInputStream()); Can use for files as well Alternative: convert bytes to text

Networking: Example Send username and ciphertext to the server // Send to server toServer.writeUTF(username); toServer.writeInt(enc.length); toServer.write(enc); toServer.flush(); Receive username and ciphertext from the client // Receive from Client String username = fromClient.readUTF(); int enclength = fromClient.readInt(); byte [] enc = new byte [enclength]; fromClient.readFully(enc);

Implementation Issues Counter for CRT mode (try BigNum) Replay attacks (try HashMap) Minor issues –Message size not a multiple of cipher block size –Format of the plaintext password file –Exact format of files and network traffic

Starter Code Four Java source files Provider code ProviderGUI.java Client code ClientGUI.java Global server code AuthorityServer.java Per-client server code AuthorityServerThread.java

Submitting README file –Names, student IDs –Describe your design choices Sample plaintext content and password files Your sources

Grading Security comes first –Design choices –Correctness of the implementation Did you implement all required parts? We do not care about: –Cosmetics –Coding style –Efficiency

Stuck? Use the newsgroup (su.class.cs255) –Best way to have your questions answered quickly TAs cannot: –Debug your code –Troubleshoot your local Java installation