Lecture 9: Application of Cryptography



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

CRYPTOGRAPHY IN NETWORK SECURITY

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

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

Lukasz Pater CMMS Administrator and Developer

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

Computer Security: Principles and Practice

An Introduction to Cryptography as Applied to the Smart Grid

SECURITY IN NETWORKS

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

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

CSCE 465 Computer & Network Security

Overview of CSS SSL. SSL Cryptography Overview CHAPTER

Network Security. Gaurav Naik Gus Anderson. College of Engineering. Drexel University, Philadelphia, PA. Drexel University. College of Engineering

Network Security (2) CPSC 441 Department of Computer Science University of Calgary

Chapter 11 Security+ Guide to Network Security Fundamentals, Third Edition Basic Cryptography

Forward Secrecy: How to Secure SSL from Attacks by Government Agencies

Overview. SSL Cryptography Overview CHAPTER 1

Chapter 7: Network security

Overview of Public-Key Cryptography

Cryptosystems. Bob wants to send a message M to Alice. Symmetric ciphers: Bob and Alice both share a secret key, K.

Lecture 6 - Cryptography

Secure Sockets Layer (SSL ) / Transport Layer Security (TLS) Network Security Products S31213

Network Security. Security Attacks. Normal flow: Interruption: 孫 宏 民 Phone: 國 立 清 華 大 學 資 訊 工 程 系 資 訊 安 全 實 驗 室

Public Key Cryptography Overview

Network Security [2] Plain text Encryption algorithm Public and private key pair Cipher text Decryption algorithm. See next slide

Cryptography & Digital Signatures

Network Security Technology Network Management

How To Encrypt Data With Encryption

Authentication requirement Authentication function MAC Hash function Security of

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

CSE/EE 461 Lecture 23

CS 758: Cryptography / Network Security

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

Chapter 8 Network Security. Slides adapted from the book and Tomas Olovsson

IT Networks & Security CERT Luncheon Series: Cryptography

CIS433/533 - Computer and Network Security Cryptography

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

Public Key (asymmetric) Cryptography

Chapter 8. Network Security

What is network security?

Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

7! Cryptographic Techniques! A Brief Introduction

Using etoken for SSL Web Authentication. SSL V3.0 Overview

Introduction to Cryptography

Network Security. HIT Shimrit Tzur-David

Hash Functions. Integrity checks

Lecture 9 - Network Security TDTS (ht1)

Cryptographic hash functions and MACs Solved Exercises for Cryptographic Hash Functions and MACs

, ) I Transport Layer Security

Table of Contents. Bibliografische Informationen digitalisiert durch

Security: Focus of Control. Authentication

CSCI-E46: Applied Network Security. Class 1: Introduction Cryptography Primer 1/26/16 CSCI-E46: APPLIED NETWORK SECURITY, SPRING

Secure Socket Layer (SSL) and Transport Layer Security (TLS)

Transport Level Security

Chapter 8 Security. IC322 Fall Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Accellion Secure File Transfer Cryptographic Module Security Policy Document Version 1.0. Accellion, Inc.

SECURE SOCKET LAYER PROTOCOL SIMULATION IN JAVA. A Research Project NAGENDRA KARRI

Announcement. Final exam: Wed, June 9, 9:30-11:18 Scope: materials after RSA (but you need to know RSA) Open books, open notes. Calculators allowed.

2. Cryptography 2.4 Digital Signatures

Safeguarding Data Using Encryption. Matthew Scholl & Andrew Regenscheid Computer Security Division, ITL, NIST

HASH CODE BASED SECURITY IN CLOUD COMPUTING

Cryptography and Network Security

Programming with cryptography

Chapter 7 Transport-Level Security

Chapter 17. Transport-Level Security

A New Efficient Digital Signature Scheme Algorithm based on Block cipher

3.2: Transport Layer: SSL/TLS Secure Socket Layer (SSL) Transport Layer Security (TLS) Protocol

DRAFT Standard Statement Encryption

Chapter 10. Network Security

Computer System Management: Hosting Servers, Miscellaneous

Properties of Secure Network Communication

Communication Security for Applications

Network Security Essentials Chapter 5

CPS Computer Security Lecture 9: Introduction to Network Security. Xiaowei Yang

The Misuse of RC4 in Microsoft Word and Excel

How encryption works to provide confidentiality. How hashing works to provide integrity. How digital signatures work to provide authenticity and

Overview of SSL. Outline. CSC/ECE 574 Computer and Network Security. Reminder: What Layer? Protocols. SSL Architecture

Secure Key Exchange for Cloud Environment Using Cellular Automata with Triple-DES and Error-Detection

Common security requirements Basic security tools. Example. Secret-key cryptography Public-key cryptography. Online shopping with Amazon

Chapter 8. Cryptography Symmetric-Key Algorithms. Digital Signatures Management of Public Keys Communication Security Authentication Protocols

Common Pitfalls in Cryptography for Software Developers. OWASP AppSec Israel July The OWASP Foundation

CS 348: Computer Networks. - Security; 30 th - 31 st Oct Instructor: Sridhar Iyer IIT Bombay

SBClient SSL. Ehab AbuShmais

Connected from everywhere. Cryptelo completely protects your data. Data transmitted to the server. Data sharing (both files and directory structure)

Message Authentication Codes

Some solutions commonly used in order to guarantee a certain level of safety and security are:

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

Efficient Framework for Deploying Information in Cloud Virtual Datacenters with Cryptography Algorithms

Digital Signatures. Meka N.L.Sneha. Indiana State University. October 2015

SSL/TLS: The Ugly Truth

mod_ssl Cryptographic Techniques

Fundamentals of Computer Security

Cryptographic Services Guide

Encryption, Data Integrity, Digital Certificates, and SSL. Developed by. Jerry Scott. SSL Primer-1-1

Security and Authentication Primer

Practice Questions. CS161 Computer Security, Fall 2008

Savitribai Phule Pune University

Network Security Part II: Standards

Enabling SSL and Client Certificates on the SAP J2EE Engine

Transcription:

Lecture topics Cryptography basics Using SSL to secure communication links in J2EE programs Programmatic use of cryptography in Java Cryptography basics Encryption Transformation of data into a form that is almost impossible to read without the appropriate knowledge (key) Decryption is the inverse transformation Authentication Reliable determination of a specific fact E.g. digital signatures authenticate authorship E.g. digital timestamps authenticate creation time

Perfect cryptography Called one-time pad Create a key for each document anew, completely at random The length of the key == the length of the plaintext Apply the key to the plaintext (e.g. XOR) to obtain ciphertext An attacker cannot deduce the plaintext from the ciphertext, since the key is random Usually impractical The key is long Both parties need the key Private key cryptography Also called secret key or symmetric cryptography A single key is used to both encrypt and decrypt messages The key has to be known to both the sender and receiver Block ciphers: give a secret key, transform a fixed-length block of plaintext (64 or 128 bits) into ciphertext of the same length Stream ciphers: generates a keystream and applies it to the plaintext Challenge: have the sender and receiver agree on a key securely (key management problem)

Public key cryptography Diffie-Hellman invention (1976) Every party (corporation, person, program, etc) gets two keys: a public key and a private key The public key is published (has to be associated with the party in a trusted manner) The private key is kept secret The two keys in a pair are linked mathematically: Plaintext encrypted with the public key can only be decrypted with the corresponding private key Because of this relationship, it s possible to derive private key from the public key Public key cryptosystems are designed in a way that makes the necessary computations prohibitively expensive (e.g. involving factoring large numbers) Can be used for digital signatures (authentication) To sign a message, create a digital signature using the message and private key If a computation involving the public key succeeds, signature has been verified Popular encryption algorithms Private key DES (Data Encryption Standard), ANSI standard Designed by IBM, NSA, and NIST 64 bits block size, 56-bit key Currently triple-des is the standard AES (Advanced Encryption Standard) Algorithm selected Oct 2001, standard published Nov 2002 Replaces DES; intended lifespan 20-30 years Supports key sizes 128, 192, and 256 bits Public key RSA (Rivest, Shamir, and Adleman) cryptosystem Based on the assumption that factoring large integers is computationally hard DSA (Digital Signature Algorithm) Can be used only for digital signatures, not encryption Based on the discrete logarithm problem

Elliptic curve cryptography Public key cryptosystems Proposed by Miller and Koblitz in mid-80s Based on operations over elliptic curves Given two points G and Y on an elliptic curve such that Y = kg (that is, Y is G added to itself k times), find the integer k. This problem is commonly referred to as the elliptic curve discrete logarithm problem Hash functions Hash function is a transformation that takes an input and returns a fixed size string, called hash value Hash value is often called message digest Useful for integrity checks and digital signatures Basic requirements for a hash function: Input can be of any length Output has a fixed length H(x) is relatively easy to compute for any x H(x) is one way (H -1 is hard to compute) H(x) is collision free (computationally infeasible to find two strings x and y such that H(x) = H(y)

Popular hashing algorithms MD2, MD4, MD5 (Message Digest) Developed by Rivest Intended for use in digital signatures Produce 128-bit digest for an arbitrary length message SHA and SHA-1 (Secure Hash Algorithm) Developed by NIST Design similar to MD4 Produce 160-bit digest for a message of length no more than 2 64 bits Public key certificates A certificate is a digitally signed statement from a trusted entity (Certification Authority), saying what the public key of another entity is legit Sequence of steps involved: An entity generates a key pair The entity sends the public key to a CA (usually in email) The CA generates the certificate as a binding between a X.500 hierarchical name identity and the public key The CA signs the certificate and the public key with its own private key SSL handshake protocol for server authentication (client authentication is optional) A client requests the server for its certificate The server sends its certificate and cipher preferences The client generates a master key and encrypts it with the public key of the server; sends to the server The server decrypts the message and uses the master key to encrypt a message; sends to the client

What s in a certificate? The certificate issuer's name The entity for whom the certificate is being issued (aka the subject) The public key of the subject Some time stamps So, how is a secure communication established (Alice wants to authenticate Bob, Bob has a pair of keys) 1. A -> are you Bob? -> B 2. B -> {are you Bob?}bobs-private-key -> A 3. A decrypts are you Bob? using bobs-public-key Insufficient: Not a good idea to send around things signed with a private key --- can be used for impersonation Carl can get Bob to digitally sign something: 1. C -> some data -> B 2. B -> {some data}bobs-private-key -> C 3. C -> {some data}bobs-private-key -> A Can use digests (hashes): Bob should create a digest from Alice s message Someone who tries to impersonate Bob cannot get the original message from the digest

So, how is a secure communication established (Alice wants to authenticate Bob, Bob has a pair of keys) 1. A -> are you Bob? -> B 2. B -> Alice, this is Bob -> A 3. B -> {digest[alice, this is Bob]}bobs-private-key -> A 4. A decrypts the digest using bobs-public-key 5. A applies the hash function to Alice, this is Bob, checks that the same digest is obtained Insufficient for handing out public keys 1. A -> are you Bob? -> B 2. B -> Alice, this is Bob, bobs-public-key -> A 3. A -> prove it -> B 4. B -> {digest[alice, this is Bob]}bobs-private-key -> A Anybody can be Bob, all they need is to generate a pair of keys Need to use certificates So, how is a secure communication established (Alice wants to authenticate Bob, Bob has a pair of keys) 1. A -> are you Bob? -> B 2. B -> Alice, this is Bob, bobs-certificate -> A 3. A -> prove it -> B 4. B -> {digest[alice, this is Bob]}bobs-private-key -> A May be insufficient for sending secrets 1. A -> are you Bob? -> B 2. B -> Alice, this is Bob, bobs-certificate -> A 3. A -> prove it -> B 4. B -> {digest[alice, this is Bob]}bobs-private-key -> A 5. A -> ok, here s a secret {secret}bobs-public-key -> B 6. B -> {some message}secret -> A May be susceptible to a parrot attack, where Carl sits between A and B; garbles messages encrypted by the secret key, hoping to get one in a right format

Should use Message Authentication Codes (MAC) MAC is computed as a digest of some piece of data and the secret: MAC = digest[some message, secret] Carl s attempts at garbling messages will have very little likelihood of success 1. A -> are you Bob? -> B 2. B -> Alice, this is Bob, bobs-certificate -> A 3. A -> prove it -> B 4. B -> {digest[alice, this is Bob]}bobs-private-key -> A 5. A -> ok, here s a secret {secret}bobs-public-key -> B 6. B -> {some message, digest[some message, secret]}secret -> A Finally, need to timestamp messages, to further protect against replay attacks SSL Secure Sockets Layer Network protocol for secure communications Encryption of data Authentication with digital certificates Widely used in Web commerce (https:// ) SSL basically implements the protocol on the previous slide

Using SSL with EJB-based J2EE applications Would like to use SSL for sending data during remote calls to methods of EJBs So that network sniffing does not hurt us Put the following in the jboss-service.xml configuration file: <mbean code="org.jboss.invocation.jrmp.server.jrmpinvoker" name="jboss:service=invoker,type=jrmp,sockettype=ssl"> <attribute name="rmiobjectport">4445</attribute> <attribute name="rmiclientsocketfactory"> org.jboss.security.ssl.rmisslclientsocketfactory</attribute> <attribute name="rmiserversocketfactory"> org.jboss.security.ssl.rmisslserversocketfactory</attribute> <attribute name="securitydomain">java:/jaas/rmi+ssl</attribute> </mbean> Using SSL with EJB-based J2EE applications (cont.) Put the following in the jboss.xml file <session> </session> <ejb-name>mybean</ejb-name> <configuration-name>standard Stateful SessionBean</configuration-name> <home-invoker>jboss:service=invoker,type=jrmp,sockettype=ssl</home-invoker> <bean-invoker>jboss:service=invoker,type=jrmp,sockettype=ssl</bean-invoker> Put the following in the jbossmqservice.xml file (only if you use JMS) <mbean code="org.jboss.mq.il.uil2.uilserverilservice" name="jboss.mq:service=invocationlayer,type=httpsuil2"> <depends optional-attribute-name="invoker">jboss.mq:service=invoker</depends> <attribute name="connectionfactoryjndiref"> HTTPSUIL2ConnectionFactory</attribute> <attribute name="xaconnectionfactoryjndiref"> HTTPSUIL2XAConnectionFactory</attribute> <!--... --> <attribute name="clientsocketfactory">org.jboss.security.ssl.clientsocketfactory</attribute> <attribute name="serversocketfactory">org.jboss.security.ssl.domainserversocketfactory</attribute> <attribute name="securitydomain">java:/jaas/rmi+ssl</attribute> </mbean>

Pitfalls of using cryptography in your applications Know when to use it Know when not to use it Know trade-offs involved Know infrastructure requirements Do not invent your own cryptographic algorithms Avoid coding existing cryptographic algorithms as much as possible Good crypto libraries are available Coding cryptography well is difficult Java Cryptography Architecture (JCA) Introduced in JDK 1.1, significantly extended since Designed with flexibility in mind Algorithm independence and extensibility Often, digital signatures from different algorithms can be used interdependently Engine classes: MessageDigest, Signature, KeyFactory, KeyPairGenerator, define cryptographic services in an abstract way (no implementation) Implementation independence and interoperability E.g., different implementations of an algorithm can deal with each other s keys Uses the concept of Cryptographic Service Provider A set of packages that implement cryptographic services (digital signature and message digest algorithms, key conversion, digital certificates, ) SUN is the default provider

Example: MessageDigest engine Provides hashing services Can request specific algorithms (SHA-1 or MD5) from the engine Factory method MessageDigest.getInstance(algName); Optionally, can ask for a specific provider MessageDigest.getInstance(algName, provider); The digest method performs hashing Byte array of arbitrary length is input Byte array (20 bytes for SHA-1, 16 bytes for MD5) is output Creating digital signatures Engine class Signature Can request the algorithm and/or provider to use, e.g. RSA with MD5 Factory methods create Signature objects Signature objects are modal (always in one of several possible states); initsign(publickey) SIGN update, sign, initsign UNINITIALIZED initverify initsign initverify(privatekey) VERIFY update, verify, initverify

Configuring providers Multiple cryptographic providers can be installed and used at the same time A provider may supply only some crypto services Providers can be given the order of preference E.g. for DES implementation, use the IBM provider; if that provider does not provide an implementation, use SUN If no provider has an implementation, NoSuchAlgorithmException is thrown Installing providers Usually distributed as JAR files Let the JVM know about providers and order of preference by modifying configuration file {$JAVAHOME}/lib/security/java.security E.g. security.provider.1=com.company.crypto.companyprovider security.provider.5=com.anothercompany.pack.prov In-class presentation of bookauction designs 15 minutes per group As many people as you want can do the presentation PowerPoint slides preferred Don t have to describe everything Concentrate on the changes to my design What are the entity beans? Do you have session beans? What login procedures did you design? Give a URL where remote and home interfaces for your EJBs will be published