Wednesday, April 29, 2009

Information Security FAQS with Solutions for JNTU BTech

Explain about the TCP Session Hijacking.
TCP session hijacking" is a technique that involves intercepting a TCP session initiated between two machines in order to hijack it.
In that the authentication check is performed only when opening the session, a pirate who successfully launches this attack is able to take control of the connection throughout the duration of the session











TCP attacks
Although it is hard to do IP spoofing on TCP, it is still can be realized on the specific OS. The attack aims at impersonating another host mostly during the TCP connection establishment phase.
For example:

1) Node A trusts node B (e.g. login with no password)

2) Node C wants to impersonate B with respect to A in opening a TCP connection

3) C kills B (flooding, redirecting or crashing) firstly

4) C sends A an TCP segment in a spoofed IP packet with B‘s address as the source IP and 11000 as the sequence number.

5) A replies with a TCP SYN/ACK segment to B with 54002 as the sequence number

6) C does not receive the segment from A to B, but in order to finish the handshake it has to send an ACK segment with 54002+1 as the acknowledge number to A. C has to guess or predicate the value of 54002.
TCP Spoofing
3. Explain the RSA algorithm in detail.
The RSA algorithm involves three steps: key generation, encryption and decryption.
Key generation
RSA involves a public key and a private key. The public key can be known to everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. The keys for the RSA algorithm are generated the following way:
Choose two distinct prime numbers p and q
Compute n = pq
n is used as the modulus for both the public and private keys
Compute the totient: .
Choose an integer e such that , and e and share no factors other than 1 (i.e. e and are coprime)
e is released as the public key exponent
Determine d (using modular arithmetic) which satisfies the congruence relation ;
Stated differently, ed − 1 can be evenly divided by the totient (p − 1)(q − 1)
This is often computed using the Extended Euclidean Algorithm
d is kept as the private key exponent
Notes on the above steps:
Step 1: For security purposes, the integers p and q should be chosen uniformly at random and should be of similar bit-length. Prime integers can be efficiently found using a Primality test.
Step 3: PKCS#1 v2.0 and PKCS#1 v2.1 specifies using , where lcm is the least common multiple instead of .
Step 4: Choosing e with a small hamming weight results in more efficient encryption. Small public exponents (such as e=3) could potentially lead to greater security risks.[2]
The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the modulus n and the private (or decryption) exponent d which must be kept secret.
For efficiency the following values may be precomputed and stored as part of the private key:
p and q: the primes from the key generation,
and ,
.
Encryption
Alice transmits her public key (n,e) to Bob and keeps the private key secret. Bob then wishes to send message M to Alice.
He first turns M into an integer 0 < title="" href="http://en.wikipedia.org/wiki/RSA#Padding_schemes#Padding_schemes">padding scheme. He then computes the ciphertext c corresponding to:
This can be done quickly using the method of exponentiation by squaring. Bob then transmits c to Alice.
Decryption
Alice can recover m from c by using her private key exponent d by the following computation:
Given m, she can recover the original message M by reversing the padding scheme.
The above decryption procedure works because:
.
Now, since ,
.
The last congruence directly follows from Euler's theorem when m is relatively prime to n. By using the Chinese remainder theorem it can be shown that the equations hold for all m.
This shows that we get the original message back:
A working example
Here is an example of RSA encryption and decryption. The parameters used here are artificially small, but one can also use OpenSSL to generate and examine a real keypair.
Choose two prime numbers
p = 61 and q = 53
Compute n = pq
Compute the totient
Choose e > 1 coprime to 3120
e = 17
Compute d such that e.g., by computing the modular multiplicative inverse of e modulo :
d = 2753
since 17 · 2753 = 46801 = 1 + 15 · 3120.
The public key is (n = 3233, e = 17). For a padded message m the encryption function is:
The private key is (n = 3233, d = 2753). The decryption function is:
For example, to encrypt m = 123, we calculate
To decrypt c = 855, we calculate
.
Both of these calculations can be computed efficiently using the square-and-multiply algorithm for modular exponentiation. In real life situations the primes selected would be much larger, however in our example it would be relatively trivial to factor n, 3233, obtained from the freely available public key back to the primes p and q. Given e, also from the public key, we could then compute d and so acquire the private key.

No comments:

Post a Comment