CS311 CryptographyReport VicheaphalkunRay
CS311 CryptographyReport VicheaphalkunRay
CS311 CryptographyReport VicheaphalkunRay
Date: 25.01.2023
Number Theory and Cryptography Report Vichea Phalkun Ray - Section 1
Table of Contents
Table of Contents 2
I. Capture screenshots of the weekly activities 2
II. Certificate (Optional) 4
III. Key Takeaway 4
What I have learned: 4
1. Cryptography Definition 4
2. Encryption algorithms 5
3. Symmetric and asymmetric cryptography 5
My challenges while completing this course: 7
Last lesson:
1. Cryptography Definition
Cryptography is the science of encrypting and decrypting information to prevent
unauthorized access to the information being transmitted across the internet. The decryption
process should be known to both the sender and the receiver.
❖ Important Keywords
a. Encryption is the process of making normal readable text difficult to
understand. It may include the process of maxing, adding or changing data to
make it more complex and impossible to read.
b. Decryption is the process of reversing the encrypted text to the normal
message.
c. Ciphertext is the text that is generated from the encryption process.
2. Encryption algorithms
An encryption algorithm is the method used to transform data into ciphertext. An
algorithm will use the encryption key in order to alter the data in a predictable way, so that
even though the encrypted data will appear random, it can be turned back into plaintext by
using the decryption key.
❖ Symmetric encryption
To easily understand the concept of symmetric encryption, I use a scenario of Alice
and Bob sending information to each other across the internet.
Alice wants to send a secret message to Bob. She uses an encryption protocol to protect her
document with a password or secret key. Bob uses the secret key that Alice told him the last
time they met. Thus, only Alice and Bob can open and read the secret message.
Symmetric encryption is the encryption method where a single secret key is shared
among the related parties, and this key must be kept secret because if anyone knows the key,
they can decrypt the message.
❖ Asymmetric encryption
Asymmetric encryption, on the other hand, uses 2 (or more) keys that are
mathematically related to each other to encrypt and decrypt the messages.
Let’s get back to the example of Bob and Alice. When using asymmetric encryption,
both Alice and Bob have to generate a keypair on their computers using the RSA (or other)
algorithm. The algorithm will generate a public and private key that are mathematically
linked. Public key is shared publicly for data encryption whereas private key is kept in secret
for decrypting data. Thus, Alice and Bob can share their public key to each other so that
when Alice uses Bob’s public key to encrypt data, Bob can use his private key to decrypt.
Bob can also do the same way if he wants to send a secret message to Alice.
4. Hashing
Hashing is the process of putting a plain text into a formula to produce a fixed-size
output. If you copy a file and therefore have two files containing the same data, and if you
hash them with the same hashing algorithm, it will always produce the same hash value. The
main purpose of hashing data is to maintain data integrity. In this course we have learned
about 2 algorithms of data hashing which are MD5 and SHA.
The RSA algorithm was created in 1977 by Ron Rivest, Adi Shamir, Leonard
Adleman. It creates a pair of mathematical related keys, one is to encrypt and the other is for
decryption.
❖ Key Generation Process
1. Two large prime numbers are chosen (p and q)
2. Computer n, the produce of p and q (n = p * q) and the value of the coprime
number of n, which is z. We can calculate the coprime value of n with the
formula of z = (p-1)(q-1)
3. Choose a number e where 1< e < z
4. Choose another number d such that (d * e) mod z == 1
Then we can get e and d which will eventually be used as a public key (n, e) and a
private key (n, d).
❖ Encryption and Decryption
For the encryption process, we use the public key (n, e) to encrypt the message. In a simple
word, the ciphertext is the remainder of (message)^e when divided by n.
For the decryption process, we can decrypt the message back using the private key.