Public Announcement of Public Keys
Public Announcement of Public Keys
Several techniques have been proposed for the distribution of public keys.
Virtually all these proposals can be grouped into the following general schemes:
• Public announcement
• Public-key authority
• Public-key certificates
Thus, a total of seven messages are required. However, the initial four mes-
sages need be used only infrequently because both A and B can save the other’s
public key for future use—a technique known as caching. Periodically, a user
should request fresh copies of the public keys of its correspondents to ensure
currency.
Public-Key Certificates
The certificate can be shared with anyone, who can then verify its authenticity
using the CA’s public key. Certificates also include timestamps to ensure they
are current and to prevent misuse if someone’s private key is stolen. This
timestamp works like an expiration date, making old certificates invalid. The
X.509 standard is widely used to format certificates and is essential in securing
online communication, such as in HTTPS, email encryption, and VPNs.
where PRauth is the private key used by the authority and T is a timestamp. A
may then pass this certificate on to any other participant, who reads and verifies
the certificate as follows:
The recipient uses the authority’s public key, PUauth, to decrypt the certifi- cate.
Because the certificate is readable only using the authority’s public key, this
verifies that the certificate came from the certificate authority. The elements IDA
and PUa provide the recipient with the name and public key of the certificate’s
holder. The timestamp T validates the currency of the certificate. The timestamp
counters the following scenario. A’s private key is learned by an adversary. A
gen- erates a new private/public key pair and applies to the certificate authority
for a new certificate. Meanwhile, the adversary replays the old certificate to B.
If B then encrypts messages using the compromised old public key, the
adversary can read those messages.
One scheme has become universally accepted for formatting public-key cer-
tificates: the X.509 standard. X.509 certificates are used in most network
security applications, including IP security, transport layer security (TLS), and
S/MIME, all of which are discussed in Part Five. X.509 is examined in detail in
the next section.
information. These are primarily used for handling the security and identity
users can easily access them. Each certificate includes the user's public
messages.
Once a certificate is issued, it acts like an ID that the user can present
certificate is unique and securely issued, it’s much safer than using
identity verification.
certificate.
issues.
valid.
● Subject Name: Tells about the name of the user to whom this
key along with an identifier of the algorithm for which this key is
supposed to be used.
information.
● Signature: This field contains the hash code of all other fields
What is PGP?
Pretty Good Privacy (PGP) is an encryption software program software
cryptography uses a single secret key for both encryption and decryption,
openly for encryption, and a private key, kept secret for decryption. This
1. Authentication
2. Confidentiality
3. Email Compatibility
4. Segmentation
Note:
Authentication in PGP
Authentication basically means something that is used to validate
something as true or real. To login into some sites sometimes we give our
procedure.
authentication has to be checked as there are some people who spoof the
Authentication in PGP
As shown in the above figure, the Hash Function (H) calculates the Hash
Value of the message. For the hashing purpose, SHA-1 is used and it
produces a 160 bit output hash value. Then, using the sender’s private key
then appended to the signature. All the process happened till now, is
receiver.
At the receiver’s end, the data is decompressed and the message,
signature are obtained. The signature is then decrypted using the sender’s
public key(PUa) and the hash value is obtained. The message is again
passed to hash function and it’s hash value is calculated and obtained.
Both the values, one from signature and another from the recent output of
hash function are compared and if both are same, it means that the email
is actually sent from a known one and is legit, else it means that it’s not a
legit one.
2. Confidentiality in PGP
Sometimes we see some packages labelled as ‘Confidential’, which means
that those packages are not meant for all the people and only selected
persons can see them. The same applies to the email confidentiality as
well. Here, in the email service, only the sender and the receiver should be
able to read the message, that means the contents have to be kept secret
Confidentiality in PGP
Then, the session key (Ks) itself gets encrypted through public key
As you can see, the original message was compressed and then encrypted
initially and hence even if any one could get hold of the traffic, he cannot
read the contents as they are not in readable form and they can only read
them if they had the session key (Ks). Even though session key is
form and only the receiver’s private key (KPb)can be used to decrypt that
At the receiver’s end, the encrypted key is decrypted using KPb and the
message is decrypted with the obtained session key. Then, the message is
RSA algorithm is used for the public-key encryption and for the symmetric
By default, PGP compresses the message after adding the signature but before encrypting it. This saves space
for email transmission and file storage. The compression algorithm used is ZIP.
1. It allows storing the uncompressed message with the signature for later verification.
2. Adding the hash and signature after compression would force all PGP versions to use the
same compression algorithm, which is not ideal since PGP compression is not deterministic.
● Encryption is applied after compression to improve security. Compressed messages have less
redundancy than the original text, making it harder for attackers to analyze.
PGP makes encrypted data work with email systems that only support text. It converts the encrypted data into
readable text using radix-64 conversion, which changes 3 bytes of data into 4 text characters and adds
error-checking (CRC). This increases the size slightly, but compression still saves space overall.
If a message is too large for email (e.g., over 50,000 bytes), PGP splits it into smaller parts after processing. The
session key and signature are included only in the first part. At the receiving end, PGP joins the parts back
single message.
encryption.
3. Each user must keep two key files: one for their public/private key
A session key is created for each message and used only for that message.
To generate it, random numbers are produced using the ANSI X12.17
In PGP, a user can have multiple public/private key pairs. When encrypting
or signing a message, the user needs to let the recipient know which key
was used. Instead of attaching the full public key (which is inefficient),
● For example, the key ID for a public key PUa is PUa mod 2^ 64.
verify the correct public key was used to decrypt the digest
In PGP, keys and key IDs are essential for secure communication. To manage these
efficiently, PGP uses two types of key rings:
These key rings help organize and store keys systematically, making it easier for users to
encrypt, decrypt, and verify messages securely.
The Private-Key Ring is like a table where each row represents one public/private key pair
owned by the user. Each row includes the following details:
● Timestamp: The date and time when the key pair was created.
● Key ID: The least significant 64 bits of the public key.
● Public Key: The public key from the pair.
● Private Key: The private key, stored in an encrypted form for security.
● User ID: Usually the user's email address (e.g., [email protected]), but users can
assign different names (e.g., Stallings or WilliamStallings) or reuse the same User ID
for multiple key pairs.
The private-key ring is stored on the user's device and is accessible only to them. To make
the private key secure, it is not stored directly but is encrypted using CAST-128 (or
sometimes IDEA or 3DES). The process is:
This data structure is used to store public keys of other users that are known to this user.
Key ID: The least significant 64 bits of the public key for this entry
User ID: Identifies the owner of this key. Multiple user IDs may be associated with a single
public key
Signature Trust Field A key ring owner collects all the signatures that are related to the
entries. Each signature has its own signature-trust-field that specifies the level of PGP user’s
trust towards the signer.
PGP Message Transmission – Sending Steps
RADIX-64 in PGP
Many electronic mail systems can only transmit blocks of ASCII text. This can cause a
problem when sending encrypted data since ciphertext blocks might not correspond to ASCII
characters which can be transmitted. PGP overcomes this problem by using radix-64
conversion.
The problem after encryption: • the three bytes do not represent any key board ASCII
characters. • Most email systems cannot transmit and process such a piece of ciphertext
Radix-64 Conversion
Suppose the text to be encrypted has been converted into binary using ASCII coding and
encrypted to give a ciphertext stream of binary. Radix-64 conversion maps arbitrary binary
into printable characters as follows:
SSL (Secure Sockets Layer) is a security method used to protect web-based applications. It
works over TCP (Transmission Control Protocol) to ensure a reliable, secure connection
between two parties. SSL is not just one protocol but a set of protocols that work together.
● SSL Record Protocol: This is the foundation layer of SSL and works directly with
TCP. It provides basic security features for higher-level protocols, like HTTP.
● Higher-Level Protocols: Several protocols use the SSL Record Protocol to ensure
secure communication:
1. Handshake Protocol: Helps establish a secure connection.
2. Change Cipher Spec Protocol: Changes the encryption keys for a session.
3. Alert Protocol: Sends alerts about any errors or issues in the
communication.
In short, SSL layers help ensure secure and reliable communication on the web.
● Fragmentation: The application message is split into smaller blocks (each no bigger
than 16,384 bytes).
● Compression: The blocks are compressed, but the size increase must be small (less
than 1,024 bytes).
● MAC Calculation: A MAC is created over the compressed data using a shared secret
key, ensuring integrity. This MAC is added to the block.
● Encryption: The compressed data and MAC are then encrypted with symmetric
encryption, and the encrypted content must stay within a certain size limit (it can't
grow by more than 1,024 bytes).
● Header: A header is added with the following information:
○ Content Type (indicates which higher-level protocol is used, like HTTP,
Handshake, etc.)
○ Major and Minor Version (indicate which version of SSL is being used)
○ Compressed Length (indicates the size of the compressed data).
This consists of a single message which consists of a single byte with the value 1. This is
used to cause the pending state to be copied into the current state which updates the cipher
suite to be used on this connection.
The Alert Protocol in SSL is used to send important messages about problems or issues
during the connection. It has two parts: the first part tells if the alert is a warning
(non-critical) or fatal (serious, leading to immediate disconnection), and the second part
provides a code that explains the specific problem, like an invalid certificate or decryption
failure. This helps SSL manage and handle errors to keep the connection secure.
11.5 Handshake Protocol
This is the most complex part of SSL and allows the server and client to authenticate each
other and to negotiate an encryption and MAC algorithm and cryptographic keys to be used
to protect data sent in an SSL record. This protocol is used before any application data is
sent. It consists of a series of messages exchanged by the client and server, all of which
have the format shown in figure 11.5. Each message has three fields:
. Type (1 byte): Indicates one of 10 messages such as “hello request” (see figure 11.4).
2. Length (3 bytes): The length of the message in bytes.
3. Content(≥ 0 byte): The parameters associated with this message such version of SSL
being used.
The Handshake Protocol is shown in figure 11.6. This consists of four phases:
Establish security capabilities,
2. In this step, the server sends its certificate (proving its identity), and if needed, a key
exchange message to set up encryption. It may also ask the client for its certificate,
especially if both sides need to authenticate each other. Once this is done, the server signals
the end of the "Hello" phase, preparing for the next steps in the handshake.
3.When the client receives the server's "done" message, it checks if the server's certificate is
valid and if the server's settings (like the SSL version and encryption methods) are
acceptable. If everything looks good, the client proceeds by sending a few messages back to
the server: if requested, it sends its certificate (or a "no certificate" alert if it doesn't have
one), followed by a key exchange message to set up the shared encryption key. The client
may also send a certificate verification message to confirm the authenticity of its certificate.
4. Once the client has sent all necessary messages, the next step is to change the cipher
suite and finalize the handshake process. This involves both the client and server agreeing
on the encryption methods and keys to use. After the cipher suite change, the secure
connection is fully established, and they can begin securely exchanging the actual data from
the application layer, like web pages or files.
Transport Layer Security (TLS) is a protocol that ensures secure communication between
two applications over a network. Developed by the Internet Engineering Task Force (IETF),
TLS provides authentication, privacy, and data integrity, making it crucial for secure data
exchanges. It's widely used in web browsers for secure browsing (HTTPS), file transfers,
VPNs, remote desktop connections, and VoIP. Additionally, TLS is being adopted in newer
technologies like 5G to secure network functions, ensuring safety across communication
channels in modern cellular networks.
There are a few drawbacks when it comes to either not using secure
authentication or any encryption -- or when deciding between TLS and
other security protocols, such as IPsec. Here are a few examples: