Sunday 2 November 2014


Simple Blackhole attacks

Blackhole Attacks on NS-2


What is blackhole attacks ??
Black-hole attack: malicious node sends a forged RREP packet to a source node that initiates  the route discovery in order to pretend to be a destination node itself or a node of immediate neighbour the destination. Source node will forward all of its data packets to the malicious node; which were intended for the destination.
We will apply a simple blackhole attack in AODV. following the scenario illustration
For apply this attacks, we have to modify file aodv.cc, aodv.h inside the protocol. folowing the pseudocode in c++
Blackhole always say that have the route to be a sink.
else if ((rt && blackhole == 1)) {
    assert(rq> rq_dst == rt> rt_dst);
    sendReverse(rq> rq_src);
    rt> pc_insert(rt0> rt_nexthop);
    rt0> pc_insert(rt> rt_nexthop);
    Packet::free(p);}
Next i will write complete version.

Saturday 1 November 2014

Andrew Wiles on Solving Fermat

A kind of will power to do anything. Really nice Andrew Sir

Andrew Wiles devoted much of his career to proving Fermat's Last Theorem, a challenge that perplexed the best minds in mathematics for 300 years. In 1993, he made front-page headlines when he announced a proof of the problem, but this was not the end of the story; an error in his calculation jeopardized his life's work. In this interview, Wiles recounts how he came to terms with the mistake, and eventually went on to achieve his life's ambition.
Andrew Wiles being interviewed Anyone who thinks that mathematics doesn't involve passion and emotion should hear directly from Andrew Wiles. : © WGBH Educational Foundation

A childhood dream

NOVA: Many great scientific discoveries are the result of obsession, but in your case that obsession has held you since you were a child.

ANDREW WILES: I grew up in Cambridge in England, and my love of mathematics dates from those early childhood days. I loved doing problems in school. I'd take them home and make up new ones of my own. But the best problem I ever found, I found in my local public library. I was just browsing through the section of math books and I found this one book, which was all about one particular problem—Fermat's Last Theorem. This problem had been unsolved by mathematicians for 300 years. It looked so simple, and yet all the great mathematicians in history couldn't solve it. Here was a problem, that I, a 10 year old, could understand, and I knew from that moment that I would never let it go. I had to solve it.

Who was Fermat and what was his Last Theorem?

Fermat was a 17th-century mathematician who wrote a note in the margin of his book stating a particular proposition and claiming to have proved it. His proposition was about an equation which is closely related to Pythagoras' equation. Pythagoras' equation gives you:
x2 + y2 = z2
You can ask, what are the whole number solutions to this equation, and you can see that:
32 + 42 = 52
and
52 + 122 = 132
And if you go on looking then you find more and more such solutions. Fermat then considered the cubed version of this equation:
x3 + y3 = z3
He raised the question: Can you find solutions to the cubed equation? He claimed that there were none. In fact, he claimed that for the general family of equations:
xn + yn = zn where n is bigger than 2
it is impossible to find a solution. That's Fermat's Last Theorem.

So Fermat said because he could not find any solutions to this equation, then there were no solutions?

He did more than that. Just because we can't find a solution it doesn't mean that there isn't one. Mathematicians aren't satisfied because they know there are no solutions up to four million or four billion. They really want to know that there are no solutions up to infinity. And to do that we need a proof. Fermat said he had a proof. Unfortunately, all he ever wrote down was: "I have a truly marvelous demonstration of this proposition which this margin is too narrow to contain."

What do you mean by a proof?

In a mathematical proof you have a line of reasoning consisting of many, many steps, that are almost self-evident. If the proof we write down is really rigorous, then nobody can ever prove it wrong. There are proofs that date back to the Greeks that are still valid today.
"I really believed that I was on the right track, but that did not mean that I would necessarily reach my goal."

So the challenge was to rediscover Fermat's proof of the Last Theorem. Why did it become so famous?

Well, some mathematics problems look simple, and you try them for a year or so, and then you try them for a hundred years, and it turns out that they're extremely hard to solve. There's no reason why these problems shouldn't be easy, and yet they turn out to be extremely intricate. The Last Theorem is the most beautiful example of this.

But finding a proof has no applications in the real world; it is a purely abstract question. So why have people put so much effort into finding a proof?

Pure mathematicians just love to try unsolved problems—they love a challenge. And as time passed and no proof was found, it became a real challenge. I've read letters in the early 19th century which said that it was an embarrassment to mathematics that the Last Theorem had not been solved. And of course, it's very special because Fermat said that he had a proof.

On Fermat's Trail

How did you begin looking for the proof?

In my early teens I tried to tackle the problem as I thought Fermat might have tried it. I reckoned that he wouldn't have known much more math than I knew as a teenager. Then when I reached college, I realized that many people had thought about the problem during the 18th and 19th centuries and so I studied those methods. But I still wasn't getting anywhere. Then when I became a researcher, I decided that I should put the problem aside. It's not that I forgot about it—it was always there—but I realized that the only techniques we had to tackle it had been around for 130 years. It didn't seem that these techniques were really getting to the root of the problem. The problem with working on Fermat was that you could spend years getting nowhere. It's fine to work on any problem, so long as it generates interesting mathematics along the way—even if you don't solve it at the end of the day. The definition of a good mathematical problem is the mathematics it generates rather than the problem itself.

It seems that the Last Theorem was considered impossible, and that mathematicians could not risk wasting getting nowhere. But then in 1986 everything changed. A breakthrough by Ken Ribet at the University of California at Berkeley linked Fermat's Last Theorem to another unsolved problem, the Taniyama-Shimura conjecture. Can you remember how you reacted to this news?

It was one evening at the end of the summer of 1986 when I was sipping iced tea at the house of a friend. Casually in the middle of a conversation this friend told me that Ken Ribet had proved a link between Taniyama-Shimura and Fermat's Last Theorem. I was electrified. I knew that moment that the course of my life was changing because this meant that to prove Fermat's Last Theorem all I had to do was to prove the Taniyama-Shimura conjecture. It meant that my childhood dream was now a respectable thing to work on. I just knew that I could never let that go.

So, because Taniyama-Shimura was a modern problem, this meant that working on it, and by implication trying to prove Fermat's Last Theorem, was respectable.

Yes. Nobody had any idea how to approach Taniyama-Shimura but at least it was mainstream mathematics. I could try and prove results, which, even if they didn't get the whole thing, would be worthwhile mathematics. So the romance of Fermat, which had held me all my life, was now combined with a problem that was professionally acceptable.

Keeping a secret

At this point you decided to work in complete isolation. You told nobody that you were embarking on a proof of Fermat's Last Theorem. Why was that?

I realized that anything to do with Fermat's Last Theorem generates too much interest. You can't really focus yourself for years unless you have undivided concentration, which too many spectators would have destroyed.

But presumably you told your wife what you were doing?

My wife's only known me while I've been working on Fermat. I told her on our honeymoon, just a few days after we got married. My wife had heard of Fermat's Last Theorem, but at that time she had no idea of the romantic significance it had for mathematicians, that it had been such a thorn in our flesh for so many years.
"There's no problem that will mean the same to me."

On a day-to-day basis, how did you go about constructing your proof?

I used to come up to my study, and start trying to find patterns. I tried doing calculations which explain some little piece of mathematics. I tried to fit it in with some previous broad conceptual understanding of some part of mathematics that would clarify the particular problem I was thinking about. Sometimes that would involve going and looking it up in a book to see how it's done there. Sometimes it was a question of modifying things a bit, doing a little extra calculation. And sometimes I realized that nothing that had ever been done before was any use at all. Then I just had to find something completely new; it's a mystery where that comes from. I carried this problem around in my head basically the whole time. I would wake up with it first thing in the morning, I would be thinking about it all day, and I would be thinking about it when I went to sleep. Without distraction, I would have the same thing going round and round in my mind. The only way I could relax was when I was with my children. Young children simply aren't interested in Fermat. They just want to hear a story and they're not going to let you do anything else.

Alone and in the dark

Usually people work in groups and use each other for support. What did you do when you hit a brick wall?

When I got stuck and I didn't know what to do next, I would go out for a walk. I'd often walk down by the lake. Walking has a very good effect in that you're in this state of relaxation, but at the same time you're allowing the sub-conscious to work on you. And often if you have one particular thing buzzing in your mind then you don't need anything to write with or any desk. I'd always have a pencil and paper ready and, if I really had an idea, I'd sit down at a bench and I'd start scribbling away.

So for seven years you're pursuing this proof. Presumably there are periods of self-doubt mixed with the periods of success.

Perhaps I can best describe my experience of doing mathematics in terms of a journey through a dark unexplored mansion. You enter the first room of the mansion and it's completely dark. You stumble around bumping into the furniture, but gradually you learn where each piece of furniture is. Finally, after six months or so, you find the light switch, you turn it on, and suddenly it's all illuminated. You can see exactly where you were. Then you move into the next room and spend another six months in the dark. So each of these breakthroughs, while sometimes they're momentary, sometimes over a period of a day or two, they are the culmination of—and couldn't exist without—the many months of stumbling around in the dark that proceed them.

And during those seven years, you could never be sure of achieving a complete proof.

I really believed that I was on the right track, but that did not mean that I would necessarily reach my goal. It could be that the methods needed to take the next step may simply be beyond present day mathematics. Perhaps the methods I needed to complete the proof would not be invented for a hundred years. So even if I was on the right track, I could be living in the wrong century.
Andrew Wiles at blackboard For eight years, Wiles was utterly obsessed with the challenge of Fermat's Last Theorem. Enlarge Photo credit: © WGBH Educational Foundation

A Fitful breakthrough

Then eventually in 1993, you made the crucial breakthrough.

Yes, it was one morning in late May. My wife, Nada, was out with the children and I was sitting at my desk thinking about the last stage of the proof. I was casually looking at a research paper and there was one sentence that just caught my attention. It mentioned a 19th-century construction, and I suddenly realized that I should be able to use that to complete the proof. I went on into the afternoon and I forgot to go down for lunch, and by about three or four o'clock, I was really convinced that this would solve the last remaining problem. It got to about tea time and I went downstairs and Nada was very surprised that I'd arrived so late. Then I told her I'd solved Fermat's Last Theorem.

The New York Times exclaimed "At Last Shout of 'Eureka!' in Age-Old Math Mystery," but unknown to them, and to you, there was an error in your proof. What was the error?

It was an error in a crucial part of the argument, but it was something so subtle that I'd missed it completely until that point. The error is so abstract that it can't really be described in simple terms. Even explaining it to a mathematician would require the mathematician to spend two or three months studying that part of the manuscript in great detail.

Eventually, after a year of work, and after inviting the Cambridge mathematician Richard Taylor to work with you on the error, you managed to repair the proof. The question that everybody asks is this; is your proof the same as Fermat's?

There's no chance of that. Fermat couldn't possibly have had this proof. It's 150 pages long. It's a 20th-century proof. It couldn't have been done in the 19th century, let alone the 17th century. The techniques used in this proof just weren't around in Fermat's time.

So Fermat's original proof is still out there somewhere.

I don't believe Fermat had a proof. I think he fooled himself into thinking he had a proof. But what has made this problem special for amateurs is that there's a tiny possibility that there does exist an elegant 17th-century proof.

A melancholy triumph

So some mathematicians might continue to look for the original proof. What will you do next?

There's no problem that will mean the same to me. Fermat was my childhood passion. There's nothing to replace it. I'll try other problems. I'm sure that some of them will be very hard and I'll have a sense of achievement again, but nothing will mean the same to me. There's no other problem in mathematics that could hold me the way that this one did. There is a sense of melancholy. We've lost something that's been with us for so long, and something that drew a lot of us into mathematics. But perhaps that's always the way with math problems, and we just have to find new ones to capture our attention. People have told me I've taken away their problem—can't I give them something else? I feel some sense of responsibility. I hope that seeing the excitement of solving this problem will make young mathematicians realize that there are lots and lots of other problems in mathematics which are going to be just as challenging in the future.
"My mind is now at rest."

What is the main challenge now?

The greatest problem for mathematicians now is probably the Riemann Hypothesis. But it's not a problem that can be simply stated.

And is there any one particular thought that remains with you now that Fermat's Last Theorem has been laid to rest?

Certainly one thing that I've learned is that it is important to pick a problem based on how much you care about it. However impenetrable it seems, if you don't try it, then you can never do it. Always try the problem that matters most to you. I had this rare privilege of being able to pursue in my adult life, what had been my childhood dream. I know it's a rare privilege, but if one can really tackle something in adult life that means that much to you, then it's more rewarding than anything I can imagine.

And now that journey is over, there must be a certain sadness?

There is a certain sense of sadness, but at the same time there is this tremendous sense of achievement. There's also a sense of freedom. I was so obsessed by this problem that I was thinking about it all the time—when I woke up in the morning, when I went to sleep at night—and that went on for eight years. That's a long time to think about one thing. That particular odyssey is now over. My mind is now at rest.

This feature originally appeared on the site for the NOVA program The Proof.
Steps occur when you enter your credit card number online 
RSA - Rivest, Adi Shamir, and Leonard Adleman
This idea firstly came to the scientist named Pierre Fermat.

Prime Numbers 1 , 3, 5, ... play a major and important key role in our lives knowing or unknowingly.
I can tell something’s up when random people start asking me about the randomness of primes—without even knowing that I’m a mathematician! In the past couple of weeks we’ve heard about a beautiful result on the gaps between primes and about cicadas’ prime-numbered life cycles.

Our current love affair with primes notwithstanding, many people have wondered whether this is all just abstract theoretical stuff or whether prime numbers have real-world applications.
In fact, they have applications to something as ubiquitous and mundane as making a purchase online.

Every time you enter your credit card number on the Internet, prime numbers spring into action. Before your card number is sent over the wires, it must be encrypted for security, and once it’s received by the merchant, it must be decrypted.

One of the most common encryption schemes, the RSA algorithm, is based on prime numbers. It uses a “public key,” information that is publicly available, and a “private key,” something that only the decoding party (merchant) has. Roughly speaking, the public key consists of a large number that is the product of two primes, and the private key consists of those two primes themselves. It’s very difficult to factor a given large number into primes. For example, it took researchers two years recently to factor a 232-digit number, even with hundreds of parallel computers. That’s why the RSA algorithm is so effective.

Definition: Prime numbers are whole numbers greater than 1 that are not divisible by any whole number other than 1 and itself. The first few are 2, 3, 5, 7, 11, 13 … 
To explain how the RSA algorithm works, I need to tell you first about something called Fermat’s little theorem. It was discovered by Pierre Fermat, the same French mathematician who came up with the famous Fermat’s last theorem
Fermat had a penchant for being cryptic; in the case of his last theorem, he left a note on the margin of a book stating his theorem and adding: “I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.” Call it the 17th-century version of a Twitter proof. Many professional mathematicians and amateurs tried to reproduce Fermat’s purported proof, and it took more than 350 years to come up with a real one
About Andrew Wiles in the next post

To understand what Fermat’s little theorem means, we need to learn how to do arithmetic “modulo N.” This is something, in fact, we do all the time when adding angles. If you rotate an object by 180 degrees, and then by another 270 degrees, the net result will be rotation by 90 degrees.
 That’s because 180 + 270 = 450, and then we subtract 360 from it, because rotation by 360 degrees means no net rotation at all. This is what mathematicians call addition “modulo 360.” Likewise, we can do addition modulo any whole number N instead of 360. 


And we can also do multiplication modulo N.
Now suppose that N is a prime number. Then we have the following remarkable fact: Raising any number to the Nth power modulo N, we get back that same number. For example, if N = 5, then the 5th power of 1 is 1 and the 5th power of 2 is 32, which is equal to 2 modulo 5 because after you subtract the closest multiple of 5 (in this case, you subtract 30, or 5 × 6), you are left with 2 (because 32 = 5 × 6 + 2). Likewise, the 5th power of 3 is equal to 3 modulo 5, and so on. This is Fermat's little theorem. Fermat first divulged it in a letter to a friend. “I would send you a proof of it,” he wrote, “but I am afraid it’s too long.” He was such a tease, this Fermat. Unlike the proof of his last theorem, however, the proof of the little one is surprisingly simple—it could even fit in the margin of a book. I would write it here, but my editor tells me that my article is already too long.
No worries though, you can read the proof in this excerpt from my book Love and Math.
This is neat, but what does it have to with Internet security?
We need to devise a two-step procedure:
First encrypt a credit card number and then decrypt it, so that if we follow both steps we get back the original number. The good news from Fermat’s little theorem is that raising a card number to a prime power modulo that prime is a procedure that gives us back the original number. The bad news is that because a prime is not divisible by anything, there is no way to break this procedure into two steps. However, Ron Rivest, Adi Shamir, and Leonard Adleman, after whom the RSA algorithm is named, were not discouraged. They took Fermat’s idea one step further. They asked: What if we take N which is the product of two primes—call them p and q. Then we have the following analogue of Fermat’s little theorem:


Raising any number to the power (p – 1)(q – 1) + 1 will give us back the same number modulo N. For example, N = 15 is the product of p = 3 and q = 5. Then (p – 1)(q – 1) + 1 = (3 – 1)(5 – 1) + 1 = 9. If you raise any number to the 9th power, you get back the same number modulo 15. It looks like a miracle, but in fact the proof is no more complicated than that of Fermat’s little theorem.
And now we can use it for encryption: For the given prime numbers p and q, the combination (p – 1)(q – 1) + 1 will typically be a number that is not a prime. Hence it can be represented as the product of two whole numbers, call them r and s. (In our example, (p – 1)(q – 1) + 1 = 9, so we can take r = 3 and s = 3.) Raising a number to the power (p – 1)(q – 1) + 1 can now be broken into two steps: raising it to the rth power and then raising it to the sth power.

Here’s how it works in practice: The merchant picks two large prime numbers p and q (there are various algorithms for generating primes), takes their product N, and chooses r and s. He or she then makes r and N known to everyone; this is the public key. The encryption consists of raising a credit card number to the rth power modulo N. Anyone can do it (on a computer, because the numbers involved are quite large).
The decryption, on the other hand, consists of raising the resulting number to the sth power modulo N. This gives back the original credit card number (see here for more details). The merchant keeps the number s secret. Therefore the transmission of the credit card numbers is secure. The only way to find s, and hence to be able to decrypt the card numbers, is to determine the prime factors p and q of the number N. For sufficiently large N, however, using known methods of prime factorization, it may take many months to find p and q, even on a network of powerful computers. But if one could come up with a more efficient way to factor numbers into primes (for example, by using a quantum computer), then one would have a tool for breaking the RSA algorithm. That’s why a lot of research is directed toward factoring numbers into primes. Scores of legitimate mathematicians are working on this, and perhaps not so legitimate ones as well.
To an outsider, the RSA algorithm appears like a card trick: You pick a card from a stack, hide it (this is like encryption), and after some manipulations the magician produces your card—adbraka! Well, that's pretty much what the RSA algorithm does … except that the role of magic is now played by math.

RSA- Names of 3 Security Scientist Ron Rivest, Adi Shamir and Leonard Adleman 1977

 

RSA algorithm and the realization of the principle. RSA is the best tool for data encryption can be used for digital signatures, a non-symmetric cryptography algorithms. It has a pair of keys, one of which is the private key, by the user preserved another for the public key can be made public. And VC++ Language, through the MFC designed a small system to the simple application of simulation algorithm

https://www.mediafire.com/?1zs9b6vp5m09saa



Number of algorithms: tournament selection method Primes, the shortest path (dijkstra, floyd), segment tree, LCD, LCM corresponding algorithms in Java

https://www.mediafire.com/?4clp9cjf98z98b6

Data Structure written in Java for Huffman Coding Algorithm.

https://www.mediafire.com/?vaddkn32ndgll2z 
Simple & Easy implementation of PRIM'S and DIJKSTRA algorithms for graph sorting. It also permit comparison of time between both algorithm.
 Try it
https://www.mediafire.com/?8oazolaczbls4oy 
Dijkstra algorithm used in the calculation of graph theory point-to-point shortest distance by using apple

https://www.mediafire.com/?8oazolaczbls4oy
NIDS Network Intrusion Detection System, my graduation part

https://www.mediafire.com/?2g0y8ptuu128ra2

NIDS Network Intrusion Detection System Full to full source code

https://www.mediafire.com/?ye9gmtuxe1u7um1

Intrusion Detection System based on agent with java

https://www.mediafire.com/?7tdn9erm4xjarb6 


Teaching plan of Intrusion Detection Technology.
 
PPT ON NETWORK Intrusion clustering in intrusion detection ppt teaching intrusion detection information security in  google best search engine