Unit 5
Unit 5
In simple terms, a user who wants to receive emails but does not have a permanent
connection to the internet uses a POP client to pull emails from the POP server.
In simple terms, a user who wants to receive emails but does not have a permanent
connection to the internet uses a POP client to pull emails from the POP server.
Requirement of POP
• We know that emails are stored on a centralised e-mail server, the SMTP server. The
SMTP server expects the destination host (i.e., the email recipient) to be online all
the time. Without this, it cannot create a TCP connection with it and, therefore,
cannot forward the email message to the destination host.
• As we know, desktop computers are usually powered down when the business hours
are over. Therefore, the solution to this problem is having a POP server, whereas the
SMTP server in an organization receives and stores all the incoming emails for any
user in that organization. It is not used for transporting the emails to the end
destination.
The POP server consults the user’s mailbox to perform this task shown in the figure
below −
Internet Message Access Protocol (IMAP)
• The Internet Message Access Protocol (IMAP) is an important part of how email works today. It lets
people check and manage their emails from different devices, like phones, tablets, and computers,
without losing any updates.
• Unlike the older Post Office Protocol (POP), which only downloads messages to one device, IMAP
keeps everything in sync across all devices. This means if you read, delete, or move an email on one
device, the changes show up everywhere. IMAP helps make email more organized, up-to-date, and
easy to use no matter where you are accessing the data.
• It is used as the most commonly used protocol for retrieving emails. This term is also known as
Internet mail access protocol, Interactive mail access protocol, and Interim mail access protocol.
• It retrieves messages from your email provider to your email client (such as on your Mac or PC).
Importantly, it does not delete messages from the email service after you download them until the
user explicitly deletes them.
• It allows you to view and manage your emails across multiple devices because it synchronizes the
emails between your email client and the server. This synchronization ensures that changes such
as read status, deletions, and folder organization are reflected consistently across all devices
connected to the same email account.
Features of IMAP
Plaintext and Ciphertext : The original message, before being transformed, is called plaintext. After
the message is transformed, it is called ciphertext. An encryption algorithm transforms the plaintext
into ciphertext; a decryption algorithm transforms the ciphertext back into plaintext. The sender uses
an encryption algorithm, and the receiver uses a decryption algorithm.
Cipher: We refer to encryption and decryption algorithms as ciphers. The term cipher is also used to
refer to different categories of algorithms in cryptography.
Key: A key is a number (or a set of numbers) that the cipher, as an algorithm, operates on. To encrypt
a message, we need an encryption algorithm, an encryption key, and plaintext. These create the
ciphertext. To decrypt a message, we need a decryption algorithm, a decryption key, and the
ciphertext. These reveal the original plaintext.
There are two types of cryptography which are as follows
In Asymmetric Key Cryptography , a pair of keys is used to encrypt and decrypt information. A sender’s public
key is used for encryption and a receiver’s private key is used for decryption. Public keys and Private keys are
different. Even if the public key is known by everyone the intended receiver can only decode it because he
holds his private key. The most popular asymmetric key cryptography algorithm is the RSA algorithm.
.
RSA
RSA (Rivest-Shamir-Adleman) is a famous encryption scheme that makes use of a
combination of public and private keys. This means you have a non-public key and one that
can be shared publicly. Each key can be used to encrypt data, but only the opposite can be
decrypted. RSA was evolved in 1977 via MIT researchers Ron Rivest, Adi Shamir and Leonard
Adleman, whose name bears the set of ruless call.
Working of RSA :
• RSA is based on the problem of breaking down large numbers into their top factors. To
create an RSA key pair, you need to pick very big prime numbers, p and q. It is crucial to
pick those primes randomly and ensure they are simply unique from each different. The
product of p and q, represented as n, becomes the modulus for the public and private
keys. While n is publicly known, the values of p and q remain confidential.
• The carmecheals' totient function of the product of two primes, p and q, is computed. An
integer, e, is chosen as the public exponent. The final step involves calculating d, which
serves as the private exponent.
Example
Let's say we choose p = 61 and q = 53.
n = p * q = 61 * 53 = 3233
(n) = (p-1)(q-1) = 60 * 52 = 3120
Let's choose e = 17 (a common choice).
d = 2753 (computed such that (17 * d) mod 3120 = 1)
So, the public key is (3233, 17), and the private key is (3233, 2753).
Encryption: To encrypt a message, the sender Uses the public key (n, e) provided by the
recipient. Converts the plaintext message (m) into a ciphertext (c) using the formula −
c = m^e mod n.
Suppose we want to encrypt the message "HELLO". We convert it to ASCII: H(72) E(69) L(76)
L(76) O(79).
We will encrypt each ASCII value separately −
•H: C = 72^17 mod 3233 = 2103
•E: C = 69^17 mod 3233 = 2464
•L: C = 76^17 mod 3233 = 2190
•L: C = 76^17 mod 3233 = 2190
•O: C = 79^17 mod 3233 = 875
Decryption: Once the ciphertext (c) is received, the recipient uses their private key (n, d) to
decrypt the message. Computes the plaintext message (m) using the formula −
m = c^d mod n.
The recipient receives the ciphertext (2103, 2464, 2190, 2190, 875).
They use their private key to decrypt each value −
•M = 2103^2753 mod 3233 = 72 (H)
•M = 2464^2753 mod 3233 = 69 (E)
•M = 2190^2753 mod 3233 = 76 (L)
•M = 2190^2753 mod 3233 = 76 (L)
•M = 875^2753 mod 3233 = 79 (O)
So, the decrypted message is "HELLO".