LABORATORY EXERCISE 1 Public-Key Encryption

Similar documents
An Introduction to the RSA Encryption Method

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Mathematics of Internet Security. Keeping Eve The Eavesdropper Away From Your Credit Card Information

CSCE 465 Computer & Network Security

Network Security. HIT Shimrit Tzur-David

Using the Advanced Tier Data Collection Tool. A Troubleshooting Guide

Secure Network Communication Part II II Public Key Cryptography. Public Key Cryptography

Computer Networks. Network Security 1. Professor Richard Harris School of Engineering and Advanced Technology

Lecture 6 - Cryptography

Software Tool for Implementing RSA Algorithm

The application of prime numbers to RSA encryption

How To Know If A Message Is From A Person Or A Machine

Cyber Security Workshop Encryption Reference Manual

The science of encryption: prime numbers and mod n arithmetic

7! Cryptographic Techniques! A Brief Introduction

1. Go to your programs menu and click on Microsoft Excel.

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

Overview of Public-Key Cryptography

CRYPTOGRAPHY IN NETWORK SECURITY

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

A SOFTWARE COMPARISON OF RSA AND ECC

RSA Encryption. Tom Davis October 10, 2003

Number Theory and Cryptography using PARI/GP

Public Key Cryptography and RSA. Review: Number Theory Basics

Overview/Questions. What is Cryptography? The Caesar Shift Cipher. CS101 Lecture 21: Overview of Cryptography

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

Students will operate in pairs and teams of four to decipher and encipher information.

Hill s Cipher: Linear Algebra in Cryptography

Center for Internet Security. INTEGRATED INTELLIGENCE CENTER Technical White Paper William F. Pelgrin, CIS President and CEO

Public Key Cryptography: RSA and Lots of Number Theory

Insight Guide. Encryption: A Guide

Microsoft Excel Introduction to Microsoft Excel 2007

An Introduction to RSA Public-Key Cryptography

The Mathematics of the RSA Public-Key Cryptosystem

Number Theory and the RSA Public Key Cryptosystem

Applied Cryptography Public Key Algorithms

RSA Attacks. By Abdulaziz Alrasheed and Fatima

K80TTQ1EP-??,VO.L,XU0H5BY,_71ZVPKOE678_X,N2Y-8HI4VS,,6Z28DDW5N7ADY013

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

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

WHAT S NEW IN MS EXCEL 2013

Encrypting Your Using the free COMODO Secure Certificate

Advanced Excel Charts : Tables : Pivots : Macros

Overview Keys. Overview

RA MODEL VISUALIZATION WITH MICROSOFT EXCEL 2013 AND GEPHI

Cryptography: Motivation. Data Structures and Algorithms Cryptography. Secret Writing Methods. Many areas have sensitive information, e.g.

Cryptography: Authentication, Blind Signatures, and Digital Cash

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

Properties of Secure Network Communication

Q&As: Microsoft Excel 2013: Chapter 2

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

WS_FTP Pro. Addendum to User s Guide. Software Version 6.6. Ipswitch, Inc.

The Misuse of RC4 in Microsoft Word and Excel

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

Working with Macros and VBA in Excel 2007

JPMorgan Chase Treasury Workstation. Certification Setup Guide Version 2.0

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

Symmetric Key cryptosystem

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

Paillier Threshold Encryption Toolbox

Programming with TI-Nspire

Task Force on Technology / EXCEL

INTRODUCTION TO CRYPTOGRAPHY

Excel 2010: Create your first spreadsheet

Cryptography and Network Security Chapter 9

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

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING

A Novel Approach to combine Public-key encryption with Symmetric-key encryption

Computer Security: Principles and Practice

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

Shor s algorithm and secret sharing

SECURITY IN NETWORKS

Public Key Cryptography Overview

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

Module: Applied Cryptography. Professor Patrick McDaniel Fall CSE543 - Introduction to Computer and Network Security

Page 1. Session Overview: Cryptography

Call Centre Helper - Forecasting Excel Template

Measuring Success Information Collection & Evaluation (ICE) Tool User's Guide

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

Cryptography: RSA and Factoring; Digital Signatures; Ssh

SENDING S WITH MAIL MERGE

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works.

INTRODUCTION TO EXCEL

How To Use Amazon Cloud 2 On Linux And Windows 2 On A Pc Or Mac Or Ipad (For Pc) On A Microsoft Mac Or Macbook Or Ipa (For Mac) On An Ubuntu Or Ipro (For Windows

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

An Introduction to digital signatures

Sample- for evaluation purposes only! Advanced Excel. TeachUcomp, Inc. A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc.

A guide to bulk deposit submissions

MICROSOFT EXCEL 2010 ANALYZE DATA

Microsoft Excel 2013: Using a Data Entry Form

AN IMPLEMENTATION OF HYBRID ENCRYPTION-DECRYPTION (RSA WITH AES AND SHA256) FOR USE IN DATA EXCHANGE BETWEEN CLIENT APPLICATIONS AND WEB SERVICES

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

Step-by-Step Creating and Using an Excel Database

Maths delivers! A guide for teachers Years 11 and 12. RSA Encryption

SFWR ENG 4C03 - Computer Networks & Computer Security

Mail Merge Creating Mailing Labels 3/23/2011

Cryptography and Network Security

CJA 20. Automated Billing Program Attorney Training Guide EXCEL BILLING FOR CJA CASES. Page 1

Wireless Local Area. Network Security

Transcription:

CSC 4601 Spring, 2007 Name: LABORATORY EXERCISE 1 Public-Key Encryption When one transmits data over a packet-switched network, like the Internet, a packet sniffer at any node along the transmission path can detect packets with potentially useful information. Unfortunately, some of this information (for example, credit card numbers or other private information) is most useful to people with dishonorable (and often criminal) intentions. As commerce over the Internet and other vulnerable long-distance networks increases, this problem becomes more critical. Private data stored on a computer that s accessible over a network is also vulnerable One solution to this problem is to encipher data one wants to keep private. In other words, one can somehow scramble the data so that it s unrecognizable to anyone who does not have the necessary key to unscramble or decipher it. In so-called traditional encryption techniques, the same key is used for enciphering (or encryption) and deciphering (or decryption). The key is typically a large number that is used to mathematically transform the message. The problem then becomes the secure transmission of the key itself. One solution to this problem is to use two different keys one for encryption and the other for decryption. Alice could then send her encryption key to Bob 1, who could use it to send an encoded message back to Alice. Provided Alice keeps her decryption key private, no one who intercepts the message will be able to decode it. 2 In fact, Alice could make her encryption key publicly available, so that Carol, David, Egbert, or anyone else who wants to do so can send her an encoded message. So long as she keeps her decryption key secret, no one else will be able to read messages meant only for Alice. For this reason, this type of system is called a public-key encryption system. Often, the encryption key is called the public key, and the decryption key is called the private key. 1 Alice and Bob are the parties to encrypted data exchanges throughout the literature on encryption. If a third party is needed, she s often named Carol, for some reason. 2 I m assuming that Alice is using so-called strong encryption. Otherwise, a cryptanalyst someone whose profession is breaking codes who intercepts the message will still be able to decode it.

page 2 In this lab, you will be working with a simplified and not very secure version of one of the most popular public-key systems: the RSA public-key encryption system. 3 Like all public-key systems, the keys are derived using a trapdoor operation an operation that is easy to do but difficult to undo. In RSA, this operation is the multiplication of two large prime numbers: it is easy and fast to multiply the two numbers together, but it is significantly more difficult and time consuming to factor the resulting number back into its prime components. In this lab experience, you will be using relatively small primes (only three digits) to see how this system works. To explore this system in more depth, you will be exchanging encrypted messages with a partner. Choose your partner now. 1. Launch Microsoft Excel and open the spreadsheet rsa.xls. You may see a warning message informing you that the workbook contains macros. Since you will not need these macros to use the workbook (they are left over from an older and less efficient version of this lab), click on the Disable Macros button. 2. This spreadsheet makes use of some specialized functions that are not part of the standard function set in Microsoft Excel. However, they are included in an extra set of functions called the Analysis Toolpak. From the Tools menu, choose Add-Ins. In the dialogue box, click on the check box to the left of the entry Analysis Toolpak. When a checkmark appears, click on OK. 3. If necessary, click on the tab for the Key Selection worksheet. Use a random process to choose two different prime numbers p and q between 137 and 311 (displayed in a list in cells g5:i15). Enter these primes in cells B6 and B7. Be sure that cells C6 and C7 both display the message OK. The spreadsheet automatically computes the modulus (the product p*q) in cell B8 and the Euler totient (the product (p-1)*(q-1)) in cell B9. Note that the Euler totient would be difficult to determine from the modulus by itself; one needs to know the two primes. Write your two primes, your modulus, and your Euler totient below: p: q: modulus: Euler totient: 3 Named for its inventors Ron Rivest, Adi Shamir and Leonard Adelman.

page 3 4. Choose a small number (no more that two digits) that has no factors (except 1) in common with the Euler totient. Enter this number as your public key and enter it in cell B15. If cell C15 displays the message Invalid Public Key, you need to select a different public key. When you have chosen a valid public key, the message OK will appear in cell C15. The spreadsheet will automatically compute your private key in cell B20. The private key is chosen so that (Public Key)*(Private Key) leaves a remainder of one when divided by the Euler totient. (This would not be possible if the private had a factor other than 1 in common with the Euler totient.) Write your public and private keys below: Public key: Private key: 5. Once both you and your partner have each created a modulus and pair of keys, you are ready to exchange encrypted messages. Give your modulus and public key to your partner. Do not give your partner your private key or Euler totient. In return, your partner will give you her/his public key and modulus. 6. Click on the tab for the Encoding worksheet. Enter your partner s modulus and public key in cells B6 and B7. Write these values below: Partner s modulus: Partner s public key: 7. Enter a message in cell B11. This message should consist of a string of fifteen or more CAPITAL LETTERS with no spaces or punctuation marks. The spreadsheet will encipher only the first fifteen letters of your message. Your message could be a short phrase or sentence, your mother s name or your pet iguana s name. For example, I used RUTHJULIABENHAM and PLEASEHELPMENOW to test this spreadsheet. Note that a message to be enciphered is usually called plaintext. The enciphered form of the message is called the ciphertext.

page 4 8. The enciphered form of the message (the ciphertext) should appear in cell B13. (This may take a few seconds.) The spreadsheet determines the ciphertext as follows: Split the plaintext up into blocks of three letters (called trigraphs). Obtain a numeric representation for each letter based on its position in the alphabet (A 0, B 1, etc.). Compute a numeric code for each trigraph using the formula (First Letter Code) * 26 2 + (Second Letter Code) * 26 + (Third Letter code). For the mathematically inclined, this is interpreting each trigraph as a number in base twenty-six. Encipher each plaintext trigraph code by computing (Plaintext trigraph code) Public Key, dividing the result by the Modulus and taking the remainder. Convert each enciphered trigraph code into a quadragraph a block of four letters as follows: Divide the code by 26 3. The quotient is the code for the first letter of the quadragraph. The spreadsheet uses the remainder to get codes for the other three letters. Divide the remainder from the first step by 26 2. The quotient is the code for the second letter. The spreadsheet uses the remainder to get the codes for the other two letters. Divide the remainder from the second step by 26. The quotient is the code for the third letter and the remainder is the code for the fourth letter. For the mathematically inclined, this quadragraph calculation determines the representation of the enciphered message as a four-digit number in base twenty-six (using the letters of the alphabet as our digits).

page 5 Some of the details of this calculation appear in cells A16:K38 of the Encoding worksheet. Enter the plaintext and ciphertext below. Show the steps of the conversion process in the table. Plaintext: Plaintext Ciphertext Trigraph Trigraph Code Enciphered Code Quadragraph Ciphertext: 9. Give the ciphertext (but not the plaintext) to your partner. In return, your partner will give you a ciphertext message. Record the ciphertext message from your partner below. In the rest of this exercise, you will be deciphering this message. Ciphertext from partner: 10. Click on the tab for the Decoding worksheet. Enter your modulus and your private key in cells B6 and B7 of this worksheet. Enter the ciphertext you received from your partner as the Encrypted Message in cell B13. The deciphering process is similar to the enciphering process: Split the ciphertext up into quadragraphs (instead of trigraphs). Obtain the numeric representation for each letter and compute a numeric code for each trigraph using the formula (First Letter Code) * 26 3 + (Second Letter Code) * 26 2 + (Third Letter Code) * 26 + (Fourth Letter Code). Encipher each ciphertext quadragraph code by computing (Ciphertext quadragraph code) Private Key, dividing the result by the Modulus and taking the remainder

page 6 Convert each deciphered quadragraph code into a trigraph. Divide the code by 26 2. The quotient is the code for the first letter. Divide the remainder from the first step by 26. The quotient will be the code for the second letter and the remainder the code for the third. Note that deciphering uses the private key in place of the public key. Some of the details of this calculation appear in cells A19:D23 of the Decoding Worksheet. The deciphered message should appear in cell B13. Record the results of each deciphering step in the table below. Ciphertext Quadragraph Quadragraph Code Plaintext Deciphered Code Deciphered Trigraph Now, write the deciphered message (plaintext) below. Deciphered message: