Podcast
Questions and Answers
In number theory, which concept is utilized for organizing data and facilitating efficient storage within computer science?
In number theory, which concept is utilized for organizing data and facilitating efficient storage within computer science?
- Encryption
- Error correcting codes
- Random number generation
- Indexing (correct)
Given two integers, p and q, and that p divides q, which statement is true?
Given two integers, p and q, and that p divides q, which statement is true?
- _p_ is a multiple of _q_
- _q_ is a multiple of _p_ (correct)
- _q_ is a factor of _p_
- _p_ equals _q_
If a divides b and a also divides c, which of the following expressions is a guaranteed to divide?
If a divides b and a also divides c, which of the following expressions is a guaranteed to divide?
- b - c
- c / b
- b + c (correct)
- b * c
If an integer n is divisible by both integers x and y, what can be said about the relationship between x, y, and n?
If an integer n is divisible by both integers x and y, what can be said about the relationship between x, y, and n?
Which statement accurately describes a prime number?
Which statement accurately describes a prime number?
According to the Fundamental Theorem of Arithmetic, what is a necessary characteristic of the factors when a positive integer greater than 1 is expressed as a product?
According to the Fundamental Theorem of Arithmetic, what is a necessary characteristic of the factors when a positive integer greater than 1 is expressed as a product?
When testing if a number n is prime by checking for divisors, which set of numbers must you test as potential factors to determine primality?
When testing if a number n is prime by checking for divisors, which set of numbers must you test as potential factors to determine primality?
If n is a composite number, what does the theorem regarding prime divisors suggest?
If n is a composite number, what does the theorem regarding prime divisors suggest?
In the context of the division algorithm, given an integer a and a positive integer d, which expression is correct regarding the unique integers q and r?
In the context of the division algorithm, given an integer a and a positive integer d, which expression is correct regarding the unique integers q and r?
According to the division algorithm, what range does the remainder (r) fall into, given an integer a and a positive integer d?
According to the division algorithm, what range does the remainder (r) fall into, given an integer a and a positive integer d?
What is the formal definition of the greatest common divisor (gcd) of integers a and b?
What is the formal definition of the greatest common divisor (gcd) of integers a and b?
How is the greatest common divisor, gcd(a, b), found using factorization?
How is the greatest common divisor, gcd(a, b), found using factorization?
What defines the least common multiple (lcm) of two positive integers a and b?
What defines the least common multiple (lcm) of two positive integers a and b?
When calculating the least common multiple (lcm) of integers a and b using their prime factorizations, how are the prime factors used?
When calculating the least common multiple (lcm) of integers a and b using their prime factorizations, how are the prime factors used?
What is the key principle behind the Euclidean Algorithm for finding the greatest common divisor (GCD) of two numbers?
What is the key principle behind the Euclidean Algorithm for finding the greatest common divisor (GCD) of two numbers?
What does the expression 'a ≡ b (mod m)' signify in modular arithmetic?
What does the expression 'a ≡ b (mod m)' signify in modular arithmetic?
What condition must be met for a to be congruent to b modulo m?
What condition must be met for a to be congruent to b modulo m?
If a ≡ b (mod m) and c ≡ d (mod m), which congruence is always true?
If a ≡ b (mod m) and c ≡ d (mod m), which congruence is always true?
In the context of pseudorandom number generators, what is the role of the 'modulus' in the linear congruential method?
In the context of pseudorandom number generators, what is the role of the 'modulus' in the linear congruential method?
With regard to pseudorandom number generators using the linear congruential method, what are the constraints on the four chosen numbers (modulus m, multiplier a, increment c, and seed x₀)?
With regard to pseudorandom number generators using the linear congruential method, what are the constraints on the four chosen numbers (modulus m, multiplier a, increment c, and seed x₀)?
In computer science, hash functions are used, What is the primary purpose of a hash function?
In computer science, hash functions are used, What is the primary purpose of a hash function?
What is a potential problem that can arise when using a hash function?
What is a potential problem that can arise when using a hash function?
When a collision is detected in a hash table, and 'moving to the next available location' is used, what sequence of equations would try to find a space for k when modulo n?
When a collision is detected in a hash table, and 'moving to the next available location' is used, what sequence of equations would try to find a space for k when modulo n?
In the Caesar cipher, if A is shifted to D, what shift is applied?
In the Caesar cipher, if A is shifted to D, what shift is applied?
In the Caesar cipher encryption technique, the formula is represented as f(p) = (p + 3) mod 26. Given this, what formula returns the inverse function that would decode the message?
In the Caesar cipher encryption technique, the formula is represented as f(p) = (p + 3) mod 26. Given this, what formula returns the inverse function that would decode the message?
Which component specifies the set of all possible keys in a cryptosystem?
Which component specifies the set of all possible keys in a cryptosystem?
How does public key cryptography improve upon private key cryptosystems regarding key exchange?
How does public key cryptography improve upon private key cryptosystems regarding key exchange?
What mathematical property is fundamental to ensuring the security of the RSA cryptosystem?
What mathematical property is fundamental to ensuring the security of the RSA cryptosystem?
When using the RSA encryption method, what constitutes an individual's encryption key?
When using the RSA encryption method, what constitutes an individual's encryption key?
What must Alice and Bob initially agree upon in the Diffie-Hellman key exchange?
What must Alice and Bob initially agree upon in the Diffie-Hellman key exchange?
What is the binary representation of the decimal number 27?
What is the binary representation of the decimal number 27?
An integer is expressed in base 8 as (7016)₈. What is its decimal equivalent?
An integer is expressed in base 8 as (7016)₈. What is its decimal equivalent?
What is the decimal expansion of the hexadecimal number (2AE0B)₁₆?
What is the decimal expansion of the hexadecimal number (2AE0B)₁₆?
If the octal expansion of (12345)₁₀ is (30071)₈, what quotients gave the correct results, from right to left?
If the octal expansion of (12345)₁₀ is (30071)₈, what quotients gave the correct results, from right to left?
In the context of Algorithm 2 (Addition of Integers), what does the variable d
represent in each iteration of the loop?
In the context of Algorithm 2 (Addition of Integers), what does the variable d
represent in each iteration of the loop?
What represents pseudo code for Binary Exponentiation, calculating $x := (x * power) \text{ mod } m$?
What represents pseudo code for Binary Exponentiation, calculating $x := (x * power) \text{ mod } m$?
Flashcards
Number Theory
Number Theory
A branch of mathematics exploring integers and their properties.
Integers (Z)
Integers (Z)
Whole numbers including zero, positives, and negatives.
Positive Integers (Z+)
Positive Integers (Z+)
Whole numbers greater than zero.
Divides
Divides
Signup and view all the flashcards
Factor
Factor
Signup and view all the flashcards
Multiple
Multiple
Signup and view all the flashcards
Divisibility Property 1
Divisibility Property 1
Signup and view all the flashcards
Divisibility Property 2
Divisibility Property 2
Signup and view all the flashcards
Divisibility Property 3
Divisibility Property 3
Signup and view all the flashcards
Prime Number
Prime Number
Signup and view all the flashcards
Composite Number
Composite Number
Signup and view all the flashcards
Fundamental Theorem of Arithmetic
Fundamental Theorem of Arithmetic
Signup and view all the flashcards
Factorization
Factorization
Signup and view all the flashcards
Simple primality test
Simple primality test
Signup and view all the flashcards
Prime Divisor Theorem
Prime Divisor Theorem
Signup and view all the flashcards
Infinitude of Primes
Infinitude of Primes
Signup and view all the flashcards
Division Algorithm
Division Algorithm
Signup and view all the flashcards
Dividend
Dividend
Signup and view all the flashcards
Divisor
Divisor
Signup and view all the flashcards
Quotient
Quotient
Signup and view all the flashcards
Remainder
Remainder
Signup and view all the flashcards
Greatest Common Divisor (GCD)
Greatest Common Divisor (GCD)
Signup and view all the flashcards
Least Common Multiple (LCM)
Least Common Multiple (LCM)
Signup and view all the flashcards
Euclid's Algorithm
Euclid's Algorithm
Signup and view all the flashcards
Euclid algorithm steps
Euclid algorithm steps
Signup and view all the flashcards
Modular Arithmetic
Modular Arithmetic
Signup and view all the flashcards
Congruence Relation
Congruence Relation
Signup and view all the flashcards
Congruence properties
Congruence properties
Signup and view all the flashcards
Hash Function
Hash Function
Signup and view all the flashcards
Caesar Cipher
Caesar Cipher
Signup and view all the flashcards
Cryptosystem
Cryptosystem
Signup and view all the flashcards
Private key cryptosystem
Private key cryptosystem
Signup and view all the flashcards
Public key cryptosystem
Public key cryptosystem
Signup and view all the flashcards
Public known encryption key
Public known encryption key
Signup and view all the flashcards
Secret decryption keys
Secret decryption keys
Signup and view all the flashcards
RSA Cryptosystem
RSA Cryptosystem
Signup and view all the flashcards
Key Exchange
Key Exchange
Signup and view all the flashcards
Diffie Hellman
Diffie Hellman
Signup and view all the flashcards
RSA Encryption
RSA Encryption
Signup and view all the flashcards
RSA Decryption
RSA Decryption
Signup and view all the flashcards
Study Notes
Integers and Division
- Number theory explores integers and their properties
- Z represents the set of integers {..., -2, -1, 0, 1, 2, ...}
- Z+ represents the set of positive integers {1, 2, ...}
- Number theory finds applications in computer science, such as indexing, encryption, error correction, and random number generation
Division
- For integers a and b (a ≠ 0), a divides b if there exists an integer c such that b = ac
- If a divides b, then a is a factor of b, and b is a multiple of a
- The notation a | b signifies that a divides b
Divisibility Properties
- If a, b, and c are integers, then
- If a | b and a | c, then a | (b + c)
- If a | b, then a | bc for all integers c
- If a | b and b | c, then a | c
Primes and Composites
- A prime number is a positive integer greater than 1, divisible only by 1 and itself
- Examples of primes include: 2, 3, 5, 7, 11, 13, etc.
- A composite number is a positive integer greater than 1 that is not prime.
- Examples of composite numbers include: 4, 6, 8, 9, etc.
Fundamental Theorem of Arithmetic
- Any positive integer greater than 1 can be expressed as a product of prime numbers
- Factorization is the process of finding these prime factors
Factorization of Composites into Primes
- Examples include:
- 100 = 2 * 2 * 5 * 5 = 2² * 5²
- 99 = 3 * 3 * 11 = 3² * 11
Primality Testing
- Simple Approach 1: Test if any number x < n divides n; if so, n is composite
- Approach 2: Test if any prime x < n divides n; if so, n is composite.
- If n is relatively small, this test is good because we can enumerate (memorize) all small primes
- If n is large there can be larger not obvious primes
Theorem for Primality Testing
- If n is a composite number, then n has a prime divisor less than or equal to √n
- Approach 3: to test its primality, test if any prime number x < √n divides it
Number of Primes
- There are infinitely many primes
- Proof by Euclid: Assume a finite number of primes, p1, p2, ..., pn; then Q = p1p2...pn + 1 is not divisible by any of these primes, a contradiction
Division with Remainder
- For an integer a and a positive integer d, there are unique integers q and r with 0 ≤ r < d such that a = dq + r
- a is the dividend, d the divisor, q the quotient, and r the remainder
- q = a div d, r = a mod d
Greatest Common Divisor (GCD)
- For integers a and b, not both 0, the largest integer d such that d | a and d | b is the greatest common divisor, denoted gcd(a, b)
- Factoring can find the GCD by factoring a and b into their prime factorizations: a=p1^a1 * p2^a2 * p3^a3 ... pk^ak and b = p1^b1 * p2^b2 * p3^b3 ... pk^bk, then: gcd(a,b) = p1^min(a1,b1) * p2^min(a2,b2) * p3^min(a3,b3) ... pk^min(ak,bk)
Least Common Multiple (LCM)
- For two positive integers a and b, the least common multiple, denoted lcm(a, b), is the smallest positive integer divisible by both a and b
- Factoring can find the LCM by factoring a and b into their prime factorizations: a=p1^a1 * p2^a2 * p3^a3 ... pk^ak and b = p1^b1 * p2^b2 * p3^b3 ... pk^bk, then: lcm(a,b) = p1^max(a1,b1) * p2^max(a2,b2) * p3^max(a3,b3) ... pk^max(ak,bk)
Euclid's Algorithm
- Euclid's algorithm provides a more efficient method for computing the GCD, it is based on successively applying the division algorithm
- To find gcd(287, 91), divide the larger number (287) by the smaller one (91) to get 287 = 3*91 + 14
- Any divisor of 91 and 287 must also be a divisor of 14 and then gcd(287,91) = gcd(91,14)
- The same trick can be applied again
Modular Arithmetic
- Focuses on the remainder of an integer when divided by a positive integer
Congruency
- Integers a and b are congruent modulo m (a ≡ b (mod m)) if m divides a - b
- a ≡ b (mod m) if and only if a mod m = b mod m
Congruency Theorems
- Integers a and b are congruent modulo m if and only if there exists an integer k such that a = b + mk
- If a ≡ b (mod m) and c ≡ d (mod m), then:
- a + c ≡ b + d (mod m)
- ac ≡ bd (mod m)
- (a + b) mod m = ((a mod m) + (b mod m)) mod m
- ab mod m = ((a mod m)(b mod m)) mod m
Application of Modular Arithmetic in CS
- Modular arithmetic and congruencies are used in computer science for:
- Pseudorandom number generators
- Hash functions
- Cryptology
Pseudorandom Number Generators
- Needed to simulate random choices in programs
- Linear Congruential Method: Choose 4 numbers: the modulus m, multiplier a, increment c, and seed x0, such that 2 < a <m, 0 < c < m, 0 < x0 < m
- A sequence is generated by following formula xn+1 = (a*xn + c) mod m
Hash Functions
- Algorithms that map data of arbitrary length to data of a fixed length
- Returns hash values or hash codes
- A common hash function is h(k) = k mod n, where n is the number of available storage locations
Security
Cryptology
- Caesar Cipher: Shift letters in the message by 3, mapping last three letters to the first three
- If the index of the letter is p represented as: f(p) = (p + 3) mod 26
Cryptosystems
- A cryptosystem is a five-tuple (P, C, K, E, D), where:
- P is the set of plaintext strings
- C is the set of ciphertext strings
- K is the keyspace (the set of all possible keys)
- E is the set of encryption functions
- D is the set of decryption functions
Public Key Cryptography
- Shift cipher is an example of private key cryptosystems
- The encryption key can easily find the decryption key, it is necessary to exchange this key safely
- Public key cryptosystems as an alternative, were Introduced in 1970s
- Use a publicly known encryption key vs. secret decryption keys
- An extraordinary amount of work needed to recover the plaintext message without knowing decryption keys
The RSA cryptosystem
- Developed by Ronald Rivest, Adi Shamir and Leonard Adleman (1976) from the Massachusetts Institute of Technology
- Every User as an encryption key (n, e) comprised of:
- n: the product of two large primes p and q, say with 200 digits each.
- e: relatively prime to (p - 1)(q – 1)
RSA encryption
- A plaintext message M is first translated into sequences of two-digit numbers
- A is translated into 00, B into 01,..., and Jinto 09, etc.
- Concatenate these two-digit numbers into strings of digits
- Divide this string into equally sized blocks of 2N digits
- 2N: the largest even number such that the number 2525 ... 25 with 2N digits does not exceed n
- As a result, M is now translated into a sequence of integers ml,m2, ..., mk for some integer k.
- Transform each block mi to a ciphertext block ci, following this formala: C = Me mod n
RSA decryption
- Plaintext message can be quickly recovered when the decryption key d, an inverse of e modulo (p - 1)(q – 1), is known
- Follows the expression: Cd = (Me)d = Mde = M1+k(p-1)(q-1) (mod n)
RSA as public key system
- Because RSA cryptosystem is suitable for public key cryptography
- Possible to rapidly construct a public key by finding two large primes p and q, each with more than 200 digits
- Possible to find an integer e relatively prime to (p - 1)(q – 1)
- Quickly find an inverse d of e modulo (p - 1)(q – 1)
- However, no method is known to decrypt messages that is not based on finding a factorization of n
- The most efficient factorization methods known (as of 2010) require billions of years to factor 400-digit integers
Key exchange
- Key exchange occurs when two parties use to exchange a secret key over an insecure communications channel without having shared any information in the past
Diffie-Hellman key agreement protocol
- It happens when Suppose that Alice and Bob want to share a common key.
- The protocol follows these steps, where the computations are done in Zp
- Alice and Bob agree to use a prime p and a primitive root a of p
- Alice chooses a secret integer k1 and sends ak1 mod p to Bob
- Bob chooses a secret integer k2 and sends ak2 mod p to Alice
- Alice computes (ak2)k1 mod p
- Bob computes (ak1)k2 mod p
Representation of Integers
- In the modem world, we use decimal, or base 10, notation to represent integers. For example when we write 965, we mean 9 * 10^2 + 6 * 10^1 + 5 * 10^0
- Numbers can be represented with any positive integer "b" as it base
- Although base 2, 8 and 16 are important for computing and communications
Modular Exponentiation
- The expression = bak-12k-1... ba12 . bao means the same as = bak-12k-1 ... ba12 * bao
- It may be simplified by using the algorithm 5 called "modular exponentiation"
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.