Ethical Hacking – Cryptography

Hello everyone in this video we will talk about one of the most important term used in cyber security called as cryptography so now let’s talk about it so what is cryptography so cryptography is actually an art of hiding our data in order to protect that data from third party people so we can even use cryptography to convert our normal text into an unreadable form so that it can be remained safe from the third party people so the main three principles of cryptography is confidentiality availability and integrity so confidentiality ensures that our data is secure and integrity ensure us that data our data is not being tampered or altered by another third party people and availability ensure us that our data is available whenever we need now let’s talk about one of the most popularly used cryptography technique in order to protect our data and that technique is called as encryption so what is encryption so encryption is actually a process of converting our plaintext into n ciphertext which means here you can see that here is our plaintext hello and after the encryption our text becomes this that is an unreadable form and this is called as ciphertext so you can see here encryption is a process of converting our data into a ciphertext so that integrity of that data can be maintained and the encryption is the path of a cryptography technique now let’s talk about different types of cryptography techniques so there are three types of cryptography security cryptography public key cryptography and hash functions now let’s talk about each of them in detail so first of all we will talk about secret key cryptography so secret key cryptography is also called as symmetric key encryption so what it means it means while encrypting the data the key which we will use in encryption will be the same and while the time of decrypting the data the key which we will use is the same as of encryption so here you can see that here is our data and the while the time of encrypting is this data our key is a secret key and it’s the same and once we got our encrypt and we want to decrypt that so while the time of decryption we will use the same key which we used in order to encrypt the data so this is in the case of secret key cryptography now let us talk about public key cryptography so in public key cryptography there are two keys so here you can see that the key for encryption is different and the key which is used while decrypting is different so that is why public key cryptography is also called as asymmetric encryption now let’s talk about the last type of cryptography that is hash functions so what is hash function so hashing is actually a one way conversion which means we have won our text so here you can see we have one text that is hello so once we convert the hash of this hello so you can see here that we got our hash and this is a one-way conversion means once we got our hash we are not be able to retrieve our text back so that is why hashing is called as one-way conversion and it is not recommended to use this technique in order to protect your data now let’s see how hash functions and encryption works now let’s have a look at different hashing algorithm and let’s see how encryption works with the help of one Python program so in order to proceed we have to download this Python language and you can download the Python from here from Python dot arc so python language is available in two versions Python 3 and Python so the only difference between these two versions are the difference of syntax or the way we write the code so for that program we have to download this Python and I have already downloaded and install Python in my system so once you install the Python so the next thing you have to do is you have to download that Python file that is called as Swiss crypto so I have created this file and name it as a Swiss crypto and you can download this file from my github link that is disk dot slash sharath kumar 97 so let me just click over here so here you can see that the file which I have created so my name my name dit as a Swiss crypto tool and it’s purely written in Python so it supports different hashing algorithms and different encryption algorithms so we can also send a secure email by encrypting our body with the help of private keys with the help of this tool and this script is compatible with Python so before running the script we have to install some Python libraries that is PI crypto and TK Intel and all we also have to resolve some dependencies issues so if you face any problem while running the script you can reach out to me at this email address and if I scroll down here you can see the Python code so let’s save this file click on draw right-click and click on save page s and let’s save the script on my desktop with the name as Swiss crypto so if I go here on my desktop you will see this script Swiss crypto and if you have Python correctly installed then this will be the icon of the script and here you can see that it’s written Python file so let’s right-click over here and click on edit with ID ad so here you can see the entire source code of the script so the next thing you have to do is you have to install PI crypto a library of Python which contains lot of cryptographic functions which I have imported in this script so in order to install any Python library so we have to go to python directory that where the python is installed so by default the python is installed in local disk c and here you will find a folder named as python 27 so let me open this up and here you will find one directory called as scripts so let me double click over here so once we are here just press shift and then click on right mouse button and here you will see one option that open command window here so click over here and here you will see that a command prompt is open and here is the path that where we are writin C Python and sick so we have two right here with then install followed by the Python library which we want to install so pip is a program in Python which is used in to install different Python libraries so here you can write PI crypto so I have already downloaded and install this library so that’s right same requirement already satisfied so have to install the spike crypto library and if still you are facing some problems then you just feel free to reach out to me so let me just close this up let’s open this thing ok so now let’s try to run this script so in order to run it just click over here run and run module so once we run it here you will see a beautiful graphical menu containing secure messaging system and it contains a lot of options in its menu that is hash convertor encryption decryption and secure email so but for in this video we’ll cover all the hashing algorithms along with one encryption algorithm so let’s click over here hash converter and here you will find a different hashing algorithm like md5 sha-1 shot 256 shopify 112 just for example if I click over here md5 and here it asks us for entering the data so if I enter the data hello and if I click on convert here you will see that our data hello is actually converted into md5 hash and here you can find the hash of hello and behind the script you can see here that in the Python shell the hash of hello is created and you can copy it from here so as I told you earlier that hashing is one way conversion that once we can watch our text into a hash we are not able to retrieve our text back so depending upon the hashing algorithm you are using you will get a complex hash so just for example let’s try to convert our text by using sha-1 so let’s try to convert here sunlight let’s try something here called as click on convert and you will see that we now this time we got a hash but that is a little bit longer than md5 and you can even create a longest hash by using this algorithm Shopify 112 that is 500 bucks and let’s try to convert this text only by using Shopify 112 and if I click on convert you will see that we got a very long hash you can see here the hashing value and if I go back here you will see that the chef I won 12 hash of that text so you can also use this tool in order to store passwords in your database in hashes so this was all about hashing algorithms now let’s talk about encryption that how encryption works so as I told you earlier that in order to encrypt the data we have to add one key and in order to decrypt the data we have to add the same key depending upon the encryption algorithm we are using so let us run this file again and now this time let’s go here to the encryption let us click over here symmetric encryption block cipher and in this video let’s concentrate on this stream ciphers and let’s select this algorithm a our seafood that is driver cipher 4 so these all kind of different algorithms I will explain you in the next video but for the sake of this video let’s consider it over here so it asks us for the key and the data to convert so in the first input field let’s write here the secret key and our secret key will be you can write here anything like secret 1 2 3 4 5 so it’s the secret key is it’s just like a password so once we add the secret key here we have to add our data which we want to encrypt so let’s add here let’s add here any random string that is password of Facebook click on convert and here you will see that we got our encrypted text and this text is in the form of hex value so here you can see that our encrypted text or we can say that it’s over cyphertext because it’s encrypted now in order to decrypt this text we want this encrypted text and along with this key so now let us try to decrypt this text click on description so may take encryption and we have to select the same algorithm which we have used while encrypting so here Enter key to decrypt so our key was secret one two three four five and let us copy this in encrypted text from here let’s go back let’s save this text click on ok and here you will see that we got our normal text back that was password of Facebook and if I go back to the Python shell you will see here that the decrypted text is the password of Facebook which we have entered while encryption so this is how a normal encryption decryption and hashing algorithm works now let us try to change a little modification in the encrypted data so here you can see that if I enter only a single word here like P and if I change one key sum to something random and if I click on OK here you will see that it will give us an error of odd length string which means the key should be the same while encryption of data and the data which we got after an encryption should be the same so in this video we have covered that what is cryptography what is hashing algorithms and virtus encryption and we have a look at one Python program which we can use in order to encrypt something annual in order to see that how hashing works thanks for watching this video …

We acknowledge that this video belongs to the author and thank them for it’s use.

Copyright Disclaimer under section 107 of the Copyright Act of 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research. Fair use is a use permitted by copyright statute that might otherwise be infringing..

As found on Youtube

(Visited 2 times, 1 visits today)

About The Author

You Might Be Interested In