第六屆 ACM ICPC 全國私立大專校院程式競賽. National Contest for Private Universities, Taiwan 2016 競賽題目

Size: px
Start display at page:

Download "第六屆 ACM ICPC 全國私立大專校院程式競賽. National Contest for Private Universities, Taiwan 2016 競賽題目"

Transcription

1 第六屆 ACM ICPC 全國私立大專校院程式競賽 National Contest for Private Universities, Taiwan 016 競賽題目

2 Problem 1: Maximum Subsequence Sum Problem (Time Limit: 3 seconds) Given a sequence containing both negative and positive integers. Find the contiguous subsequence with maximum sum. For example, for input {-, 11, -4, 13-5, -}, the answer is 0 (the nd through the 4th). If all numbers are negative, the result is maximum of them, i.e., smallest in terms of absolute value. Input The input begins with a single positive integer T (1 T 0) on a line by itself indicating the number of test cases following, each of them as described below. The first line of each test case contains a single integer N (1 N 10000) that indicates how many numbers are in the sequence. The second line contains N space-separated integers. All these numbers are between and Output For each test case, output one line of three space-separated integers: the maximum sum, the starting position, the ending position of the contiguous subsequence, respectively. If there is more than one such subsequence, output the one that has minimum length. If there is more than one subsequence of minimum length, output the one that occurs first. Sample Input Sample Output

3 Problem: Unlocking Steps Problem Description (Time Limit: 3 seconds) A combination lock is a locking device where a sequence of numbers is used to open the lock. The sequence is entered by rotating discs with inscribed numbers. Each disc is inscribed with following digits, 0, 1,, 3, 4, 5, 6, 7, 8, and 9, and the digit next to 9 is 0. Each disc can be rotated clockwise or counter clockwise. An unlock step is a neighboring digit rotation. For example, rotating one disc from 1 to costs 1 step. Rotating one disc from 0 to 9 also costs 1 step. There may be several digits on a lock. Given an initial number of a combination lock 11677, the minimum number of steps to unlock the lock to the key number is (1 0) + (4 1) + (6 4) + (10 7) + (7 5) = = 11. Input Format The first line is a number n indicating the number of test cases. Each test case has numbers in one line to represent the initial number and the key number of the lock. Output Format For each test case, output the minimum number of steps to unlock the lock. Technical Specification Number n is an integer. 1 n 10. The length of initial number or key number is 9 at most. Example Sample Input: Sample Output:

4 Problem3: Division of Polynomials (Time Limit: 3 seconds) A polynomial may be represented by two sequences, one contains the degrees in descending order of every term in the polynomial (zero-coefficient terms are not included) and the other contains the corresponding coefficients. For example, a polynomial 6x 3 + 5x - 7 is represented as {3,, 0} and {6, 5, -7}. Given two polynomials, print the resultant quotient and remainder polynomials after division of the two polynomials. The divisor is a monic polynomial in which the leading coefficient (the nonzero coefficient of highest degree) is equal to 1. Input The input begins with a single integer T (1 T 100) on a line by itself indicating the number of test cases following, each of them as described below. For each test case, the first line contains each polynomial term s degree (0 d 100) in descending order, the second line contains each term s coefficient (-100 c 100), and the last two lines form the divisor polynomial. All these numbers are integer. Output For each test case, print the paired sequences in separate lines (degree s first, then coefficient s) that represent resultant quotient polynomial, then similarly print the paired sequences that represent resultant remainder polynomial. Notice that either the quotient or the remainder polynomial may be empty (represented as {0} and {0}). Sample Input

5 Sample Output

6 Problem 4: Multiplicative Cipher (Time Limit: 3 seconds) Problem Description The multiplicative cipher is a type of substitution cipher where each letter of the plaintext is substituted with another letter to form the ciphertext. In the multiplicative cipher, encrypting and decrypting letters involved converting them to numbers, multiplying the key, and then converting the new number back to a letter. Your task is to write a program to decryption message using the multiplicative cipher. That is, given the key of the cipher and ciphertext, your program must output the plaintext. The plaintext/ciphertext contained only plus sign (+), uppercase letters (A to Z) and digits (0 to 9). The plaintext/ciphertext has been encrypted/decrypted via the following method. Encryption Convert the plaintext letters to numerical values as follows: + => 0, A => 1, B =>,, Z => 6, 0 => 7, 1 => 8, => 9,, 9 => 36. The encryption function for a single letter is C = k P (mod 37). P means the number corresponding to plaintext letter. C means the number corresponding to ciphertext letter. k is the key of the cipher. The value k must be chosen such that k and 37 are coprime. Convert the numerical values to ciphertext letters as follows: 0 => +, 1 => A, => B,, 6 => Z, 7 => 0, 8 => 1, 9 =>,, 36 => 9. Decryption Convert the ciphertext letters to numerical values as follows: + => 0, A => 1, B =>,, Z => 6, 0 => 7, 1 => 8, => 9,, 9 => 36.

7 The decryption function for a single letter is P = k -1 C (mod 37). k 1 is the modular multiplicative inverse of a modulo 37. That is, k k -1 = 1 (mod 37). Convert the numerical values to plaintext letters as follows: 0 => +, 1 => A, => B,, 6 => Z, 7 => 0, 8 => 1, 9 =>,, 36 => 9. Example with (k, k -1 ) = (5, 3): Plaintext letters: A B C D Plaintext numbers: Ciphertext numbers: Ciphertext letters: Y M A Z 7 V J 8 Input Format The first line of input indicates the number of test cases, T (1 T 100). For each case, the first line of input is the given cipher key, k (1 k 36). The next line of input is the ciphertext which is composed by one line and cannot exceed 70 characters of length. Output Format For each test case, the output should be a single line containing the original plaintext. Example Sample Input: 30 RFX+3VB+JFA+66U 19 DSHH4 Sample Output: HOW+ARE+YOU+007 HAPPY

8 Problem 5: Set Operations On Segments (time limit: seconds) You are given two sets of horizontal line segments on the X-axis. You are to compute the intersection and union of the two sets. In mathematics, a closed interval is defined as all the points between two endpoints and includes the endpoints. The intersection of two segments is defined as the closed interval where the two segments overlap. It follows from this definition that the intersection cannot be a single point; it must either be another segment or nothing. The union of two segments is defined as the smallest closed interval that contains both segments if and only if the two segments overlap or meet at an endpoint. Otherwise, the union results in the two original segments. Graphically, AB BC = ; AC BC = BC A B C D AB BC = AC ; AC BD = AD ; AB CD = AB and CD Input The first line of input is an integer K, K 10, that specifies the number of test cases for the problem. The rest of input is divided into two parts. The first part begins with a series of assignment statements, one statement per line terminated by the endof-line character, of the following format: For example, A= English alphabet=floating-point number The floating-point number is the coordinate of a point denoted by the alphabet. You can be certain there is no space before or after the assignment statement, and note that there is no space before or after the equal sign. This part of input is terminated by a line that contains two equal signs. The second part of input consists of K test cases, each case on two lines, and the test cases are separated again by a line with two equal signs. Each of the two lines specifies a set of segments, with each segment defined by giving its endpoints that are two alphabets from the previous part of input. There is no space within each group of two alphabets, and a blank separates consecutive groups. Each set of segments is terminated by the end-of-line character. You can be sure that segments from the same set do not overlap. However, segments which are joined at endpoints must be treated as a single segment.

9 Output Output is on two lines for each test case. The first line displays the intersection and the second line displays the union of the two sets. Each line consists of segments that result from a set operation. These segments must be listed from left to right, and each segment is specified by a pair of alphabets, with the alphabet of the left endpoint shown first followed by the alphabet of the right endpoint. As in the input, there is no space within a pair of alphabets, and a space separates two consecutive pairs. If the outcome of the intersection of the given sets is nothing, output "empty" on a single line. Sample Input A=.3 a=4.57 B=3.5 b=1.4 C=1.8 D=7.1 f=0.97 E=0. g=10.88 d=6.3 == CB DB gd fe Ab Ba dg == aa dd gd da Sample Output ba Ba dg Ef Cg empty Ag

10 Problem 6: Maximum Zero-Crossing Window (Time Limit: 3 seconds) The zero-crossing rate (ZCR) is the rate of sign-changes along a signal, i.e., the rate at which the signal changes from positive to negative or back. This feature has been used heavily in both speech recognition and music information retrieval, being a key feature to classify percussive sounds. In this problem, you will be given a sequence of signal strengths of length n, say, s 1, s,, and a window length w. The zero-crossing rate s n zcr p for such a window at location p is defined by where I() zcr p w 1 1 w 1 i1 I s s pi1 pi 0 is an indicator function whose value is 1 if and only if its argument is true. Your task is to find the location p whose corresponding window has the maximum zerocrossing rate. If there are more than one such locations, output the one with minimum index. For example, consider the following signal of length 10, and window length 5. The maximum zero-crossing rate window is located at position 1. Input The first line of input indicates the number of test cases T. These is a blank line before the test data of each case. The test data of each case spans several lines. The first line contains two integers n ( n ) and w ( w n ), and the next serval lines

11 contains n white character separated integers representing the signal strengths whose values are within and Output For each test case, output one line of a single integer, which represents the position of the maximum zero-crossing window. If there are more than one such window, output the one with minimum index. Sample Input Sample Output 1

12 Problem 7: Breaking Bad Ransomware (Time Limit: 3 seconds) Problem Description Cryptolocker is a kind of ransomware to lock victims valuable files from access by a strong cryptographic algorithm for data encryption. The scheme used is usually a public system and even the FBI has told the innocent users that the quick way to recover the files is to pay the ransom. However, the government authorities have been commanded to form a task force named: National Cryptolocker Protection Unit (NCPU in short) to release the innocence. They have found a flawed implementation of cryptolocker You are asked to decrypt the files. This implementation is an offline version of crytolocker. That is, the key is stored in the victim s disk using a sorting scheme based on the prime factorization. The scheme called prime factorization sorting (PFS in short) is described as follows. PFS: Numbers in the range of 1 to n must be sorted in terms of the number of factors in their prime factorization. In case of a tie, the smaller number will come first. For example, 0 = **5, so it has 3 numbers in its prime factorization. Similarly 35 = 5*7 has numbers in its prime factorization. Therefore, 35 will come before 0 according to this criterion. Given a key with m numbers and the plain text to be encrypted (a string), divide the plain text into substrings of length m and the characters of each substring are reordered to create the cipher text. The reordering is based on how the sorted key corresponds to the original key. For example, let's assume that the key is " ". The PFS sorted version of the key is " ". The six numbers in the sorted version have indices in the original key. Each substring in the plain text is reordered accordingly. For example, a substring "number" is reordered and encrypted to "bnmeru". Given the encrypted string: bnmeru and the key: , you are to output the decrypted string: number. When there are duplicate numbers in the key, their relative orders stay the same after sorting. For the key above, this means that the indices are and not

13 Let the last substring in the plain text has length k. If k<m, reorder the last substring using just the first k characters in the original key as its key. Input Format The first line is the number of test cases T. The next two lines are the key with m numbers n1 n nm separated with at least one space and the encrypted text. The maximum length of each encrypted string is L. The character of the string is restricted in 0-9A-Za-z. This is repeated for all the test cases. Output Format Each line should be the decrypted text of the encrypted string in a test case. Technical Specification Number T is an integer. 1 T 0. Numbers L is an integer. 1 L 100. Numbers m is an integer. 1 m 0. Number n1,n,,nm are integers. 1 n 0, n 1, n,, n m 3. Example Sample Input: testtest bnmeru edrlubpiekn Sample Output: testtest number redbluepink

14 Problem 8: Multiple shortest routes (Time Limit: 3 seconds) Problem Description There are n buildings, numbered from 0 to n 1, and m unidirectional roads. Without passing through any intermediate building, each road starts at one building and ends at another. Alice, who wants to go from building 0 to a destination building, knows the exact amount of time needed to go through each road. Please help her determine whether she has two or more quickest routes to choose from. Unless she has no routes at all to her destination, please also find the time needed to go along one of her quickest route(s). You may assume that Alice s destination building is not building 0. Input Format The first line is the number of test cases. Each test case is specified as follows: The first three lines are the number n of buildings, Alice s destination (which is a building) and the number m of edges. Each of the next m lines specifies a road by its starting building, its ending building and the amount of time (which is a positive integer) to go through it, in that order. Consecutive numbers in a line are separated by a space. Output Format For each test case, please output two lines. The first line is yes if there are two or more shortest routes to go from building 0 to Alice s destination, and it is no otherwise. If there is at least one route from building 0 to Alice s destination, then the second line is the minimum amount of time needed to go from building 0 to Alice s destination. Otherwise, it is x. Technical Specification The number of test cases is at most 15. n 100 is an integer. The amount of time needed to go through any road is a positive integer less than or equal to 100.

15 Example Sample Input: Sample Output: no 7 no x yes

Encryption à la Mod Name

Encryption à la Mod Name Rock Around the Clock Part Encryption à la Mod Let s call the integers,, 3,, 5, and the mod 7 encryption numbers and define a new mod 7 multiplication operation, denoted by, in the following manner: a

More information

NOWCODER.COM 牛客网 - 中国最大 IT 笔试 / 面试题库 一. 编程题

NOWCODER.COM 牛客网 - 中国最大 IT 笔试 / 面试题库 一. 编程题 牛客网暑期 ACM 多校训练营 ( 第三场 ) 一. 编程题. Eddy was a contestant participating in ACM ICPC contests. ACM is short for Algorithm, Coding, Math. Since in the ACM contest, the most important knowledge is about algorithm,

More information

Enhanced Play Fair Cipher

Enhanced Play Fair Cipher P Enhanced Play Fair Cipher 1 1 Naveen KMP P, PDepartment of Information Technology, Velammal Engineering College, Chennai, Tamil Nadu, India. Abstract The theme of this research work is to design and

More information

MAT 003 Brian Killough s Instructor Notes Saint Leo University

MAT 003 Brian Killough s Instructor Notes Saint Leo University MAT 003 Brian Killough s Instructor Notes Saint Leo University Success in online courses requires self-motivation and discipline. It is anticipated that students will read the textbook and complete sample

More information

Channel Coding and Cryptography Part II: Introduction to Cryptography

Channel Coding and Cryptography Part II: Introduction to Cryptography Channel Coding and Cryptography Part II: Introduction to Cryptography Prof. Dr.-Ing. habil. Andreas Ahrens Communications Signal Processing Group, University of Technology, Business and Design Email: andreas.ahrens@hs-wismar.de

More information

2016 靜宜大學全國程式競賽題目. Problem1:Largest Square. Description

2016 靜宜大學全國程式競賽題目. Problem1:Largest Square. Description Problem1:Largest Square 2016 靜宜大學全國程式競賽題目 Given a rectangular grid of characters you have to find out the length of a side of the largest square such that all the characters of the square are same and

More information

The 2016 ACM ICPC Vietnam National Programming Contest. The problem set consists of 11 problems: ICPC score distribution. Magical palindromic number

The 2016 ACM ICPC Vietnam National Programming Contest. The problem set consists of 11 problems: ICPC score distribution. Magical palindromic number The problem set consists of 11 problems: Problem A Problem B Problem C Problem D Problem E Problem F Problem G Problem H Problem I Problem J Problem K ICPC score distribution Magical palindromic number

More information

Senior Math Circles Cryptography and Number Theory Week 1

Senior Math Circles Cryptography and Number Theory Week 1 Senior Math Circles Cryptography and Number Theory Week 1 Dale Brydon Feb. 2, 2014 1 One-Time Pads Cryptography deals with the problem of encoding a message in such a way that only the intended recipient

More information

ENGI 8868/9877 Computer and Communications Security III. BLOCK CIPHERS. Symmetric Key Cryptography. insecure channel

ENGI 8868/9877 Computer and Communications Security III. BLOCK CIPHERS. Symmetric Key Cryptography. insecure channel (a) Introduction - recall symmetric key cipher: III. BLOCK CIPHERS k Symmetric Key Cryptography k x e k y yʹ d k xʹ insecure channel Symmetric Key Ciphers same key used for encryption and decryption two

More information

Introduction to Cryptography and Security Mechanisms. Abdul Hameed

Introduction to Cryptography and Security Mechanisms. Abdul Hameed Introduction to Cryptography and Security Mechanisms Abdul Hameed http://informationtechnology.pk Before we start 3 Quiz 1 From a security perspective, rather than an efficiency perspective, which of the

More information

Secret Key Systems (block encoding) Encrypting a small block of text (say 64 bits) General considerations for cipher design:

Secret Key Systems (block encoding) Encrypting a small block of text (say 64 bits) General considerations for cipher design: Secret Key Systems (block encoding) Encrypting a small block of text (say 64 bits) General considerations for cipher design: Secret Key Systems (block encoding) Encrypting a small block of text (say 64

More information

Math236 Discrete Maths with Applications

Math236 Discrete Maths with Applications Math236 Discrete Maths with Applications P. Ittmann UKZN, Pietermaritzburg Semester 1, 2012 Ittmann (UKZN PMB) Math236 2012 1 / 1 Block Ciphers A block cipher is an encryption scheme in which the plaintext

More information

Lecture 2 Algorithms with numbers

Lecture 2 Algorithms with numbers Advanced Algorithms Floriano Zini Free University of Bozen-Bolzano Faculty of Computer Science Academic Year 2013-2014 Lecture 2 Algorithms with numbers 1 RSA Algorithm Why does RSA work? RSA is based

More information

Substitution Ciphers, continued. 3. Polyalphabetic: Use multiple maps from the plaintext alphabet to the ciphertext alphabet.

Substitution Ciphers, continued. 3. Polyalphabetic: Use multiple maps from the plaintext alphabet to the ciphertext alphabet. Substitution Ciphers, continued 3. Polyalphabetic: Use multiple maps from the plaintext alphabet to the ciphertext alphabet. Non-periodic case: Running key substitution ciphers use a known text (in a standard

More information

A nice outline of the RSA algorithm and implementation can be found at:

A nice outline of the RSA algorithm and implementation can be found at: Cryptography Lab: RSA Encryption and Decryption Lab Objectives: After this lab, the students should be able to Explain the simple concepts of encryption and decryption to protect information in transmission.

More information

ACM-ICPC Indonesia National Contest Problem A. The Best Team. Time Limit: 2s

ACM-ICPC Indonesia National Contest Problem A. The Best Team. Time Limit: 2s Problem A The Best Team Time Limit: 2s ACM-ICPC 2010 is drawing near and your university want to select three out of N students to form the best team. The university however, has a limited budget, so they

More information

A.1 Numbers, Sets and Arithmetic

A.1 Numbers, Sets and Arithmetic 522 APPENDIX A. MATHEMATICS FOUNDATIONS A.1 Numbers, Sets and Arithmetic Numbers started as a conceptual way to quantify count objects. Later, numbers were used to measure quantities that were extensive,

More information

Medium Term Plan Year 6: Autumn Term

Medium Term Plan Year 6: Autumn Term Medium Term Plan Year 6: Autumn Term Block A1.a: Multiply integers and decimals by 10, 100 or 1000 AUTUMN TERM Block A1.b: Divide integers by 10, 100 or 1000, and divide decimals by 10 or 100 Block A1.c:

More information

Introduction to Cryptography and Security Mechanisms: Unit 5. Public-Key Encryption

Introduction to Cryptography and Security Mechanisms: Unit 5. Public-Key Encryption Introduction to Cryptography and Security Mechanisms: Unit 5 Public-Key Encryption Learning Outcomes Explain the basic principles behind public-key cryptography Recognise the fundamental problems that

More information

Lecture 1: Perfect Security

Lecture 1: Perfect Security CS 290G (Fall 2014) Introduction to Cryptography Oct 2nd, 2014 Instructor: Rachel Lin 1 Recap Lecture 1: Perfect Security Scribe: John Retterer-Moore Last class, we introduced modern cryptography and gave

More information

Lecture IV : Cryptography, Fundamentals

Lecture IV : Cryptography, Fundamentals Lecture IV : Cryptography, Fundamentals Internet Security: Principles & Practices John K. Zao, PhD (Harvard) SMIEEE Computer Science Department, National Chiao Tung University Spring 2012 Basic Principles

More information

B) Symmetric Ciphers. B.a) Fundamentals B.b) Block Ciphers B.c) Stream Ciphers

B) Symmetric Ciphers. B.a) Fundamentals B.b) Block Ciphers B.c) Stream Ciphers 1 B) Symmetric Ciphers B.a) Fundamentals B.b) Block Ciphers B.c) Stream Ciphers B.a) Fundamentals 2 B.1 Definition 3 A mapping Enc: P K C for which ϕ k := Enc(,k): P C is bijective for each k K is called

More information

Problem A - Complete the sequence

Problem A - Complete the sequence Problem A - Complete the sequence You probably know those quizzes in Sunday magazines: given the sequence 1, 2, 3,,, what is the next number? Sometimes it is very easy to answer, sometimes it could be

More information

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus)

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus) Math 30 Introduction to Proofs via Number Theory Robert Jewett (with small modifications by B. Ćurgus) March 30, 009 Contents 1 The Integers 3 1.1 Axioms of Z...................................... 3 1.

More information

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics Numbers & Number Systems Introduction Numbers and Their Properties Multiples and Factors The Division Algorithm Prime and Composite Numbers Prime Factors

More information

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value 1 Number System Introduction In this chapter, we will study about the number system and number line. We will also learn about the four fundamental operations on whole numbers and their properties. Natural

More information

Estimate A number that is close to an exact answer. An approximate answer.

Estimate A number that is close to an exact answer. An approximate answer. Estimate A number that is close to an exact answer. An approximate answer. Inverse Operations Operations used to undo each other + - X Product The result of multiplying two factors together. 3 x 4=12 Factor

More information

(D) 1 9 (E) 9 80 (A) 25% (B) 30% (C) 35% (D) 60% (E) 65% 6. What is the sum of the digits of the decimal form of the product ?

(D) 1 9 (E) 9 80 (A) 25% (B) 30% (C) 35% (D) 60% (E) 65% 6. What is the sum of the digits of the decimal form of the product ? 50th AHSME 999 2. 2 + 3 4 + 98 + 99 = (A) 50 (B) 49 (C) 0 (D) 49 (E) 50 2. Which one of the following statements is false? (A) All equilateral triangles are congruent to each other. (B) All equilateral

More information

5858 ASCII Expression

5858 ASCII Expression 5858 ASCII Expression Mathematical expressions appearing in old papers and old technical articles are printed with typewriter in several lines, where a fixed-width or monospaced font is required to print

More information

CS 97SI: INTRODUCTION TO PROGRAMMING CONTESTS. Jaehyun Park

CS 97SI: INTRODUCTION TO PROGRAMMING CONTESTS. Jaehyun Park CS 97SI: INTRODUCTION TO PROGRAMMING CONTESTS Jaehyun Park Today s Lecture Algebra Number Theory Combinatorics (non-computational) Geometry Emphasis on how to compute Sum of Powers n k=1 k 2 = 1 6 n(n

More information

Cryptography. What is Cryptography?

Cryptography. What is Cryptography? Cryptography What is Cryptography? Cryptography is the discipline of encoding and decoding messages. It has been employed in various forms for thousands of years, and, whether or not you know it, is used

More information

Mathematics. Jaehyun Park. CS 97SI Stanford University. June 29, 2015

Mathematics. Jaehyun Park. CS 97SI Stanford University. June 29, 2015 Mathematics Jaehyun Park CS 97SI Stanford University June 29, 2015 Outline Algebra Number Theory Combinatorics Geometry Algebra 2 Sum of Powers n k=1 k 3 k 2 = 1 n(n + 1)(2n + 1) 6 = ( k ) 2 = ( 1 2 n(n

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 7 January 30, 2012 CPSC 467b, Lecture 7 1/44 Public-key cryptography RSA Factoring Assumption Computing with Big Numbers Fast Exponentiation

More information

Cryptography Symmetric Cryptography Asymmetric Cryptography Internet Communication. Telling Secrets. Secret Writing Through the Ages.

Cryptography Symmetric Cryptography Asymmetric Cryptography Internet Communication. Telling Secrets. Secret Writing Through the Ages. Telling Secrets Secret Writing Through the Ages William Turner Department of Mathematics & Computer Science Wabash College Crawfordsville, IN 47933 Tuesday 4 February 2014 W. J. Turner Telling Secrets

More information

ACM ICPC2009 Latin American Regionals 1. Problem A Pangram. File code name: pangram

ACM ICPC2009 Latin American Regionals 1. Problem A Pangram. File code name: pangram ACM ICPC29 Latin American Regionals Problem A Pangram File code name: pangram Pangram Show is an exciting new television quiz show which offers very large cash prizes for correctly detecting if a sentence

More information

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element. The first exam will be on Wednesday, September 22, 2010. The syllabus will be sections 1.1 and 1.2 in Lax, and the number theory handout found on the class web site, plus the handout on the method of successive

More information

CRYPTOLOGY KEY MANAGEMENT CRYPTOGRAPHY CRYPTANALYSIS. Cryptanalytic. Brute-Force. Ciphertext-only Known-plaintext Chosen-plaintext Chosen-ciphertext

CRYPTOLOGY KEY MANAGEMENT CRYPTOGRAPHY CRYPTANALYSIS. Cryptanalytic. Brute-Force. Ciphertext-only Known-plaintext Chosen-plaintext Chosen-ciphertext CRYPTOLOGY CRYPTOGRAPHY KEY MANAGEMENT CRYPTANALYSIS Cryptanalytic Brute-Force Ciphertext-only Known-plaintext Chosen-plaintext Chosen-ciphertext 58 Types of Cryptographic Private key (Symmetric) Public

More information

CSCI 454/554 Computer and Network Security. Topic 3.1 Secret Key Cryptography Algorithms

CSCI 454/554 Computer and Network Security. Topic 3.1 Secret Key Cryptography Algorithms CSCI 454/554 Computer and Network Security Topic 3.1 Secret Key Cryptography Algorithms Outline Introductory Remarks Feistel Cipher DES AES 2 Introduction Secret Keys or Secret Algorithms? Security by

More information

S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 165

S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 165 S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 165 5.22. You are given a graph G = (V, E) with positive edge weights, and a minimum spanning tree T = (V, E ) with respect to these weights; you may

More information

Chapter 4 Section 2 Operations on Decimals

Chapter 4 Section 2 Operations on Decimals Chapter 4 Section 2 Operations on Decimals Addition and subtraction of decimals To add decimals, write the numbers so that the decimal points are on a vertical line. Add as you would with whole numbers.

More information

UAB MATH TALENT SEARCH

UAB MATH TALENT SEARCH NAME: GRADE: SCHOOL CODE: 2008-2009 UAB MATH TALENT SEARCH This is a two hour contest. Answers are to be written in the spaces provided on the test sheet. There will be no credit if the answer is incorrect.

More information

A triangle that has three acute angles Example:

A triangle that has three acute angles Example: 1. acute angle : An angle that measures less than a right angle (90 ). 2. acute triangle : A triangle that has three acute angles 3. angle : A figure formed by two rays that meet at a common endpoint 4.

More information

FOURTH GRADE Mathematics Standards for the Archdiocese of Detroit

FOURTH GRADE Mathematics Standards for the Archdiocese of Detroit FOURTH GRADE Mathematics Standards for the Archdiocese of Detroit *Provide 3 dates for each standard Initial Date(s) Operations and Algebraic Thinking. Use the four operations with whole numbers to solve

More information

NUMB3RS Activity: Creating Codes. Episode: Backscatter

NUMB3RS Activity: Creating Codes. Episode: Backscatter Teacher Page 1 NUMB3RS Activity: Creating Codes Topic: Codes Grade Level: 10-12 Objective: Explore several coding methods Time: 30+ minutes Materials: TI-83/84 Plus calculator Introduction While lecturing

More information

10.1 Introduction 10.2 Asymmetric-Key Cryptography Asymmetric-Key Cryptography 10.3 RSA Cryptosystem

10.1 Introduction 10.2 Asymmetric-Key Cryptography Asymmetric-Key Cryptography 10.3 RSA Cryptosystem [Part 2] Asymmetric-Key Encipherment Asymmetric-Key Cryptography To distinguish between two cryptosystems: symmetric-key and asymmetric-key; To discuss the RSA cryptosystem; To introduce the usage of asymmetric-key

More information

AIT 682: Network and Systems Security

AIT 682: Network and Systems Security AIT 682: Network and Systems Security Topic 3.1 Secret Key Cryptography Algorithms Instructor: Dr. Kun Sun Outline Introductory Remarks Feistel Cipher DES AES 2 Introduction Secret Keys or Secret Algorithms?

More information

RSA (material drawn from Avi Kak Lecture 12, Lecture Notes on "Computer and Network Security" Used in asymmetric crypto.

RSA (material drawn from Avi Kak Lecture 12, Lecture Notes on Computer and Network Security Used in asymmetric crypto. RSA (material drawn from Avi Kak (kak@purdue.edu) Lecture 12, Lecture Notes on "Computer and Network Security" Used in asymmetric crypto. protocols The RSA algorithm is based on the following property

More information

Fundamentals of Cryptography

Fundamentals of Cryptography Fundamentals of Cryptography Topics in Quantum-Safe Cryptography June 23, 2016 Part III Data Encryption Standard The Feistel network design m m 0 m 1 f k 1 1 m m 1 2 f k 2 2 DES uses a Feistel network

More information

Unit 2: Accentuate the Negative Name:

Unit 2: Accentuate the Negative Name: Unit 2: Accentuate the Negative Name: 1.1 Using Positive & Negative Numbers Number Sentence A mathematical statement that gives the relationship between two expressions that are composed of numbers and

More information

Traditional Symmetric-Key Ciphers. A Biswas, IT, BESU Shibpur

Traditional Symmetric-Key Ciphers. A Biswas, IT, BESU Shibpur Traditional Symmetric-Key Ciphers A Biswas, IT, BESU Shibpur General idea of symmetric-key cipher The original message from Alice to Bob is called plaintext; the message that is sent through the channel

More information

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl www.crypto-textbook.com Chapter 1 Introduction to Cryptography ver. October 28, 2010 These slides were

More information

Harvard-MIT Mathematics Tournament February 19, 2005

Harvard-MIT Mathematics Tournament February 19, 2005 Harvard-MIT Mathematics Tournament February 19, 2005 Guts Round... 1. [5] Find the largest positive integer n such that 1 + 2 + 3 + + n 2 is divisible by 1 + 2 + 3 + + n. 2. [5] Let x, y, and z be positive

More information

Problem A And Then There Was One Input: A.in. Let s play a stone removing game.

Problem A And Then There Was One Input: A.in. Let s play a stone removing game. ACM International Collegiate Programming Contest Asia Regional Contest, Tokyo, 2007 03 Problem A And Then There Was One Input: Ain Let s play a stone removing game Initially, n stones are arranged on a

More information

XVIII Open Cup named after E.V. Pankratiev Stage 10, Grand Prix of Korea, Sunday, February 4, 2018

XVIII Open Cup named after E.V. Pankratiev Stage 10, Grand Prix of Korea, Sunday, February 4, 2018 Problem A. Donut file: XVIII Open Cup named after E.V. Pankratiev 3 seconds 1024 mebibytes In this problem, we will use Chebyshev distance on a Cartesian plane. The Chebyshev distance between two points

More information

Cryptography Worksheet

Cryptography Worksheet Cryptography Worksheet People have always been interested in writing secret messages. In ancient times, people had to write secret messages to keep messengers and interceptors from reading their private

More information

This chapter continues our overview of public-key cryptography systems (PKCSs), and begins with a description of one of the earliest and simplest

This chapter continues our overview of public-key cryptography systems (PKCSs), and begins with a description of one of the earliest and simplest 1 2 3 This chapter continues our overview of public-key cryptography systems (PKCSs), and begins with a description of one of the earliest and simplest PKCS, Diffie- Hellman key exchange. This first published

More information

Section 1.2 Fractions

Section 1.2 Fractions Objectives Section 1.2 Fractions Factor and prime factor natural numbers Recognize special fraction forms Multiply and divide fractions Build equivalent fractions Simplify fractions Add and subtract fractions

More information

Math Introduction to Advanced Mathematics

Math Introduction to Advanced Mathematics Math 215 - Introduction to Advanced Mathematics Number Theory Fall 2017 The following introductory guide to number theory is borrowed from Drew Shulman and is used in a couple of other Math 215 classes.

More information

UNIT 1: INTEGERS Definition Absolute Value of an integer How to compare integers

UNIT 1: INTEGERS Definition Absolute Value of an integer How to compare integers UNIT 1: INTEGERS 1.1. Definition Integers are the set of whole numbers and their opposites. The number line is used to represent integers. This is shown below. The number line goes on forever in both directions.

More information

Geometric Constructions

Geometric Constructions HISTORY OF MATHEMATICS Spring 2005 Geometric Constructions Notes, activities, assignment; #3 in a series. Note: I m not giving a specific due date for this somewhat vague assignment. The idea is that it

More information

Integers and Mathematical Induction

Integers and Mathematical Induction IT Program, NTUT, Fall 07 Integers and Mathematical Induction Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology TAIWAN 1 Learning Objectives Learn about

More information

EE 595 (PMP) Introduction to Security and Privacy Homework 1 Solutions

EE 595 (PMP) Introduction to Security and Privacy Homework 1 Solutions EE 595 (PMP) Introduction to Security and Privacy Homework 1 Solutions Assigned: Tuesday, January 17, 2017, Due: Sunday, January 28, 2017 Instructor: Tamara Bonaci Department of Electrical Engineering

More information

1 Elementary number theory

1 Elementary number theory Math 215 - Introduction to Advanced Mathematics Spring 2019 1 Elementary number theory We assume the existence of the natural numbers and the integers N = {1, 2, 3,...} Z = {..., 3, 2, 1, 0, 1, 2, 3,...},

More information

CS 556 Spring 2017 Project 3 Study of Cryptographic Techniques

CS 556 Spring 2017 Project 3 Study of Cryptographic Techniques CS 556 Spring 2017 Project 3 Study of Cryptographic Techniques Project Due Dates: Part A: Due before class on CANVAS by Thursday, March 23, 2017 Part B: Due before class on CANVAS by Thursday April 6,

More information

Cryptography Functions

Cryptography Functions Cryptography Functions Lecture 3 1/29/2013 References: Chapter 2-3 Network Security: Private Communication in a Public World, Kaufman, Perlman, Speciner Types of Cryptographic Functions Secret (Symmetric)

More information

Great Theoretical Ideas in Computer Science. Lecture 27: Cryptography

Great Theoretical Ideas in Computer Science. Lecture 27: Cryptography 15-251 Great Theoretical Ideas in Computer Science Lecture 27: Cryptography What is cryptography about? Adversary Eavesdropper I will cut his throat I will cut his throat What is cryptography about? loru23n8uladjkfb!#@

More information

Algebra 1 Review. Properties of Real Numbers. Algebraic Expressions

Algebra 1 Review. Properties of Real Numbers. Algebraic Expressions Algebra 1 Review Properties of Real Numbers Algebraic Expressions Real Numbers Natural Numbers: 1, 2, 3, 4,.. Numbers used for counting Whole Numbers: 0, 1, 2, 3, 4,.. Natural Numbers and 0 Integers:,

More information

ECE 646 Fall 2009 Final Exam December 15, Multiple-choice test

ECE 646 Fall 2009 Final Exam December 15, Multiple-choice test ECE 646 Fall 2009 Final Exam December 15, 2009 Multiple-choice test 1. (1 pt) Parallel processing can be used to speed up the following cryptographic transformations (please note that multiple answers

More information

Chapter 3: Theory of Modular Arithmetic 1. Chapter 3: Theory of Modular Arithmetic

Chapter 3: Theory of Modular Arithmetic 1. Chapter 3: Theory of Modular Arithmetic Chapter 3: Theory of Modular Arithmetic 1 Chapter 3: Theory of Modular Arithmetic SECTION A Introduction to Congruences By the end of this section you will be able to deduce properties of large positive

More information

Classic Cryptography: From Caesar to the Hot Line

Classic Cryptography: From Caesar to the Hot Line Classic Cryptography: From Caesar to the Hot Line Wenyuan Xu Department of Computer Science and Engineering University of South Carolina Overview of the Lecture Overview of Cryptography and Security Classical

More information

36 Modular Arithmetic

36 Modular Arithmetic 36 Modular Arithmetic Tom Lewis Fall Term 2010 Tom Lewis () 36 Modular Arithmetic Fall Term 2010 1 / 10 Outline 1 The set Z n 2 Addition and multiplication 3 Modular additive inverse 4 Modular multiplicative

More information

Problem A. Character Encoding

Problem A. Character Encoding Problem A. Character Encoding second In computer science, a character is a letter, a digit, a punctuation mark or some other similar symbol. Since computers can only process numbers, number codes are used

More information

ARML Practice Problems Arvind Thiagarajan, May 7, 2006

ARML Practice Problems Arvind Thiagarajan, May 7, 2006 1 Geometry Problems ARML Practice Problems Arvind Thiagarajan, 005-006 May 7, 006 1. Find the coordinates of the point on the circle with equation (x 6) + (y 5) = 5 that is nearest the point (, 11). (TJ

More information

L2. An Introduction to Classical Cryptosystems. Rocky K. C. Chang, 23 January 2015

L2. An Introduction to Classical Cryptosystems. Rocky K. C. Chang, 23 January 2015 L2. An Introduction to Classical Cryptosystems Rocky K. C. Chang, 23 January 2015 This and the next set of slides 2 Outline Components of a cryptosystem Some modular arithmetic Some classical ciphers Shift

More information

Unit 3: Multiplication and Division Reference Guide pages x 7 = 392 factors: 56, 7 product 392

Unit 3: Multiplication and Division Reference Guide pages x 7 = 392 factors: 56, 7 product 392 Lesson 1: Multiplying Integers and Decimals, part 1 factor: any two or more numbers multiplied to form a product 56 x 7 = 392 factors: 56, 7 product 392 Integers: all positive and negative whole numbers

More information

Elementary number theory

Elementary number theory Elementary number theory The notion of primes, greatest common divisors, congruences and Euler s phi function. the number theoretic concepts and Sage commands Sage Implementation of the RSA algorithm.

More information

CRYPTOGRAPHY Thursday, April 24,

CRYPTOGRAPHY Thursday, April 24, CRYPTOGRAPHY 1 1. Really Big Numbers 2 One of the things I ve used on the Google is to pull up maps 3 You ve probably used the Google, too! Do you know where this company s strange name comes from? 4 Extract

More information

A Framework for Achieving the Essential Academic Learning. Requirements in Mathematics Grades 8-10 Glossary

A Framework for Achieving the Essential Academic Learning. Requirements in Mathematics Grades 8-10 Glossary A Framework for Achieving the Essential Academic Learning Requirements in Mathematics Grades 8-10 Glossary absolute value the numerical value of a number without regard to its sign; the distance of the

More information

XVIII Open Cup named after E.V. Pankratiev Stage 1: Grand Prix of Romania, Sunday, September 17, 2017

XVIII Open Cup named after E.V. Pankratiev Stage 1: Grand Prix of Romania, Sunday, September 17, 2017 Problem A. Balance file: 1 second 512 mebibytes We say that a matrix A of size N N is balanced if A[i][j] + A[i + 1][j + 1] = A[i + 1][j] + A[i][j + 1] for all 1 i, j N 1. You are given a matrix A of size

More information

(Practice Worksheet) MATHEMATICS

(Practice Worksheet) MATHEMATICS BIRLA PUBLIC SCHOOL, DOHA- QATAR (Practice Worksheet) MATHEMATICS CLASS 8 CHAPTER 1- RATIONAL NUMBERS I. Fill in the blanks: 1. If a is reciprocal of b, then reciprocal of b is. 2. The product of a rational

More information

CS669 Network Security

CS669 Network Security UNIT II PUBLIC KEY ENCRYPTION Uniqueness Number Theory concepts Primality Modular Arithmetic Fermet & Euler Theorem Euclid Algorithm RSA Elliptic Curve Cryptography Diffie Hellman Key Exchange Uniqueness

More information

Cryptosystems. Truong Tuan Anh CSE-HCMUT

Cryptosystems. Truong Tuan Anh CSE-HCMUT Cryptosystems Truong Tuan Anh CSE-HCMUT anhtt@hcmut.edu.vn 2 In This Lecture Cryptography Cryptosystem: Definition Simple Cryptosystem Shift cipher Substitution cipher Affine cipher Cryptanalysis Cryptography

More information

Overview of Conventional Encryption Techniques

Overview of Conventional Encryption Techniques Overview of Conventional Encryption Techniques Shadab Pasha CDGI,Indore shadabpasha@gmail.com Abstract: Symmetric Encryption or Single-key Encryption or Conventional Encryption was only the type of encryption

More information

Ch 3.4 The Integers and Division

Ch 3.4 The Integers and Division Integers and Division 1 Ch 3.4 The Integers and Division This area of discrete mathematics belongs to the area of Number Theory. Some applications of the concepts in this section include generating pseudorandom

More information

Page 1. Kobrin/Losquadro Math 8. Unit 10 - Types of Numbers Test Review. Questions 1 and 2 refer to the following:

Page 1. Kobrin/Losquadro Math 8. Unit 10 - Types of Numbers Test Review. Questions 1 and 2 refer to the following: 9195-1 - Page 1 Name: Date: Kobrin/Losquadro Math 8 Unit 10 - Types of Numbers Test Review Questions 1 and 2 refer to the following: Use the number line below to answer the given question. 1) Which of

More information

MAT 090 Brian Killough s Instructor Notes Strayer University

MAT 090 Brian Killough s Instructor Notes Strayer University MAT 090 Brian Killough s Instructor Notes Strayer University Success in online courses requires self-motivation and discipline. It is anticipated that students will read the textbook and complete sample

More information

DEPARTMENT OF MATHS, MJ COLLEGE

DEPARTMENT OF MATHS, MJ COLLEGE T. Y. B.Sc. Mathematics MTH- 356 (A) : Programming in C Unit 1 : Basic Concepts Syllabus : Introduction, Character set, C token, Keywords, Constants, Variables, Data types, Symbolic constants, Over flow,

More information

CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University. Name: ID#: Section #: Score: / 4

CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University. Name: ID#: Section #: Score: / 4 CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University Name: ID#: Section #: Score: / 4 Unit 7: Direct Proof Introduction 1. The statement below is true. Rewrite the

More information

Math 7 Glossary Terms

Math 7 Glossary Terms Math 7 Glossary Terms Absolute Value Absolute value is the distance, or number of units, a number is from zero. Distance is always a positive value; therefore, absolute value is always a positive value.

More information

LECTURE NOTES ON PUBLIC- KEY CRYPTOGRAPHY. (One-Way Functions and ElGamal System)

LECTURE NOTES ON PUBLIC- KEY CRYPTOGRAPHY. (One-Way Functions and ElGamal System) Department of Software The University of Babylon LECTURE NOTES ON PUBLIC- KEY CRYPTOGRAPHY (One-Way Functions and ElGamal System) By College of Information Technology, University of Babylon, Iraq Samaher@itnet.uobabylon.edu.iq

More information

UNC Charlotte 2009 Comprehensive March 9, 2009

UNC Charlotte 2009 Comprehensive March 9, 2009 March 9, 2009. Danica was driving in a 500 mile race. After 250 miles, Danica s average speed was 50 miles per hour. Approximately how fast should Danica drive the second half of the race if she wants

More information

A New Symmetric Key Algorithm for Modern Cryptography Rupesh Kumar 1 Sanjay Patel 2 Purushottam Patel 3 Rakesh Patel 4

A New Symmetric Key Algorithm for Modern Cryptography Rupesh Kumar 1 Sanjay Patel 2 Purushottam Patel 3 Rakesh Patel 4 IJSRD - International Journal for Scientific Research & Development Vol. 2, Issue 08, 2014 ISSN (online): 2321-0613 A New Symmetric Key Algorithm for Modern Cryptography Rupesh Kumar 1 Sanjay Patel 2 Purushottam

More information

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes Multiple-byte data CMSC 313 Lecture 03 big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes UMBC, CMSC313, Richard Chang 4-5 Chapter

More information

Name Date Class. Vertical angles are opposite angles formed by the intersection of two lines. Vertical angles are congruent.

Name Date Class. Vertical angles are opposite angles formed by the intersection of two lines. Vertical angles are congruent. SKILL 43 Angle Relationships Example 1 Adjacent angles are pairs of angles that share a common vertex and a common side. Vertical angles are opposite angles formed by the intersection of two lines. Vertical

More information

[Y2] Counting and understanding number. [Y2] Counting and understanding number. [Y2] Counting and understanding number

[Y2] Counting and understanding number. [Y2] Counting and understanding number. [Y2] Counting and understanding number Medium Term Plan : Year 2 Autumn Term Block A1.a: Count on and back in 1s or 10s from a 2- digit number; write figures up to 100 Block A1.b: Begin to count up to 100 objects by grouping in 5s or 10s; estimate

More information

2016 AMC 10A. x rem(x,y) = x y y. . What is the value of rem( 3 8, 2 5 )? (A) 3 8. denotes the greatest integer less than or equal to x y

2016 AMC 10A. x rem(x,y) = x y y. . What is the value of rem( 3 8, 2 5 )? (A) 3 8. denotes the greatest integer less than or equal to x y 206 AMC 0A February 2nd, 206 What is the value of! 0!? 9! (A) 99 (B) 00 (C) 0 (D) 2 (E) 32 2 For what value of x does 0 x 00 2x = 000 5? (A) (B) 2 (C) 3 (D) 4 (E) 5 3 ForeverydollarBenspentonbagels, Davidspent25centsless.

More information

An overview and Cryptographic Challenges of RSA Bhawana

An overview and Cryptographic Challenges of RSA Bhawana An overview and Cryptographic Challenges of RSA Bhawana Department of CSE, Shanti Devi Institute of Technology & Management, Israna, Haryana India ABSTRACT: With the introduction of the computer, the need

More information

Caltech Harvey Mudd Mathematics Competition March 3, 2012

Caltech Harvey Mudd Mathematics Competition March 3, 2012 Team Round Caltech Harvey Mudd Mathematics Competition March 3, 2012 1. Let a, b, c be positive integers. Suppose that (a + b)(a + c) = 77 and (a + b)(b + c) = 56. Find (a + c)(b + c). Solution: The answer

More information

Assignment 9 / Cryptography

Assignment 9 / Cryptography Assignment 9 / Cryptography Michael Hauser March 2002 Tutor: Mr. Schmidt Course: M.Sc Distributed Systems Engineering Lecturer: Mr. Owens CONTENTS Contents 1 Introduction 3 2 Simple Ciphers 3 2.1 Vignère

More information

Secret Sharing With Trusted Third Parties Using Piggy Bank Protocol

Secret Sharing With Trusted Third Parties Using Piggy Bank Protocol Secret Sharing With Trusted Third Parties Using Piggy Bank Protocol Adnan Memon Abstract This paper presents a new scheme to distribute secret shares using two trusted third parties to increase security

More information