Tuesday 24 April 2018

Network Security

Some important parameters that network security needs to take care of:-

1. Confidentiality: Ram would like to ensure that no one else except Sita receives the envelope and even if some one receives it, he/she does not come to know about the details inside the envelope.

2. Integrity: Ram and Sita would further like to make sure that no one tampered with the contents.

3. Authentication: Sita would like to be assured that the message came from Ram and not from some else pretending to be Ram.

4. Non-Repudiation: Ram sends a BANK-CHECK to Sita. Sita withdraws the money. Ram now denies that he has not given any CHECKS to Sita. Now Sita should have signature of Ram to proof in court of her correctness.

Apart from these 4 basic requirements of Network Security other features are added up like ACCESS CONTROL, AVAILABILITY etc.

 Few important points to remember:-

1. "INTERCEPTION" causes loss of message confidentiality.

2. "FABRICATION" can occur in the absence of proper authentication mechanism.

3. "MODIFICATION" causes loss of integrity.

4. "INTERRUPTION" directly hampers the availability constraint.

Now there are 2 types of attacks possible:-

1. Active attack: Here modification to the contents of the original message occurs. Eg. DOS (Denial of service), Masquerade attack, Replay attack, IP spoofing etc.

2. Passive attack: Here no modification to the contents of the original message occurs. Eg. Packet Sniffing etc.
Packet sniffing means keeping a copy of the sent message over the channel.

Now we will move on to cryptography.

1. Symmetric Key Cryptography (Private key cryptography):
Uses same key for both Encryption and Decryption.
If 'A' wants to send a message to 'B' and another message to 'C' then 'A' must use 2 different keys, i.e. one for 'B' and another for 'C'.
Eg. DES (Data Encryption Standard) 

2. Asymmetric Key Cryptography (Public key cryptography):
Uses one key for encryption and another key for decryption.

Imp Note:
Here public key is used to encrypt plain-text and private key is used to decrypt cipher-text.
But in case of digital signatures private key is used to sign the document and public key is used to verify the signature. (We would be shortly discussing about digital signatures).

Eg. RSA algorithm

Note: Symmetric key cryptography is faster than Asymmetric key cryptography.

DIGITAL SIGNATURES:
If 'A' is the sender of a message and 'B' is the receiver, then 'A' signs the message with it's own private key and 'B' verifies it using A's public key.

NOTE:
It does not guarantee Confidentiality.
It provides message integrity and authentication.

Friday 6 April 2018

Decidability Theory With Examples

The most confusing yet interesting topic is presented here by me. The simple way to solve any decidability question is by logical intuition or analogy. I am going to help you build that in this post. Specials thanks to Arjun Suresh sir for the practice problems (Links to practice problems are provided at the end of the post).

Things to know before we start:

Recursive Language (Decidable) - Both 'yes' and 'no'

Recursively Enumerable Language (Semi-decidable) - Only 'yes'

Not Recursively Enumerable Language (Un-decidable) - No 'yes'

--------------------------------------------------------------------------------------------------------------------------

Shortly i will explain what do we mean by 'yes' and 'no'.

Let's start solving few simple problems first.

Q1) Language(L) = { M is a turing machine that accepts strings of length exactly two }

Soln) Now take any string, say "abcd". Here string length is 4. Now let's start scanning the string from 1st character to the last character.

After scanning first character 'a' of the string "abcd", the Turing machine will conceive that string length is 1. But can it say a 'yes' for the given statement ? i.e. yes this string "abcd" will be accepted by the turing machine that accepts string of length 2 only. Unfortunately the turing machine can't say a 'yes' because the string length is currently 1 but in future there is a possibility that another character might add up enhancing the length of the string to 2.

Now let's scan the second character 'b' of the string "abcd", the Turing machine will conceive that string length is 2. But can it say a 'yes' for the given statement ? i.e. yes this string "abcd" will be accepted by the turing machine that accepts string of length 2 only. Here you might think that as the length of the string at this point is 2 which is also conceived by the Turing machine, so the Turing machine will accept the string. But what if another character comes in future ? It will definitely make the string length 3 which will not be accepted by the given Turing Machine. So here also, the turing machine can't say a 'yes'.

Now after scanning the third character, i.e. 'c' of the string "abcd", the Turing machine will conceive that string length is 3. So you can easily say a 'no' now, i.e. no the given turing machine will not accept the string. Here we can stop our turing machine.

But our problem was to stop the turing machine at a 'yes', i.e. yes the turing machine stops for the given string, but unfortunately we couldn't do that during our scan.

Whenever you can't find a 'yes' to a given problem or statement then as defined earlier, it would be not- recursively enumerable language and hence un-decidable.

--------------------------------------------------------------------------------------------------------------------------

Q2) Language(L) = { M is a turing machine that accepts strings of length greater than equal to two }

soln) Now let's take the same string, "abcd". Here string length is 4. Now let's start scanning the string from 1st character to the last character.

After scanning first character 'a' of the string "abcd", the Turing machine will conceive that string length is 1. But can it say a 'yes' for the given statement ? i.e. yes this string "abcd" will be accepted by the turing machine that accepts string of length greater than equal to 2. Unfortunately the turing machine can't say a 'yes' because the string length is currently 1 but in future there is a possibility that another character might add up enhancing the length of the string.

Now let's scan the second character 'b' of the string "abcd", now the turing machine will conceive that string length is 2. Here the turing machine can say a 'yes', i.e. yes the string will be accepted by the given turing machine. This is because how many characters you add up after this it will always be greater than 2 and hence our turing machine should accept it as per given criterion. So, one can stop the turing machine here.

Whenever you find a 'yes' then check for 'no'. Let's take a simple string "g". Here string length is 1. After scanning the first character 'g' of the string "g", the turing machine will conceive that string length is 1.  Can it say a 'no' ? Unfortunately the turing machine can't say a 'no' because in future another character might be there which would add up to make the length of the conceived string 2 and hence accepted by the turing machine. 

Whenever you find a 'yes' to a given problem or statement and can't find a 'no' for the same problem then as defined earlier, it would be recursively enumerable language and hence semi-decidable.

--------------------------------------------------------------------------------------------------------------------------

Q3) Language(L) = { M is a turing machine and M halts on string X within 2 steps }

soln) Let string X be "ab". We say M halts on string X whenever M reaches the end of the string.
Clearly just after 2 steps we can easily say that 'yes' the string halts on M within 2 steps.

Now we have our 'yes'. We will now search for 'no'.

Let string X be "abcd". Here after 2 steps only character 'a' and 'b' would have been parsed but not character 'c' and 'd'. So we are still in the middle of the string without reaching the end. So here the Turing machine M can easily reject the string "abcd", i.e. it can say a 'no'.

Whenever you find a 'yes' to a given problem or statement and also a 'no' for the same problem then as defined earlier, it would be recursively language and hence Decidable.

--------------------------------------------------------------------------------------------------------------------------

Additional Tips:
1. In some books semi-decidable and undecidable terms are treated equally. So see what question asks and the answer.

2. Try to go through the above 3 examples 3-4 times so that you get the intuition behind it. Once you get the logic right, practice additional problems given below using this logic.

3. In some problems you might fail to put your logic because of complexity in understanding of the statements, but there are only a few of them, you can easily memorise them.

4. Don't leave this easy topic, just spend 3 hours in this topic. You will be master at it then.

--------------------------------------------------------------------------------------------------------------------------

Problems to practice from:

http://www.cs.rice.edu/~nakhleh/COMP481/final_review_sp06_sol.pdf

https://gatecse.in/rices-theorem/

--------------------------------------------------------------------------------------------------------------------------

Incase of doubt,post a comment here. I will try to reply asap!!!

Tuesday 3 April 2018

An all time inspiring story

The Japanese have always loved fresh fish. But the water close to Japan has not held many fish for decades. So to feed the Japanese population, fishing boats got bigger and went farther than ever. The further the fishermen went, the longer it took to bring the fish. If the return trip took more time, the fish  were not fresh. To solve this problem, fish  companies installed freezers on their boats. They would catch the fish  and freeze them at sea. Freezers allowed the boats to go farther and stay longer. However, the Japanese could taste the difference between fresh and frozen fish and they did not like the taste of frozen fish
The frozen fish brought a lower price. So, fishing companies installed fish tanks. They would catch the fish  and stuff them in the tanks, fin to fin. After a little thrashing around, they were tired, dull, and lost their fresh-fish taste. The fishing industry faced an impending crisis! But today, they get fresh-tasting fish to Japan. How did they manage…?
To keep the fish tasting fresh, the Japanese fishing companies still put the fish in the tanks but with a small shark. The fish are challenged and hence are constantly on the move. The challenge they face keeps them alive and fresh!
Moral: 
"You need to make a shark for your life"
In my case, i didn't sit in any of the placements. So i was unplaced. It constantly pushed me towards gate. The shark is basically a calculated risk that you take. 

Review on Ravindra Sir's Videos

First of all i am not that qualified to rate Ravindra Sir's videos. I am just giving my personal review on those videos as many future aspirants were continuously asking about it.

Why Ravindra Sir's videos ?

The videos are not just made by Ravindra Sir alone as you think of, watching those videos. Each single video script or content is made by a team of iitians and iiscians. So when you are watching a single video, you are actually learning from all those teachers in a single go.

Reading and extracting things from standard text books and reference books will itself take a huge amount of time. The videos are just a collection of everything that you need, saving your time.

While reading books only your visionary sense organ (eyes) and mind are active. But while watching videos your eyes, mind and receptive sense organ (ears) are active. So it makes you grasp the things quickly and easily.

If you miss out a part of the video, you can always replay and take a note of it. You can watch videos anytime as per your convenience.

The videos are so made that the dumbest of kid will understand. If you still aren't able to understand from Ravindra Sir's videos then you should probably leave GATE and do something in which you are good at.

How to watch Ravindra Sir's videos?

I watched 13-15 videos a day. Each video is generally of 15-20 mins on average. Alternatively you can calculate it as 170-180 mins of video a single day. I was able to finish the entire course including aptitude and english in just 3.5 months.

The videos contain solved questions in between. So no need to look for alternatives. After completing all the videos for a subject, just solve the practice questions provided. They are just awesome. Solve the practice questions in a weekly gap. Each week 20-40 questions from the subject. During this time don't stop watching the videos of another subject. Repeat this procedure till all subjects are finished.

After all the subjects are finished, just reverse the order of completion to get the order of revision of subjects. It is because you should have a strong hold on the current subject and then move back to the earlier learnt subjects.

During revision, read the notes properly and then start solving previous years gate questions on that subject. For example if you have complete DAA, then you should finish reading your notes first, then solve 5 questions from each subsection of DAA like DP, Greedy, Time Complexity analysis and so on. You can take 4-5 days to solve these questions. Then move to the next subject.

Before 3 months of exams start solving all the gate questions again. In the end all the concepts will be crystal clear in your mind. You will feel confident a lot.

Are Ravindra Sir's videos worth taking at such higher price?

Yes obviously. In the end you will realise that 30k is nothing against what Ravindra Sir's videos would be providing you with.

Lastly, no need to trust me. Just select a concept, read any standard textbook of your choice, and finally attempt previous years gate questions. Then just go and watch Ravindra Sir's free videos in youtube and again attempt the same previous years gate questions. You will get the answer to your question.

"GururBrahma GururVishnu GururDevo Maheshwaraha
Guru Saakshaat ParaBrahma Tasmai Sri Gurave Namaha"

Meaning:

Guru is the Creator (Brahma), Guru is the Preserver(Vishnu), GuruDeva is Destroyer(Maheshwara)
Guru is the absolute (singular) Lord himself, Salutations to that Sri Guru


Monday 2 April 2018

POST GATE: Felicitation program

Special thanks to our beloved Ravindra Sir for inviting us for the felicitation program.

I got a call from Dharani sir enquiring about my rank and congratulating me. After a 5 minutes of talk he gave a surprise to me !!! by inviting me to attend the award ceremony at Alankrita Resorts Hyderabad. I was super amazed as he said that we will bear all your expenses from travel to food and accommodation.

They booked flight tickets for me. The journey started on 30th of march. I was super excited as first time in my life i was going to meet the most special person in my life, Ravindra sir. My friend Ahwan and I reached  Hyderabad airport at 1:20pm sharp. We were greeted by the team of raudra, then some photographs and a super deluxe AC car was waiting just for us. First time in my life i felt the feelings of the so called stardom.

Then after travelling for 71kms we reached the Alankrita Resorts and there also we were greeted with flowers followed by few photographs. At this point of time, we were feeling really hungry. Dharani sir being the modest of person, asked me to go into the room, pick the phone and order anything you like. Followed by this session, when i entered the 4star resorts room i was like "am i a prince or a king !!! have i done something really that great ?"... The room was super fab with soft cushions, pillows, a TV with all channels, 24x7 running AC and what not. Without making any delay i grabbed the rooms telephone, dialled 102 and ordered 3 plate hyderabadi dum biriyani, 3 maggoosh mango juice, 3 super chocolatty icecream, chinese manchow soup all worth INR 2500 in total. I can't express how tasty it was !!! Just mouth watering things of all time i ever dreamt of...We were so full that we could not eat much in the dinner. The dinner was also as awesome as the lunch.

The next day, 31st March we went for breakfast at an auditorium. Again i was like "is this breakfast or lunch?"... All the food items, varying from idli, dosa, wada, scrambled eggs, pastries, soups, juices, sweets etc were there. A total of 40-50 food items were there. This time i controlled myself a bit as i had to keep some place empty in my stomach for the lunch. After having the breakfast we were waiting for our hero, Ravindra sir. Finally after waiting for about 40 minutes Ravindra sir finally entered the venue in style. I can't express the feelings of how i felt at that time, imagine the person you were learning from is right before you in live. It was really hard to believe that Ravindra sir was actually standing before us.

Then the award ceremony started and we were provided with a medal,  tshirt and a bag. Then we had one to one session with all the previous year toppers who were studying in different iit's and iisc ( Nihar bhaiya, Rahul Bhaiya, Debanjan Bhaiya, Vivek bhaiya and a lot many)... We also interacted with our very special Ravindra sir sitting close to him. It was just unbelievable. In the meanwhile i had made a lot of friends who were the future iisians and iitians (Shreya, Anup, Hemant, Yash, Ahwan, Rahul ....a lot many). Previously i was starving to get contacts from iit's and iisc and now i had plenty of them.  Finally after winding up this session, i went for swimming followed by roaming and exploring the resort.

In the last day, 1st Arpil, i gifted Ravindra Sir with the book that i had brought for him, "The monk who sold the ferrari" . Finally we left for airport and safely came back home. This trip helped create new friends, alumni contacts and gave a glance of how life should be. Thanks to Ravindra sir and entire team of Raudra for giving us this fantastic one time life experience. You can feel the essence of the event if you belong to a poor or middle class family. A lot of dreams got fulfilled through this trip.

"Success never comes that easy, Else everyone would have got it, What's so special about you then ?"