Discrete Mathematics (H) Lecture 10-11 Notes
Applications of Number Theory
Pseudorandom Number Generators
We will mainly introduce the linear congruential method. We choose four numbers:
- the modulus
- multiplier
- increment
- seed
Then we generate a sequence of numbers
Hash Functions
Definition: Hash Functions
A hash function is an algorithm that maps data of arbitrary length to data of fixed length. THe values returned by a hash functions are called hash values or hash codes.
The hash functions have very wide applications across different fields of programming. A classical example is given a large collection of records, how can we store and find a record quickly? Then we can use a hash function to calculate the location of the record based on the record’s ID.
Cryptography
The classic cryptography mainly studies the Symmetric cryptography, i.e. decryption and encryption use the same secret key to manipulate the message. This requires using a secure channel to transmit the key, and if the key is intercepted, the adversaries can easily decrypt the main message. A well-known example of symmetric cipher is the Caesar Cipher.
Kerchoff’s Principle
System should be secure even if algorithms are known, as long as key is secret.
Can we avoid using the common key? We can achieve this by using the public key cryptography. In this system, Alice first obtain Bob’s public key, then use this key to encrypt the message, then transmit encrypted message to Bob. Then Bob can use his secret key to decrypt the message. By using this approach, we greatly increase the security of the system. The most widely used public cryptosystem is the RSA Public Key Cryptosystem.
RSA Public Key Cryptosystem
Pick two large primes
Then we can do the encryption and decryption as the follows:
Theorem: Correctness of RSA Algorithm
Let
Example
For the following parameters:
The parameters
Tip
It is believed that determining
In practice, RSA keys are typically 1024 to 2048 bits long.
Question
Consider the RSA system, where
We can also use RSA for digital signature:
The Discrete Logarithm
The discrete logarithm of an integer
Then the discrete logarithm problem is: Given
El Gamal Encryption
- Setup: Let
be a prime, and be a generator of . The private key is an integer with . Let . THe public key for El Gamal encryption is . - Encryption: Pick a random integer
from , The ciphertext consists of the pair . - Decryption:
We can also use El Gamal encryption for digital signature:
Example
Choose
- Public key:
- Private key:
Encryption: Let
- Title: Discrete Mathematics (H) Lecture 10-11 Notes
- Author: Zhige Chen
- Created at : 2025-11-03 21:41:50
- Updated at : 2025-12-08 21:45:42
- Link: https://nofe1248.github.io/2025/11/03/discrete-math-lec-10/
- License: This work is licensed under CC BY-NC-SA 4.0.