Programming Project #1



Similar documents
Project #4: MITM Attacks and Authentication

CS255 Programming Project 2

Client Server Registration Protocol

Network Security. Computer Networking Lecture 08. March 19, HKU SPACE Community College. HKU SPACE CC CN Lecture 08 1/23

Project 2: Penetration Testing (Phase II)

Security. Contents. S Wireless Personal, Local, Metropolitan, and Wide Area Networks 1

CS Computer Security Third topic: Crypto Support Sys

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

JAVA 2 Network Security

CSC474/574 - Information Systems Security: Homework1 Solutions Sketch

Chapter 17. Transport-Level Security

Cryptography and Network Security Chapter 14. Key Distribution. Key Management and Distribution. Key Distribution Task 4/19/2010

Dashlane Security Whitepaper

VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wānanga o te Ūpoko o te Ika a Māui

Module 7 Security CS655! 7-1!

cipher: the algorithm or function used for encryption and decryption

Authenticity of Public Keys

Network Security - ISA 656 Security

Chap. 1: Introduction

Cryptography and Network Security Chapter 14

Chapter 7 Transport-Level Security

Lecture 9: Application of Cryptography

E-Commerce Security. The Client-Side Vulnerabilities. Securing the Data Transaction LECTURE 7 (SECURITY)

SENSE Security overview 2014

Practice Questions. CS161 Computer Security, Fall 2008

Enabling SSL and Client Certificates on the SAP J2EE Engine

best practices for encryption in android

CS 758: Cryptography / Network Security

Angel Dichev RIG, SAP Labs

Module 8. Network Security. Version 2 CSE IIT, Kharagpur

CS 161 Computer Security Spring 2010 Paxson/Wagner MT2

Web Security. Crypto (SSL) Client security Server security 2 / 40. Web Security. SSL Recent Changes in TLS. Protecting the Client.

What is Web Security? Motivation

Secure Shell SSH provides support for secure remote login, secure file transfer, and secure TCP/IP and X11 forwarding. It can automatically encrypt,

Midterm 2 exam solutions. Please do not read or discuss these solutions in the exam room while others are still taking the exam.

SecureDoc Disk Encryption Cryptographic Engine

Communication Security for Applications

Authentication Types. Password-based Authentication. Off-Line Password Guessing

VMware vrealize Operations for Horizon Security

RemotelyAnywhere Getting Started Guide

What Are Certificates?

CS 494/594 Computer and Network Security

Security. Friends and Enemies. Overview Plaintext Cryptography functions. Secret Key (DES) Symmetric Key

Applying Cryptography as a Service to Mobile Applications

2.4: Authentication Authentication types Authentication schemes: RSA, Lamport s Hash Mutual Authentication Session Keys Trusted Intermediaries

OPENID AUTHENTICATION SECURITY

IMPROVED SECURITY MEASURES FOR DATA IN KEY EXCHANGES IN CLOUD ENVIRONMENT

CSCE 465 Computer & Network Security

7 Network Security. 7.1 Introduction 7.2 Improving the Security 7.3 Internet Security Framework. 7.5 Absolute Security?

CSE/EE 461 Lecture 23

Is your data safe out there? -A white Paper on Online Security

Design Notes for an Efficient Password-Authenticated Key Exchange Implementation Using Human-Memorable Passwords

VMware vrealize Operations for Horizon Security

Chapter 7: Network security

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

Authenticated encryption

Secure Socket Layer. Introduction Overview of SSL What SSL is Useful For

Symmetric and Public-key Crypto Due April , 11:59PM

CS 203 / NetSys 240. Network Security

IY2760/CS3760: Part 6. IY2760: Part 6

Criteria for web application security check. Version

Overview of CSS SSL. SSL Cryptography Overview CHAPTER

CMSC 421, Operating Systems. Fall Security. URL: Dr. Kalpakis

Remote ESL On A Mac With OS-X Using SSH Tunneling & Port Forwarding

Introduction to Cryptography CS 355

Authentication Application

Chapter 10. Network Security

Guidance Regarding Skype and Other P2P VoIP Solutions

TELE 301 Network Management. Lecture 17: File Transfer & Web Caching

Security Policy for Oracle Advanced Security Option Cryptographic Module

ICOM 5018 Network Security and Cryptography

Transport Level Security

Chapter 9 Key Management 9.1 Distribution of Public Keys Public Announcement of Public Keys Publicly Available Directory

Protocol Rollback and Network Security

VoIP Security. Seminar: Cryptography and Security Michael Muncan

Server Security. Contents. Is Rumpus Secure? 2. Use Care When Creating User Accounts 2. Managing Passwords 3. Watch Out For Aliases 4

Device Log Export ENGLISH

Key Management. CSC 490 Special Topics Computer and Network Security. Dr. Xiao Qin. Auburn University

SY system so that an unauthorized individual can take over an authorized session, or to disrupt service to authorized users.

Security+ Guide to Network Security Fundamentals, Third Edition. Chapter 6. Wireless Network Security

Secure Sockets Layer

Cryptography and network security CNET4523

: Network Security. Name of Staff: Anusha Linda Kostka Department : MSc SE/CT/IT

SSL A discussion of the Secure Socket Layer

Public Key Cryptography in Practice. c Eli Biham - May 3, Public Key Cryptography in Practice (13)

Lecture 9 - Message Authentication Codes

CRYPTOGRAPHY IN NETWORK SECURITY

Security in IPv6. Basic Security Requirements and Techniques. Confidentiality. Integrity

DEVELOPING CERTIFICATE-BASED PROJECTS FOR WEB SECURITY CLASSES *

1.2 Using the GPG Gen key Command

SSL Configuration on Weblogic Oracle FLEXCUBE Universal Banking Release [August] [2014]

Outline. CSc 466/566. Computer Security. 8 : Cryptography Digital Signatures. Digital Signatures. Digital Signatures... Christian Collberg

Java Security Web Services Security (Overview) Lecture 9

SECURITY IN NETWORKS

Peer-to-peer Cooperative Backup System

Final Exam. IT 4823 Information Security Administration. Rescheduling Final Exams. Kerberos. Idea. Ticket

SSL SSL VPN

Secure Software Programming and Vulnerability Analysis

Transcription:

CS255: Cryptography and Computer Security Winter 2000 Programming Project #1 Due: Monday, February 21 st 2000, 11:59pm For the programming projects in this course, you will be working in groups of two. Your goal is to increase the security of the provided Chat system. Right now, the Chat system is totally insecure: all messages from the client to the server and from the server to the client are transmitted in the clear. For project 1, the required security features are: A key exchange between the chat client and the chat server when the client connects. All chat messages need to be encrypted using a block cipher in CBC mode A MAC must be appended to all chat messages. You must devise and implement a measure to combat replay attacks. We will examine each of these features in detail below. Key Exchange You may use any of the key exchanges discussed in class, including the Diffie-Hellman key exchange protocol or any scheme that uses public key encryption (we showed in class that a secure public key system implies a key exchange algorithm). Please no Merkle Puzzles. Note that we have not yet discussed a method to prevent the person-inthe-middle attack on key exchange protocols. Consequently, in this project you are only required to secure the key exchange protocol against a passive eavesdropper. We will deal with active attacks on the key exchange protocol in project 2. You should use the secret obtained during key exchange to generate your block cipher key, your CBC IV and your MAC key. To do this, you should use a hash of the secret as input to a PRNG, and use the output of the generator as your keys and IV. Message Encryption Each message transmitted by either a client or the server must be encrypted using a block cipher. You may use any standard block cipher you like, but all messages must be encrypted using CBC mode. As mentioned above, you should generate both the cipher key and the CBC IV from the secret obtained during key exchange.

2 MACs Every message that goes over the network should have a MAC to enable the detection of a malicious attacker tampering with messages en route. You should generate the key for this MAC from the secret obtained during key exchange as described above. Preventing Replay Attacks Even after you secure chat messages with encryption and MACs, there is still an obvious replay attack. Marvin captures a chat message en route to either the server or a particular client. He then repeatedly sends that message which is still a valid chat message flooding the intended recipient and making the chat room unusable for the participants. Your solution should prevent an attacker from replaying a user s message. Security Holes Even with these four security features, it should be clear that there are still holes in the Chat system. Aside from the person-in-the-middle attack on the key exchange protocol, the biggest remaining problem is authentication. The easiest way for an attacker to see the messages in the chat room is simply to join. Another problem (at least for the.com world) is that there is no way to charge people for using our chat system. We will address some or all of these problems in programming project 2. Implementation As mentioned in class, you will be programming this project in Java. We have provided a substantial amount of starter code. Here is a description of the files we provide for you (files you need to change are in bold): File Makefile java.policy Chat/ChatClient.java Chat/ChatConsumer.java Chat/ChatConsumerImpl.java Purpose Makefile for the project modify this to build any classes you add to the project Policy file granting network/file permissions Chat Client Chat Consumer remote interface defines methods that may be called over the network by the server Implementation of the ChatConsumer interface

3 Chat/ChatLoginPanel.java Chat/ChatRoomPanel.java Chat/ChatServer.java Chat/ChatServerImpl.java Chat/SkipConstants.java GUI class for the login screen GUI class for the chat room screen Chat Server remote interface defines server methods that may be called over the network by clients Implementation of the ChatServer interface Contains constants for the 1024 bit prime p and generator g used for Skip. Use these if you don t have the patience to generate your own. You should spend some time getting familiar with the provided framework. You will need to copy the /usr/class/cs255/proj1 directory to your account. You will also need to source /usr/class/cs255/setup.csh to set your path, classpath and java alias correctly. If you are an advanced user, you may want to do this manually. To build the project, c`hange into the proj1 directory and type make. To run the Chat system, follow these four easy steps: 1. Pick a unique port number for your group to use. We recommend using the last four digits of your phone number. Note this won t work if your last four digits are less than 1024 or your roommate is taking the class. 2. Start the RMI registry. This is part of the networking infrastructure we have set up for you. To start the registry, type elaine21:~/proj1> rmiregistry portnum & If you omit the port number, the registry will start on port 1099, so be careful. 3. Start the Chat Server. Note that the server does not necessarily need to be running on the same machine as the registry. You do, however, have to specify the host and port on which the registry is running. For example: elaine21:~/proj1> java Chat.ChatServerImpl elaine21 portnum & 4. Start one or more Chat Clients. elaine21:~/proj1> java Chat.ChatClient &

4 Important note: In the past, the Sweet Hall people have been grumpy with CS255 students leaving the rmiregistry and ChatServer processes running after they logout. You need to explicitly kill these processes. Crypto Libraries and Documentation Java s security and cryptography classes are divided into two main packages: java.security.* and javax.crypto.*. The reason for this division is U.S. export restrictions. Everything in java.security.* is exportable, most everything in javax.crypto.* is not. The javax.crypto.* package is collectively referred to as the Java Crypto Extensions or the JCE. Classes for cryptographic hashing and digital signatures (not required for project #1) can be found in security, whereas ciphers and MACs are located in the JCE. There is an API users guide for the JCE that is not published on Sun s site because it contains source code examples of how to encrypt. Under current U.S. export law, this file is classified as munitions. We have reproduced this document for educational purposes only, and we hope you do not choose to violate any laws. That being said, you should probably read through the guide first. It can be found at: http://crypto.stanford.edu/~dabo/cs255/api_users_guide.html Other good documentation sites are: Description Java API JCE API Java Tutorial Chapter 6 from Java Cryptography by Jonathon Knudsen URL http://java.sun.com/products/jdk/1.2/docs/api/ http://java.sun.com/security/jce1.2/spec/apidoc/ http://java.sun.com/docs/books/tutorial/ http://www.oreilly.com/catalog/javacrypt/chapter/ch06.html Some classes you may want to take a look at: javax.crypto.keyagreement javax.crypto.keygenerator javax.crypto.ivparameterspec javax.crypto.mac javax.crypto.cipher javax.crypto.secretkeyfactory java.security.messagedigest java.security.keypairgenerator java.security.securerandom java.math.biginteger

5 A Word About Networking The Chat system would be rather boring if it didn t run over the network. The problem for us is that we cannot expect everyone interested in cryptography to have network programming experience. For that reason, we will be using Java RMI for all network communications in our programming projects. What is Java RMI? RMI stands for Remote Method Invocation and it is a standard part of the Java library. RMI enables you to declare objects as remote, making the methods of that object accessible to Java programs running on different machines. All of the RMI setup has already been done for you. For instance, in ChatClient.connect, you will find the following code: _server = (ChatServer)Naming.lookup( // + host + : + port + /ChatServer ); This simply sets the variable _server to a reference to an object called ChatServer which has been registered with the rmiregistry running on the designated host and port. In ChatClient.sendMessage, you see the code: _server.postmessage(msg, _clientid); This has the effect of sending msg and _clientid over the wire to the machine where the ChatServer is running and calling the server s postmessage method with msg and _clientid as parameters. If you want to change the parameters to postmessage (we hope you do!) or add a new remote method, you need to do so in two places. You need to modify the ChatServer s remote interface in ChatServer.java and the actual method definition in ChatServerImpl.java. The same is true for the ChatConsumer. Help We strongly encourage you to use the class newsgroup (su.class.cs255) as your first line of defense for the programming projects. TAs will be monitoring the newsgroup daily and, who knows, maybe someone else has already answered your question. In addition to the newsgroup, we will also be maintaining a Programming Assignment FAQ on the course web page, be sure to check it frequently.

6 We will be moving some of our office hours to Sweet Hall to help you with programming questions, check the web page for up to the minute office hour locations. As a last resort, you can email the staff at cs255ta@cs.stanford.edu. Submission In addition to your well-decomposed, well-commented solution to the assignment, you should submit a README containing the names, leland usernames and SUIDs of the people in your group as well as a description of the design choices you made in implementing each of the required security features. When you are ready to submit, make sure you are in your proj1 directory and type /usr/class/cs255/bin/submit.