Number Theory and Cryptography
- 112Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What does it mean for a nonzero integer a to divide an integer b, and what are the related terms for a and b?
112 questions
- 1
What does it mean for a nonzero integer a to divide an integer b, and what are the related terms for a and b?
Model answer
It means b=ac for some integer c. Then a is a divisor or factor of b, and b is a multiple of a.
Explanation
Divisibility means the quotient is an integer, so the division has no remainder.
- 2
State the three divisibility rules relating divisibility, sums, products, and chains.
Model answer
If a divides both b and c, it divides b+c; if a divides b, it divides bc for any integer c; and if a divides b and b divides c, then a divides c.
Explanation
These rules follow from expressing divisible numbers as integer multiples of their divisors.
- 3
What is a linear combination of b and c, and what follows if a divides both numbers?
Model answer
A linear combination is an expression mb+nc. If a divides both b and c, it divides every such combination for integers m and n.
Explanation
The divisibility rules for products and sums apply to each term and then to their sum.
- 4
State the division algorithm for an integer a and a positive integer d, including the permitted range of the remainder.
Model answer
There are unique integers q and r such that a=dq+r and 0≤r<d.
Explanation
The quotient and remainder are unique, and the remainder is nonnegative and smaller than the divisor.
- 5
In the division algorithm, what do dividend, divisor, quotient, and remainder represent, and how are quotient and remainder denoted?
Model answer
The dividend is a, the divisor is d, the quotient is q=adivd, and the remainder is r=amodd.
Explanation
The quotient gives the whole-number part of the division, while the remainder is what is left over.
- 6
What are the quotient and remainder when 101 is divided by 11, and what are they when −11 is divided by 3?
Model answer
For 101 divided by 11, the quotient is 9 and the remainder is 2. For −11 divided by 3, they are −4 and 1.
Explanation
The second division must have a nonnegative remainder: −11=3(−4)+1, whereas a remainder of −2 is not permitted.
- 7
Define congruence modulo a positive integer m and explain how it relates to remainders.
Model answer
a≡b(modm) means that m divides a−b. Equivalently, a and b have the same remainder when divided by m.
Explanation
Congruence groups integers according to their remainders modulo m.
- 8
State the characterization of congruence using an integer multiple of the modulus.
Model answer
a≡b(modm) if and only if a=b+km for some integer k.
Explanation
The integer k can be negative, zero, or positive; it counts signed steps of size m between the numbers.
- 9
How are the relation a≡b(modm) and the remainder expression amodm=bmodm different?
Model answer
Congruence is a relation that states whether two numbers are equivalent modulo m. The mod function returns a remainder.
Explanation
The two statements are equivalent as a test, but the word “mod” plays different roles in them.
- 10
How can congruences be combined under addition and multiplication?
Model answer
If a≡b(modm) and c≡d(modm), then a+c≡b+d(modm) and ac≡bd(modm).
Explanation
Numbers can be replaced by congruent numbers inside sums and products without changing the resulting congruence.
- 11
Which operations can safely be applied to both sides of a congruence, and why is division not generally one of them?
Model answer
Adding or multiplying both sides by an integer preserves congruence, but division may not. For example, 14≡8(mod6), while 7≡4(mod6).
Explanation
Division can destroy congruence unless the number being cancelled is relatively prime to the modulus.
- 12
How can a large sum or product modulo m be calculated using smaller numbers?
Model answer
Reduce each number modulo m, perform the addition or multiplication on the remainders, and reduce the result modulo m again.
Explanation
Congruence is preserved by addition and multiplication, so intermediate values can be kept small.
- 13
What is Zm, and how are addition and multiplication modulo m defined on it?
Model answer
Zm={0,1,…,m−1}. Add or multiply normally, then take the result modulo m.
Explanation
The reduced answer always lies in Zm.
- 14
Name the main arithmetic properties of Zm described in the content.
Model answer
It is closed under addition and multiplication; both operations are associative and commutative; 0 and 1 are their respective identities; every element has an additive inverse; and multiplication distributes over addition.
Explanation
For nonzero a, its additive inverse is m−a, while 0 is its own additive inverse.
- 15
Why does a multiplicative inverse not exist for every element of Zm?
Model answer
Some elements cannot be multiplied by any element of Zm to produce 1. For example, 2 has no multiplicative inverse modulo 6.
Explanation
The existence of an inverse depends on whether the element and the modulus are relatively prime.
- 16
What does a positional representation in base b mean, and what restrictions apply to its digits?
Model answer
A number is written as a sum of digits multiplied by powers of b. Each digit is from 0 to b−1, the leading digit is nonzero, and the representation is unique.
Explanation
The base specifies the place values; in base ten, for example, the places are powers of ten.
- 17
What are binary, octal, and hexadecimal, and which symbols can each use?
Model answer
Binary is base 2 and uses 0,1; octal is base 8 and uses 0 through 7; hexadecimal is base 16 and uses 0 through 9 and A through F.
Explanation
In hexadecimal, A through F represent 10 through 15.
- 18
Why are binary, octal, and hexadecimal useful in computing, and what do hexadecimal letters represent?
Model answer
Computers store data in binary, while octal and hexadecimal provide compact ways to represent binary values. The hexadecimal symbols A,B,C,D,E,F represent 10,11,12,13,14,15.
Explanation
Binary suits on/off computer circuits, and powers of 8 and 16 align conveniently with groups of binary digits.
- 19
How do you convert a binary number to decimal, and what do 1112 and 110112 equal?
Model answer
Multiply each bit by its corresponding power of 2 and add the results. 1112=7 and 110112=27.
Explanation
From right to left, binary place values are 20,21,22, and so on.
- 20
How do you convert an octal number to decimal, and what do 1118 and 70168 equal?
Model answer
Multiply each digit by its place value, a power of 8, and add. 1118=73 and 70168=3598.
Explanation
Octal place values from right to left are 80,81,82, and so on.
- 21
How do you convert a hexadecimal number to decimal, and what do E516 and 2AE0B16 equal?
Model answer
Replace letters with their values, multiply each digit by its power-of-16 place value, and add. E516=229 and 2AE0B16=175627.
Explanation
For example, E=14, A=10, and B=11.
- 22
Describe the repeated-division algorithm for converting a positive integer to base b.
Model answer
Repeatedly divide the current quotient by b and record each remainder. Stop when the quotient is zero, then read the remainders in reverse order.
Explanation
The first remainder is the rightmost base-b digit, and each subsequent remainder gives the next digit to its left.
- 23
What is the octal representation of decimal 12345, and how can it be checked?
Model answer
1234510=300718. Check by evaluating 3⋅84+7⋅8+1.
Explanation
Repeated division by 8 produces remainders from right to left; evaluating the resulting expansion recovers the original number.
- 24
Why can binary-to-octal and binary-to-hexadecimal conversion be done by regrouping bits, and what are the group sizes?
Model answer
Since 8=23, group binary bits in threes for octal; since 16=24, group them in fours for hexadecimal. Pad the left end with zeros if needed.
Explanation
Each group corresponds exactly to one digit in the target base.
- 25
What are the octal and hexadecimal forms of the binary string 11111010111100?
Model answer
Grouping from the right in threes gives 372748; grouping in fours gives 3EBC16.
Explanation
A leading zero is added before grouping when the bit count is not a multiple of the group size.
- 26
How does binary addition process each bit, including the carry?
Model answer
At each position, add the two input bits and the incoming carry. The sum bit is the result modulo 2, and the outgoing carry is the floor of the result divided by 2.
Explanation
The carry from the final position becomes the new top bit.
- 27
How does the shifted-partial-products method multiply binary integers, and what is its bit-operation cost for two n-bit inputs?
Model answer
For each 1 bit of one factor, shift the other factor left by that bit position, then add the partial products. The cost is O(n2) bit additions.
Explanation
There are n partial products, and adding each costs about n bit operations.
- 28
How does repeated squaring compute bn, and why is it more efficient than multiplying by b repeatedly?
Model answer
Write n in binary, build b,b2,b4,b8,… by successive squaring, and multiply the powers corresponding to 1 bits. This uses about O(logn) multiplications.
Explanation
For instance, 11=8+2+1, so 311=38⋅32⋅3.
- 29
How does modular exponentiation keep calculations small, and what is its stated bit-operation cost?
Model answer
Process the exponent's bits, multiply the running answer when a bit is 1, and square the current power each round, reducing modulo m after each multiplication. The stated cost is O((logm)2logn) bit operations.
Explanation
Reducing after each operation keeps values below m, and the loop runs once per exponent bit.
- 30
Define prime and composite numbers, and explain the status of 1.
Model answer
A prime is an integer greater than 1 whose only positive divisors are 1 and itself. A composite integer greater than 1 is not prime; 1 is neither.
Explanation
A composite number has a divisor strictly between 1 and itself.
- 31
State the Fundamental Theorem of Arithmetic and illustrate it with the factorizations of 100 and 999.
Model answer
Every integer greater than 1 has a unique prime factorization, up to the order of its factors. For example, 100=22⋅52 and 999=33⋅37.
Explanation
Prime factors act like the unique building blocks of each integer.
- 32
How does the Sieve of Eratosthenes identify primes up to 100, and why is it enough to cross out multiples of 2,3,5,7?
Model answer
Keep each prime and cross out its other multiples. These four primes suffice because every composite n≤100 has a prime divisor no greater than n≤10.
Explanation
Any composite number has a factor at most its square root; the primes below 10 are 2,3,5,7.
- 33
What is trial division, and why is checking divisors only through n sufficient?
Model answer
Test integers from 2 through n for divisibility by n. If none divides n, then n is prime.
Explanation
If n=ab is composite, its factors cannot both exceed n.
- 34
How does Euclid's proof show that there are infinitely many primes?
Model answer
Assume the primes are a finite list and form their product plus one. No listed prime divides that number, so it has a prime factor missing from the list, a contradiction.
Explanation
The constructed number is either prime itself or has a prime factor not in the supposed complete list.
- 35
What is a Mersenne prime, and why does a prime exponent not guarantee one?
Model answer
A Mersenne prime is a prime of the form 2p−1, where the result is prime. A prime exponent is not enough: 211−1=2047=23⋅89 is composite.
Explanation
Some examples are 22−1=3 and 27−1=127, but the form does not always produce a prime.
- 36
What does the prime number theorem say about the number of primes up to x and the chance a large integer is prime?
Model answer
The number of primes up to x is approximately x/lnx. A randomly selected integer below n has probability about 1/lnn of being prime.
Explanation
The estimate becomes more accurate as x grows, so primes become rarer but slowly.
- 37
What does the content state about simple formulas or nonconstant integer-coefficient polynomials that always produce primes?
Model answer
There is no simple formula that always produces primes, and no nonconstant polynomial with integer coefficients does so for every input.
Explanation
A constant polynomial such as the constant value 2 is an excluded, trivial exception.
- 38
Why does n2−n+41 not give a prime for every input, despite producing primes for n=1 through 40?
Model answer
At n=41, the expression equals 412, which is composite.
Explanation
Many successful examples are evidence, not proof of a universal claim.
- 39
State Goldbach's conjecture and distinguish its computational evidence from a proof.
Model answer
It conjectures that every even integer greater than 2 is the sum of two primes. It has been checked computationally to a very large range, but no proof is known.
Explanation
Examples include 10=3+7 and 20=3+17; extensive verification does not establish the claim for all even numbers.
- 40
What are the twin prime conjecture and the conjecture about primes of the form n2+1?
Model answer
The twin prime conjecture proposes infinitely many prime pairs differing by 2. It is also conjectured that infinitely many n2+1 are prime; neither claim is proved.
Explanation
Examples of twin primes include (3,5) and (11,13).
- 41
What weaker result about numbers of the form n2+1 is stated?
Model answer
Infinitely many numbers of the form n2+1 are either prime or a product of at most two primes.
Explanation
This result is weaker than the unproved claim that infinitely many such numbers are prime.
- 42
What is the greatest common divisor, and when are two integers called relatively prime?
Model answer
The greatest common divisor is the largest positive integer dividing both numbers. They are relatively prime when their greatest common divisor is 1.
Explanation
For example, gcd(24,36)=12, while gcd(17,22)=1.
- 43
What does it mean for a list of integers to be pairwise relatively prime?
Model answer
Every pair of distinct entries in the list must have greatest common divisor 1.
Explanation
One pair with a common divisor greater than 1 makes the whole list fail the condition.
- 44
How is the greatest common divisor obtained from prime factorizations?
Model answer
For each prime, take the smaller exponent in the two factorizations, treating a missing prime as exponent 0, and multiply the resulting prime powers.
Explanation
For example, 120=23⋅3⋅5 and 500=22⋅53 give gcd(120,500)=22⋅5=20.
- 45
How is the least common multiple obtained from prime factorizations, and what is its defining meaning?
Model answer
The least common multiple is the smallest positive common multiple; use the larger exponent of each prime in the two factorizations.
Explanation
For 23⋅35⋅72 and 24⋅33, the LCM is 24⋅35⋅72.
- 46
State the relationship between the product of two positive integers, their GCD, and their LCM.
Model answer
ab=gcd(a,b)lcm(a,b).
Explanation
For each prime, the smaller and larger exponents used in the GCD and LCM sum to the two original exponents.
- 47
State the key remainder property behind the Euclidean algorithm.
Model answer
If a=bq+r, then gcd(a,b)=gcd(b,r).
Explanation
The pairs (a,b) and (b,r) have exactly the same common divisors.
- 48
Use the Euclidean algorithm to find gcd(287,91) and describe its stopping rule.
Model answer
287=3⋅91+14, 91=6⋅14+7, and 14=2⋅7+0, so the GCD is 7. Stop when the remainder is zero; the last nonzero remainder is the GCD.
Explanation
Each step replaces the pair by the divisor and remainder without changing the GCD.
- 49
Why must the Euclidean algorithm terminate, and what running time is stated for it?
Model answer
Each remainder is a nonnegative integer strictly smaller than the preceding divisor, so the remainders cannot decrease forever. Its running time is O(logb) when a≥b.
Explanation
The finite decreasing sequence must eventually reach remainder zero.
- 50
State Bezout's identity and explain what Bezout coefficients may look like.
Model answer
For positive integers a,b, there are integers s,t such that gcd(a,b)=sa+tb. The coefficients may be negative.
Explanation
For example, 2=(−2)⋅6+1⋅14.
- 51
How can Bezout coefficients be found using the Euclidean algorithm?
Model answer
Run the Euclidean algorithm forward, record each division, then substitute remainders backward until the GCD is expressed using the original numbers.
Explanation
For 252 and 198, back-substitution gives 18=4⋅252−5⋅198.
- 52
What is the extended Euclidean algorithm's advantage over backward substitution?
Model answer
It carries the Bezout coefficients along during the divisions, finding them in one pass rather than substituting backward afterward.
Explanation
It is therefore a convenient method for a computer to use.
- 53
State the divisibility consequence of Bezout's identity when a and b are relatively prime.
Model answer
If gcd(a,b)=1 and a∣bc, then a∣c.
Explanation
Bezout gives sa+tb=1; multiplying by c shows that c is a sum of terms both divisible by a.
- 54
What does the prime-divisor lemma say about a prime dividing a product?
Model answer
If a prime p divides a product a1a2⋯an, then it divides at least one factor.
Explanation
A prime dividing a product must divide one factor outright.
- 55
How does the prime-divisor lemma support uniqueness of prime factorization?
Model answer
If two prime factorizations differed, a prime in one would have to divide a prime in the other, forcing the two primes to be equal and contradicting the supposed difference.
Explanation
After common primes are cancelled, the prime-divisor lemma forces a shared prime to remain, which is impossible.
- 56
Under what condition can a common factor be cancelled from a congruence?
Model answer
From ac≡bc(modm), one can conclude a≡b(modm) when gcd(c,m)=1.
Explanation
Cancellation can fail when c and m share a common factor, as in 14≡8(mod6) but 7≡4(mod6) after dividing by 2.
- 57
What is a linear congruence, and how are its solutions organized?
Model answer
A linear congruence has the form ax≡b(modm). If x is a solution, then so are x+km for integers k, so solutions occur in congruence classes.
Explanation
The number of solution classes depends on a and m.
- 58
What do the examples 2x≡3(mod6) and 2x≡2(mod6) show about linear congruences?
Model answer
The first has no solution; the second has two solution classes, x≡1(mod6) and x≡4(mod6).
Explanation
A linear congruence need not have exactly one solution class.
- 59
Define an inverse of a modulo m and explain how it is used to solve a linear congruence.
Model answer
An inverse aˉ satisfies aˉa≡1(modm). Multiplying ax≡b(modm) by aˉ isolates x.
Explanation
Multiplication preserves congruence, whereas ordinary division may not.
- 60
When does an inverse of a modulo m exist, and how can Bezout's identity establish its existence?
Model answer
For m>1, an inverse exists when gcd(a,m)=1. If sa+tm=1, reducing modulo m gives sa≡1(modm), so s is an inverse.
Explanation
The Euclidean algorithm can efficiently find the GCD and the Bezout coefficients.
- 61
How can the inverse of 3 modulo 7 be found from the Euclidean algorithm?
Model answer
7=2⋅3+1, so 1=7−2⋅3. Thus −2 is an inverse of 3 modulo 7, and its representative from 0 to 6 is 5.
Explanation
Both −2 and 5 work because they are congruent modulo 7.
- 62
Solve 3x≡4(mod7) and explain how to verify the solution.
Model answer
Multiplying by the inverse −2 gives x≡6(mod7). Substitution gives 3x≡18≡4(mod7).
Explanation
The full solution consists of every integer congruent to 6 modulo 7.
- 63
State the Chinese Remainder Theorem for pairwise relatively prime moduli.
Model answer
For pairwise relatively prime moduli m1,…,mn, any system of specified congruences has a unique solution modulo M=m1m2⋯mn.
Explanation
There is one representative solution in the range from 0 to M−1; all others differ by multiples of M.
- 64
How does the constructive proof of the Chinese Remainder Theorem build a solution?
Model answer
Set M=∏mk, let Mk=M/mk, find yk with Mkyk≡1(modmk), and form x=∑akMkyk.
Explanation
Modulo mk, every term except the kth vanishes, and the kth becomes ak.
- 65
What is the solution to Sun-Tsu's system x≡2(mod3), x≡3(mod5), x≡2(mod7)?
Model answer
The smallest nonnegative solution is x≡23(mod105).
Explanation
The moduli are pairwise relatively prime, and 23 leaves remainders 2,3,2 on division by 3,5,7.
- 66
How does back substitution solve a system of congruences one equation at a time?
Model answer
Rewrite the first congruence as an equation with an integer parameter, substitute into the next congruence, solve for the new parameter, and repeat before converting the final equation back to a congruence.
Explanation
For x≡1(mod5), x≡2(mod6), x≡3(mod7), this method gives x≡206(mod210).
- 67
State both forms of Fermat's little theorem given in the content.
Model answer
If p is prime and p∤a, then ap−1≡1(modp). For every integer a, ap≡a(modp).
Explanation
The second form does not require the condition that a is not divisible by p.
- 68
Use Fermat's little theorem to reduce 7222 modulo 11.
Model answer
710≡1(mod11) and 222=22⋅10+2, so 7222≡72≡5(mod11).
Explanation
The exponent's multiple of 10 contributes a factor congruent to 1.
- 69
What is a pseudoprime to base b, and what can a failed or passed Fermat test establish?
Model answer
A composite n with bn−1≡1(modn) is a pseudoprime to base b. Failure proves n composite; passing means it may be prime or a pseudoprime.
Explanation
Passing a Fermat test is evidence, not a proof of primality.
- 70
Why is 341 a pseudoprime to base 2?
Model answer
341=11⋅31 is composite, but 210≡1(mod341) and 340=34⋅10, so 2340≡1(mod341).
Explanation
It passes the base-2 Fermat test despite being composite.
- 71
What is a primitive root modulo a prime p?
Model answer
It is a number whose positive powers modulo p reach every nonzero residue exactly once before repeating.
Explanation
Its powers generate all nonzero elements of Zp.
- 72
Why is 2 a primitive root modulo 11, while 3 is not?
Model answer
The powers of 2 reach all ten nonzero residues modulo 11. The powers of 3 return to 1 after five steps and reach only five values.
Explanation
A primitive root must generate every nonzero residue before the powers repeat.
- 73
What is a discrete logarithm modulo a prime, and why is the problem important in cryptography?
Model answer
For a primitive root r, the discrete logarithm of a is the exponent e such that re≡aext(modp). Computing powers is efficient, but recovering the exponent for large parameters is not known to be efficient for ordinary computers.
Explanation
This difference between easy forward computation and difficult reversal is useful in cryptographic systems.
- 74
How does a hashing function map keys to storage locations, and what does h(k)=kmodm guarantee?
Model answer
It maps a record's key to a memory location; h(k)=kmodm maps keys into 0,…,m−1.
Explanation
Every location in that range can be reached by the modulo function.
- 75
What is a collision in hashing, why are collisions unavoidable, and how does linear probing handle them?
Model answer
A collision occurs when different keys map to the same location. Collisions are unavoidable when there are more possible keys than locations; linear probing tries (h(k)+i)modm until it finds an empty slot.
Explanation
Taking modulo m makes probing wrap from the end of the table back to its beginning.
- 76
What are pseudorandom numbers, and what does a linear congruential generator do?
Model answer
Pseudorandom numbers are generated by a fixed rule that looks random. A linear congruential generator uses xn+1=(axn+c)modm.
Explanation
The parameters are the modulus, multiplier, increment, and starting seed.
- 77
What controls the range and period of a linear congruential generator, and why must a pure multiplicative generator avoid a zero seed?
Model answer
Outputs lie from 0 to m−1, and the period is the number of terms before the sequence repeats. If c=0 and the seed is 0, every output remains 0.
Explanation
A good generator needs a long period; once a value repeats, the deterministic sequence repeats.
- 78
For xn+1=(7xn+4)mod9 with x0=3, what sequence is produced before it repeats?
Model answer
The sequence is 3,7,8,6,1,2,0,4,5, then it returns to 3.
Explanation
There are nine possible residues modulo 9, and this example visits all nine before repeating.
- 79
What is a check digit, and how can a weighted-sum rule detect an error?
Model answer
A check digit is an extra digit chosen to make a weighted sum satisfy a modular condition. A mistyped digit changes the sum and may cause the condition to fail.
Explanation
The check can signal an error without identifying or correcting it.
- 80
State the Universal Product Code check-digit rule described in the content.
Model answer
Multiply digits in odd positions by 3, leave digits in even positions unchanged, and require the total to be congruent to 0 modulo 10.
Explanation
Weighting alternate positions differently also helps detect swaps of neighboring digits.
- 81
What check digit completes the UPC whose first eleven digits are 79357343104?
Model answer
The check digit is 2.
Explanation
The weighted sum of the first eleven digits is 98, so adding 2 makes the total 100, a multiple of 10.
- 82
What conclusion follows when a full UPC's weighted sum is not congruent to 0 modulo 10?
Model answer
The UPC fails the check and contains an error, but the test does not identify the incorrect digit or the correct code.
Explanation
The example code with weighted sum 44 fails because 44≡0(mod10).
- 83
State the ISBN-10 check-digit rule and explain why the letter X may appear.
Model answer
Multiply the ten digits by their position weights 1 through 10 and require the weighted sum to be 0 modulo 11. The value 10 is written as X.
Explanation
Equivalently, the check digit is selected from the first nine digits so that the full weighted sum is divisible by 11.
- 84
What check digit completes the ISBN with first nine digits 007288008?
Model answer
The check digit is 2.
Explanation
The first nine weighted terms sum to 189, and 189mod11=2.
- 85
Why does the ISBN-10 rule detect every single-digit error and every transposition error, according to the content?
Model answer
Its modulus is the prime 11, so a changed digit or a swap of two distinct digits changes the weighted sum by a nonzero amount modulo 11.
Explanation
Modulo a prime, a product can be zero only if at least one factor is zero, so the change cannot be cancelled by the weights.
- 86
How does the Caesar cipher encode letters mathematically, and what are its encryption and decryption operations?
Model answer
Represent letters by numbers 0 through 25. Encrypt with f(p)=(p+3)mod26 and decrypt with f−1(p)=(p−3)mod26.
Explanation
The modulo operation wraps shifts past Z back to the beginning of the alphabet.
- 87
What ciphertext does the Caesar cipher produce for “MEET YOU,” and why does Y encrypt to B?
Model answer
It produces “PHHW BRX.” Since Y is 24, adding 3 gives 27, which reduces to 1, or B, modulo 26.
Explanation
Each letter is shifted three positions forward with alphabetic wraparound.
- 88
What is a shift cipher, and why is its key easy to find by exhaustive search?
Model answer
A shift cipher adds a fixed key k modulo 26 and decrypts by subtracting k. There are only 26 possible keys.
Explanation
A person trying every possible key can test each resulting message for readable text.
- 89
How is an affine cipher defined, and what condition makes it decryptable?
Model answer
It encrypts by f(p)=(ap+b)mod26. It is decryptable exactly when gcd(a,26)=1.
Explanation
That condition makes the mapping a bijection and ensures that a has a multiplicative inverse modulo 26.
- 90
How is an affine cipher decrypted?
Model answer
If the ciphertext number is c, then p≡aˉ(c−b)(mod26), where aˉ is the inverse of a modulo 26.
Explanation
Subtract b from the encryption equation, then multiply by the inverse of a.
- 91
For the affine cipher with a=7 and b=3, what does the letter K encrypt to?
Model answer
K is 10, and 7⋅10+3=73≡21(mod26), so it encrypts to V.
Explanation
The cipher is valid because gcd(7,26)=1.
- 92
How can English letter frequencies be used to attack a shift cipher?
Model answer
Count ciphertext letters, guess that the most frequent one represents common English letters such as E, infer the shift, and decrypt to see whether readable English results.
Explanation
A shift moves the frequency pattern without changing its shape; unsuccessful guesses can be tried against other common letters.
- 93
Why are shift and affine ciphers called monoalphabetic, and what weakness do they share?
Model answer
Each plaintext letter always maps to the same ciphertext letter. This preserves letter-frequency patterns, which can help an attacker recover the message.
Explanation
The same substitution is used throughout the message.
- 94
What is a block cipher, and why does merely rearranging letters in blocks not defeat frequency analysis?
Model answer
A block cipher acts on groups of letters together. A cipher that only rearranges letters leaves every single-letter frequency unchanged.
Explanation
The transposition cipher is an example: it changes positions but not the letters themselves.
- 95
What is a transposition cipher, and what role do its permutation and inverse play?
Model answer
It splits a message into blocks and rearranges positions using a permutation σ. Decryption uses σ−1 to undo the rearrangement.
Explanation
A permutation is a one-to-one mapping of the block positions onto themselves; short final blocks may be padded.
- 96
How does the four-position transposition key in the content move letters, and what ciphertext does it produce for “PIRATE ATTACK”?
Model answer
It sends positions 1,2,3,4 to 3,1,4,2, respectively. The blocks PIRA, TEAT, and TACK become IAPR, ETTA, and AKTC.
Explanation
Apply the position permutation independently to each four-letter block.
- 97
How is a message decrypted under the transposition key, and what does the example ciphertext “SWUE TRAE OEHS” decode to?
Model answer
Apply the inverse permutation to each block; the example decodes to “USE WATER HOSE.”
Explanation
The inverse restores the original positions, after which word boundaries can be inferred.
- 98
What are the five components of a cryptosystem, and what condition must encryption and decryption satisfy?
Model answer
They are the plaintext set P, ciphertext set C, keyspace K, encryption functions E, and decryption functions D. For each key k, decryption after encryption must recover the plaintext: Dk(Ek(p))=p.
Explanation
The matching functions must reverse each other so that a message is hidden but not lost.
- 99
How does the shift cipher fit the five-part cryptosystem framework, and why is its keyspace weak?
Model answer
Its plaintext and ciphertext are strings over Z26, its keyspace is Z26, encryption adds k, and decryption subtracts k, all modulo 26. It has only 26 keys.
Explanation
A small keyspace makes exhaustive search practical.
- 100
What distinguishes private-key cryptography from public-key cryptography?
Model answer
Private-key systems use a shared secret for encryption and decryption. Public-key systems publish the encryption key while keeping a separate decryption key secret.
Explanation
In public-key cryptography, someone can send an encrypted message without first sharing a secret with the receiver.
- 101
What information forms an RSA public key, and how are its modulus and exponent chosen?
Model answer
The public key is (n,e). Choose distinct large primes p,q, set n=pq, and choose e relatively prime to (p−1)(q−1).
Explanation
The relative-primality condition ensures that e has an inverse modulo (p−1)(q−1).
- 102
How are letters prepared and encrypted as RSA blocks?
Model answer
Encode each letter as a two-digit number, concatenate the numbers, divide them into blocks smaller than n, and encrypt each block with C=Memodn.
Explanation
The block size is chosen so that every message block remains below the modulus.
- 103
For the RSA public key (2537,13), how is “STOP” encoded into blocks, and what ciphertext blocks result?
Model answer
The letters become 18,19,14,15, giving blocks 1819 and 1415. Encryption gives 2081 and 2182.
Explanation
The four-digit blocks are below 2537, and each is raised to the 13th power modulo 2537.
- 104
How does RSA decryption work, and why does a decryption exponent exist?
Model answer
Choose d such that ed≡1(mod(p−1)(q−1)), then recover each block with M=Cdmodn. Such a d exists because e is relatively prime to (p−1)(q−1).
Explanation
The condition imposed when choosing e guarantees the inverse needed for decryption.
- 105
Why does RSA's security depend on the difficulty of factoring its modulus?
Model answer
Computing n=pq is easy, but recovering p and q from a sufficiently large n is not known to be feasible. Knowing those primes allows calculation of the decryption exponent.
Explanation
The content emphasizes that factoring is believed difficult in practice, not proved to be difficult.
- 106
In the RSA example with n=2537 and e=13, what private exponent decrypts the ciphertext blocks 0981,0461, and what message results?
Model answer
The private exponent is d=937. Decryption gives blocks 0704 and 1115, which spell “HELP.”
Explanation
Split the recovered digits into two-digit letter codes: 07=H, 04=E, 11=L, and 15=P.
- 107
What is a cryptographic protocol, and what is the goal of the Diffie–Hellman protocol?
Model answer
A protocol is a sequence of messages exchanged to achieve a goal. Diffie–Hellman lets two participants establish a shared secret key over a public channel.
Explanation
An eavesdropper may hear every exchanged message without learning the final key.
- 108
Describe how Alice and Bob produce the same Diffie–Hellman shared key.
Model answer
They publicly agree on a prime p and primitive root a. With private exponents k1,k2, they exchange ak1 and ak2 modulo p, then each computes ak1k2(modp).
Explanation
Alice raises Bob's value to k1 and Bob raises Alice's value to k2; both results are equal.
- 109
Why is it difficult for a Diffie–Hellman eavesdropper to compute the shared key from the public messages?
Model answer
The eavesdropper would need to recover a private exponent from a published power, which is the discrete logarithm problem.
Explanation
For large parameters, no efficient ordinary-computer method is known in the content.
- 110
What does a digital signature establish, and how is it distinct from encryption for secrecy?
Model answer
A digital signature provides evidence of who authored a message. Unlike encryption for secrecy, it does not aim to hide the message.
Explanation
Recipients can verify the claimed sender even though the message may be readable by others.
- 111
How does RSA signing work, and how does a recipient verify a signature?
Model answer
The sender applies the private RSA transformation to message blocks. A recipient applies the sender's public transformation, which recovers the original message if the signature is valid.
Explanation
Only the sender holds the private key, while anyone can use the public key to verify.
- 112
What weakness does raw RSA signing have, and what improvement is used in real systems?
Model answer
An attacker can choose any number as a signature and compute its public-key transformation to create a message that passes the raw check. Real systems sign a hash of the message instead.
Explanation
Signing a hash avoids relying on the insecure teaching version that signs message blocks directly.

Ask anything
We've read this whole study set, so questions about it get the best answers.