Wednesday, September 14, 2016

Snort Installation in Windows and Linux


Windows
 
There's nothing much to talk about. This video tells it all :

https://youtu.be/RwWM0srLSg0

If you don't prefer videos and rather prefer text, then the written form of the instructions that the above video gives is here :

https://www.securityarchitecture.com/learning/intrusion-detection-systems-learning-with-snort/installing-snort-on-windows/

Linux [ Beware. It's tedious. ]

Weird that I installed this software in Windows. I hardly use Windows these days. But I checked out the above video and the guy used Windows and I just followed it and did the whole the thing. But if you are a Linux lover, and use a Linux distro, here's a written tutorial on how to install Snort in Ubuntu :

https://www.securityarchitecture.com/learning/intrusion-detection-systems-learning-with-snort/installing-snort-on-linux/

But Beware. I see a lot of complications in the first page (of the above link) itself. I mean, the way the installation goes. Like they use Virtual Machine to install Ubuntu in it, but you don't have to if you have some Linux distro installed in your PC, and then they get Snort by compiling source files of Snort. And then there are lot more steps. I am yet to check it out the whole thing. Still, I just thought I should share the link. But then, don't do it if you aren't up for tedious tasks.

Saturday, September 10, 2016

DES Implementation


To know about how DES works in a nutshell, check this video :

https://www.youtube.com/watch?v=3BZRBfhpIb0

And here is a link to know how to implement DES and it helps you with some examples to check if your code works properly.

http://page.math.tu-berlin.de/~kant/teaching/hess/krypto-ws2006/des.htm

There are many lookup tables in this algorithm, don't make any mistake in initializing them. These tables are mentioned in the above link whenever they are used in between computations. But to check out all the lookup tables at once, check this Wikipedia page :

https://en.wikipedia.org/wiki/DES_supplementary_material

And the Wikipedia page for DES is informative too, it has some good diagramas to represent some computations. Check it out :

https://en.wikipedia.org/wiki/Data_Encryption_Standard#Description

SHA1 Hash Implementation


If you have done MD5 implementation, then SHA1 is quite easy with some small tweaks. Like, SHA1 is fully big endian, unlike MD5, and there are some different compression functions and stuff. That's it.

To know how to implement SHA1 you need to check the official documentation :

https://tools.ietf.org/html/rfc3174

That is the best source, obviously. And there are two ways to implement it, you can choose one and implement. The only difference in the two methods is space and time complexity.

And if you want a good pseudo code, Wikipedia has one for Method 1 of the documentation :

https://en.wikipedia.org/wiki/SHA-1#SHA-1_pseudocode

That should be enough to code SHA1. For any queries, mail me.

Sunday, September 4, 2016

MD5 Hash Implementation


Hey guys! I recently coded the "MD5 Hash" exercise, so I thought I will skip some exercises and share some info related to MD5 and then come back to other exercises and post them later.

So here you go, these are some Cool links I found out.

The official documentation : https://tools.ietf.org/html/rfc1321

I recommend you read the above link, fully. If the font's not readable,
try this link : http://www.fastsum.com/rfc1321.php

Both the above links contain the same info.

And here's an example of how the hashing works on "Hello World!" string.

https://www.scribd.com/doc/35954574/MD5-With-Example

It's really good, in the sense that it helps you know the results of each "round" ( read the documentation to know the jargons. :P) and that way, it will help you debug your code if there's any problem.

***END OF POST***

BIG Note :P :
 
It's not an easy thing to code MD5. But you should (actually, you must!) try it. And stop getting code from others :P Besides, there are more tough exercises like this one. Like SHA1, RSA etc. At least try one of them. Don't get the code for all of them. And Trust me. It will be really hard to understand your friend's code! Sadly you will be cursing your friends (for eg me :P) for writing big, tough or crazy code. Sometimes no one can help writing tough code. So, don't curse them :P And by the way, it's more tougher to understand the code when you don't know anything about what the concept of the exercise is. So, I 'recommend' you try coding the exercises. May be even group up with friends and code modules of the exercise. This way everyone gets to know the exercise. But don't code one whole exercise and ask your friend to code another whole one. It never helps :P

Friday, September 2, 2016

Rail Fence Cipher and Row Column Cipher

Caesar Cipher and Playfair Cipher


Hey guys! The blog is back with a Bang! :D

Let's start with Cryptography Lab stuff. For all ciphers, their corresponding Wikipedia pages have enough information to learn from and the Lab exercise Q PDFs also have enough info. But sometimes, the info is wrong, beware. Anyways, even though so much info is present, I will still share some specific sections of Wikipedia articles and some videos to help understand stuff. Makes the task much easier than reading the whole Wikipedia article.

Caesar Cipher : Wikipedia Page is more than enough. :P https://en.wikipedia.org/wiki/Caesar_cipher

See the example too, of course! https://en.wikipedia.org/wiki/Caesar_cipher#Example

Plafair Ciper Explanation : https://www.youtube.com/watch?v=quKhvu2tPy8

To see another example for Playfair Cipher, see this :
https://en.wikipedia.org/wiki/Playfair_cipher#Example