0% found this document useful (0 votes)
7 views10 pages

Ubuntu D

The document describes several cryptographic algorithms: RSA for encryption/decryption using public/private key pairs, DSS/ElGamal for digital signatures using secret keys, and Diffie-Hellman key exchange to securely establish a shared secret between two parties.

Uploaded by

Manav Israni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views10 pages

Ubuntu D

The document describes several cryptographic algorithms: RSA for encryption/decryption using public/private key pairs, DSS/ElGamal for digital signatures using secret keys, and Diffie-Hellman key exchange to securely establish a shared secret between two parties.

Uploaded by

Manav Israni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

RSA:

● Key Generation:

● p, q: Two large, secret prime numbers (your private key).
● n: n = p * q (publicly known modulus, like the size of your lock).
● φ(n): Euler's totient function, calculated from p and q (not directly used for
encryption/decryption).
● e: Public exponent (a number that works well with p and q, often 65537).
● d: Private exponent, calculated mathematically from e and φ(n) using the Extended
Euclidean Algorithm (your secret key for unlocking).
● Encryption:

● M: Plaintext message to be encrypted (broken into blocks for RSA).
● C: Ciphertext (the scrambled message using the public key). Formula: C = M^e mod
n (e and n are public).
● Decryption:

● C: Ciphertext received from someone (the scrambled message).
● M: Decrypted message (recovered using your private key). Formula: M = C^d mod n
(d is your private key).
DSS W ELGAMAL
● Key Generation:

● p: Large prime number (public).
● g: Generator of a subgroup modulo p (public).
● x: Private key (random integer less than p-1, kept secret).
● y = g^x mod p: Public key (computed from private key).
● Signing:

● M: Message to be signed (hashed using a secure hash function like SHA-256).
● H(M): Hash value of the message (internal use).
● k: Random integer less than p-1 (kept secret by signer).
● r = g^k mod p: Random part of the signature (public).
● s = k^-1 * (H(M) + xy) mod (p-1): Signature component (computed using private key
and message hash, sent publicly).
● Verification:

● (M, r, s): Signature received (public).
● H(M): Hash value of the message (recomputed for verification).
● w = s^-1 mod (p-1): Verification parameter.
● v = (y^r * g^H(M) * w) mod p: Verification value (computed using public key, message
hash, and signature component). Valid signature: v == r (verification value matches
random part of the signature).

Diffie Hellman:
● Key Exchange (without MitM):

● Alice:
● Chooses a random private key a (secret).
● Computes her public key A = g^a mod p (sends to Bob).
● Bob:
● Chooses a random private key b (secret).
● Computes his public key B = g^b mod p (sends to Alice).
● Shared Secret:
● Alice computes S = B^a mod p (using Bob's public key).
● Bob computes S = A^b mod p (using Alice's public key).
● Both Alice and Bob end up with the same shared secret S, which can be used for
secure communication.
● Man-in-the-Middle Attack:

● Mallory intercepts communication: Mallory intercepts messages between Alice and
Bob.
● Mallory impersonates Alice to Bob:
● Mallory creates her own private key x (secret).
● Sends her public key X = g^x mod p to Bob pretending to be Alice.
● Mallory impersonates Bob to Alice:
● Mallory sends her own public key X = g^x mod p to Alice pretending to be Bob.
● Shared Secrets (compromised):
● Alice computes a secret key S = X^a mod p (thinking it's Bob's key).
● Bob computes a secret key S = X^b mod p (thinking it's Alice's key).
● Mallory now shares a secret key S with both Alice and Bob, allowing her to potentially
decrypt their communication.

You might also like