Skip to main content

Symmetric and Asymmetric key Encryption

When being introduced to cryptography, an admittedly daunting subject, it’s best to start at the most common subjects first at a very high level and then go deeper once that view is understood; The nitty-gritty of the mathematics behind the crypto can wait. One of the best ways to learn anything new is by using mental models, which is to learn a thought process of how something works, and often how a process would work in the real world. I am often asked to explain the difference between symmetric and asymmetric encryption after people continually confuse the two. So, the purpose of this writing is to provide a very high-level, easy-to-understand mental model of symmetric encryption, asymmetric encryption, and digital signatures, which together make up some of the very basic basics of cryptography.
                Starting off, we’ll create a scenario. Consider that two people, Alice and Bob, are very close friends (or perhaps more – who knows?) They also work in the same office and talk to each other via their work computers during the workday. A third office worker, Eve, is either annoyed or jealous at their relationship and tries to intercept and read messages sent between Alice and Bob. Both Alice and Bob know that Eve is tech-savvy and somewhat malicious towards their relationship.

Even though Alice and Bob have nothing to hide, the idea of Eve intercepting and reading their messages creeps them out, so they want to make themselves less vulnerable to such behavior. How would they go about this? The answer (or one of many answers) is encryption, and they want to use either symmetric or asymmetric encryption to protect their messages.

Symmetric Encryption: Shared Secret (Same Key)
                In mapping the way encryption works to the way securing a message works in the real, physical world, symmetric encryption probably makes the most sense to most people. If Alice and Bob choose to go the symmetric encryption route, they both need to create one shared key that they both have and share with nobody else. Consider this scenario with a physical mailbox with a single lock that is unlocked by a single key, just like how locks work in the real world. They can make another copy of the single key so that only Alice and Bob have access to this mailbox. This duplicated key would be their shared secret, and Eve would be unable to open the messages locked in the box (encrypted) by either Alice or Bob because Eve does not have the key to unlock the box.
The term symmetric encryption comes from the fact that the same key is used to encrypt and decrypt (lock and unlock) the messages. Alice uses her copy of the key to unlock the box’s lock, places the message inside, and then locks the box. Bob then uses his copy of the same key to unlock the box and retrieve the message. The same scenario played out in computer security terms is as follows: Alice encrypts the message using the shared key and then transmits the message over the network, and once Bob receives the message he decrypts it using the same shared key that he also has a copy of.
There is a flaw with symmetric encryption, though: how do both people get the shared key? In the physical world, it would be easy enough to make a copy of a physical key to a physical lock, and then give the other person that copy of the key. But in computer security, keys are not physical and participants are often very far away from each other. Bob could not simply send Alice a copy of the key over the network because then Eve could intercept that key and then can decrypt Bob and Alice’s messages, which would do nothing for the problem that they are trying to solve.

Asymmetric Encryption: Separate Public and Private Keys
Asymmetric encryption was created to solve the issue of both participants getting copies of the same key securely. However, the concept of asymmetric encryption does not map very well to the physical world, since similar concepts are not readily available on a daily basis for most people.
Consider mailboxes again, but two of them this time: Bob’s mailbox and Alice’s mailbox. Each mailbox has two locked doors, and thus the owners of the box need to deal with two keys. We’ll talk about Bob’s box alone since Alice’s box follows the same mechanisms.
Bob’s mailbox has a small upper door, with a key attached. The attached (public key) can be used by anyone to open the top door of Bob’s box, and behind this door is a slot that leads to a compartment behind that bottom door into which anyone can slip a message. However, nobody has access to the bottom door except for Bob, because Bob has another, a private key that only he has, which unlocks that bottom compartment. Once a message has been put into the slot of the top compartment, the public key cannot be used to retrieve a previously inserted message – ONLY Bob can open the box, and thus the message.
In computer security terms, Bob has a public key and a private key. Anyone can use his public key to encrypt a message. The public key is written in a way that a message encrypted with it cannot then be decrypted with the same key – in other words, this is a one-way function. What this means is, even though Bob’s public key is public, any message encrypted with it is specifically meant for Bob and can only be decrypted by Bob. So, Alice encrypts a message with Bob’s private key and transmits it over the network, where Bob receives the encrypted message. Now, Bob uses his private key to decrypt the message, and this key is the only key that can decrypt the message.
Since Alice has the same mechanism, Bob can use Alice’s public key to encrypt a message meant for Alice, and then Alice can decrypt the message with only her own private key, which nobody else has access to. In short, the sender encrypts with the intended recipient’s public key, and the recipient decrypts with their private key. This way, no key that can decrypt a message is sent over the network, so Eve cannot decrypt any message that is encrypted with either Alice or Bob’s public key because she does not have access to Alice or Bob’s private keys.
The term asymmetric encryption comes from the fact that different keys are used to encrypt and decrypt messages. Remember, same key = symmetric; different keys = asymmetric.
There is still an issue with this scenario, though. Since Bob’s public key is available to all who want to send him a secure message, Eve could conceivably write a mean message with Alice’s name on it, then encrypt the message with Bob’s public key and then transmit it to him. Bob may think that Alice was really the person who wrote the message and then believe that their friendship is over. How is Bob supposed to know that Alice did not really send this message? This issue is solved by digital signatures, which is something I will explain in a separate post.
Hopefully, this writing can provide a high-level understanding of symmetric and asymmetric encryption and the differences between the two encryption methods. Learning cryptography can get very messy, and it can seem like a very difficult subject to tackle (and in reality, it is quite difficult), but it is not impossible to learn. Start small and simple, and then work your way up to learning the various algorithms. There is a method to all this madness.


Popular posts from this blog

Social Engineering Toolkit (SET)

Social Engineering Toolkit  (SET) is an advanced,  multifunctional, and easy-to-use computer-assisted social engineering toolset, created by the founders of  TrustedSec ( It helps you prepare the most effective way to exploit client-side application vulnerabilities and makes a fascinating attempt to capture the target's confidential information (for example, e-mail passwords). Some of the most efficient and useful attack methods employed by SET include targeted phishing e-mails with a malicious file attachment, Java applet attacks, browser-based exploitation, gathering website credentials, creating infectious portable media (USB/ DVD/CD), mass-mailer attacks, and other similar multiattack web vectors. This combination of attack methods provides you with a powerful platform to utilize and select the most persuasive technique that could perform an advanced attack against the human element.

 To start SET, navigate to  Applications  |  Kali Linux  |  Expl…

Cracking Wifi Using :Fern(GUI)


As a part of Kali linux , fern can be directly used from kali linux , i would be recommending the use of kali because while using other linux environments it could be a trouble because while using fern it automatically detects the path of aircrack-ng and python installed , while in other environments it is needed to set it follow the following steps :-->

1.) Download kali linux iso and make a bootable pendrive .....if you dont know how to make bootable pendrive  then follow the steps given in blog of trinity rescue kit

Kali linux iso (amd64) recommended -->here
Link to trinity rescue kit blog --> here

 2.)Open Kali linux Goto Applications-->Wireless Attack--> Fern

3.)Select Interface card wlan0

4.)Double click any where in GUI

5.)Select enable x-terms that you can view that happening ...while through a automated program...

6.)Click on select network

7.)Choose the type of network that is WEP/WPA

8.)I would recommend to add dictonary file .…

Deep Web - Part 1

What is deep web ?

Deep web Aka Invisible web Aka Hidden web are parts of the world wide web whose contents are not indexed by standard search engines.
The surface web also known as Visible web , Clearnet , Indexed web or Lightnet is that portion of the world wide web that is readily available to the general public and searchable with standard web search engines. Level of web where vast majority of internet users are connected to and which is accessible in any nation that does not block internet access.E.g: Social media sites like Facebook, informational websites like Wikipedia, general websites, etc


It is the part of world wide web that is not indexed by search-engines,which is directly accessible and no proxy required. E.g: Google locked results, recently web crawled old content, pirated media, pornography etc
Deep web Aka Invisible web Aka Hidden web are parts of the wo…