Cryptography Full Course | Cryptography And Network Security | Cryptography | Simplilearn

Simplilearn www.youtube.com

Brief Summary

This video provides a comprehensive overview of cryptography, covering its importance, applications, and various encryption and hashing algorithms. It explains symmetric and asymmetric key cryptography, hashing, and their real-world applications, such as securing online transactions and protecting data. The video also touches on the SSL handshake process and concludes with a set of interview questions related to cryptography and cybersecurity.

  • Cryptography is essential for securing data on the internet and in local storage.
  • Symmetric and asymmetric encryption are two primary methods of employing cryptography.
  • Hashing is used for password storage and ensuring data integrity.
  • Algorithms like DES, AES, and RSA are fundamental to modern cryptography.
  • SSL handshake is a critical application of cryptography for secure web browsing.

Why Is Cryptography Essential

The video introduces cryptography as a crucial element of modern internet security, highlighting its role in securing data during online transactions and in local storage. Encryption and decryption are central to cryptography, which underpins secure website browsing and messaging applications like WhatsApp. The course aims to provide a comprehensive understanding of cryptography in under three hours, covering its basic needs, applications, and historical significance in data security.

What is Cryptography

Cryptography is defined as the science of encrypting and decrypting information to prevent unauthorized access. Encryption involves using algorithms to transform data into an unreadable format, while decryption reverses this process to restore readability. Data before encryption is called plaintext, and the algorithms used for scrambling data are called ciphers. The key used to scramble the data is the encryption key, which, along with the cipher, is needed by the receiver to decrypt the message.

Applications

Cryptography secures various aspects of digital life, including website accounts, email communications, and messaging apps like WhatsApp, which sends over 65 billion encrypted messages daily. It also underpins cryptocurrency markets through blockchain technology, using encryption algorithms and hashing functions to ensure data security. Cryptography has historical roots, with examples like the Caesar cipher and the Enigma machine used in World War II to protect confidential information.

Symmetric Key Cryptography

Symmetric key cryptography is primarily used in banking applications to encrypt personally identifiable information and detect bank fraud. It also protects data at rest on servers and in data centers, ensuring minimal delay when data is recalled. Symmetric encryption is essential for secure HTTPS websites, verifying server authenticity, exchanging encryption keys, and generating secure sessions. This method relies on a single, pre-shared secret key for both encryption and decryption.

Asymmetric Key Cryptography

Asymmetric encryption uses a pair of keys: a public key for encryption and a private key for decryption, eliminating the need for key exchange. The public key can be shared openly, while the private key remains secret. This method is used for digital signatures, document encryption, blockchain authorization, and securing SSL/TLS-encrypted browsing sessions. Combining asymmetric and symmetric cryptography optimizes data handling, using asymmetric keys to encrypt symmetric keys for large data transfers.

Hashing

Hashing involves scrambling data using hash functions, which are irreversible algorithms that produce a hash value or digest. Unlike encryption, hashes cannot be decrypted back to their original value. Websites use hashing to store user passwords securely, comparing the hash of the entered password with the stored hash during login. Hashing is also used for integrity checks, where the hash value of a downloaded file is compared to the original to ensure no data corruption occurred.

DES Algorithm

The Data Encryption Standard (DES) is a symmetric key cipher used to encrypt and decrypt information in blocks. DES takes 64-bit blocks of plaintext and converts them into ciphertext using 48-bit keys, following a Feistel cipher structure. Although DES was once a global standard for data encryption, it was eventually cracked and replaced by Triple DES due to its short key length.

AES Algorithm

The Advanced Encryption Standard (AES), also known as the Rijndael algorithm, is a symmetric block cipher with a 128-bit block size and key sizes of 128, 192, or 256 bits. AES uses a substitution-permutation network and performs calculations on byte data rather than bit data. The number of rounds during encryption depends on the key size, with 128-bit keys using 10 rounds, 192-bit keys using 12 rounds, and 256-bit keys using 14 rounds.

Digital Signature Algorithm

Digital signatures are used to authenticate and verify documents, preventing tampering and forgery. They work on the public key cryptography architecture, where the signature is encrypted using a private key and decrypted with the public key. The Digital Signature Algorithm (DSA) is a FIPS standard that uses mathematical functions to create a digital signature consisting of two 160-bit numbers derived from the message digest and private key.

Rivet-Shamir-Adleman Encryption

The RSA algorithm is a public key signature algorithm developed by Rivest, Shamir, and Adleman. It uses logarithmic functions to balance complexity and speed, and can encrypt and decrypt general information, as well as handle digital signature verification. RSA reverses the key set usage for encryption and decryption, using the receiver's public key to encrypt data and the receiver's private key to decrypt it.

MD5 Algorithm

The MD5 hashing algorithm is a one-way cryptographic function that accepts a message of any length and returns a fixed-length 128-bit digest value. Designed by Ronald Rivest, MD5 is used for authenticating digital signatures and verifying data integrity. The algorithm involves padding the message, initializing a message digest buffer, and processing the message in 512-bit blocks through multiple rounds of operations.

Secure Hash Algorithm

The Secure Hash Algorithm (SHA) is a family of cryptographic hash functions published by NIST and the NSA. It includes SHA-0, SHA-1, SHA-2, and SHA-3, each with different block sizes and security characteristics. SHA functions generate digests that appear random, meeting requirements that make it impossible to generate a message matching a specific hash value or create two messages with the same hash value.

SSL Handshake

The SSL (Secure Sockets Layer) handshake is an encryption-based internet security protocol that ensures privacy, authentication, and data integrity in internet communication. It involves a handshake process between communicating devices to verify their identities and uses a combination of symmetric and asymmetric encryption to ensure message privacy. The SSL protocol functions between the application and transport layers, encrypting and authenticating data before transmission.

Interview Questions

This section covers common cryptography interview questions, including definitions of cryptography, encryption, and decryption. It explains the difference between ciphertext and cleartext, block ciphers, and public key infrastructure (PKI). The objectives of modern cryptography—confidentiality, non-repudiation, authenticity, and integrity—are discussed, along with safer encryption routines and the blowfish algorithm.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the Apple Store
Get it on Google Play

Transcript

Full transcript of “Cryptography Full Course | Cryptography And Network Security | Cryptography | Simplilearn”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:14 hey everyone welcome to this video on the full course for cryptography in this course we will learn everything there is to know about cryptography and how it helps keep our data secure on the internet and in local storage with encryption and decryption forming the heart of this lesson cryptography has become the backbone of modern internet security from secure website browsing to exchanging messages on whatsapp cryptography has its roots planted firmly among multiple avenues all of which will be covered in this video so strap up and get ready for a comprehensive course on cryptography that can be completed in just under 3 hours let's take a look at the topics to be covered today we start our lesson by understanding the basic need for cryptography and why it

1:00 has become an integral part of our daily lives moving on we learn how cryptography works its worldwide applications and its historical significance as far as securing data is concerned next we know about the different ways to employ cryptography such as symmetric encryption asymmetric encryption and hashing once the basic concepts are clearly understood we can move on to more complex topics such as the individual encryption and decryption algorithms used in cryptography the first one being the data encryption standard or the des algorithm next we learn about the advanced encryption standard that is the aes algorithm digital signature or the dsa algorithm

1:46 and the reverse shameer edelman algorithm also known as the rsa encryption algorithm we then take a look at two hashing algorithms specifically the messaging digest 5 or the md5 hash algorithm and the secure hash algorithm family also known as the sha hash algorithm once we understand the algorithms at play we can learn about some unique applications of cryptography like the secure socket layer handshake or the ssl handshake which helps keep our web browsers safe against malicious attacks similarly we learn about the diffie-hellman key exchange which was a revolutionary protocol that enabled the exchange of cryptographic keys over an insecure channel finally we go through some popular interview questions that

2:31 candidates go through when applying for a position that deals with cryptography or just cyber security in general but before we start our lesson make sure you are subscribed to the simply learn youtube channel and the bell icon is enabled so that you never miss an update from us so here's a story to help you understand cryptography meet ann ann wanted to look for a decent discount on the latest iphone she started searching on the internet and found a rather shady website that offered a 50 discount on the first purchase once ann submitted her payment details a huge chunk of money was withdrawn from a bank account just moments after devastated and quickly realized she had failed to notice that the website was a http web page instead of an https one

3:19 the payment information submitted was not encrypted and it was visible to anyone keeping an eye including the website owner and hackers had she used a reputed website which has encrypted transactions and employees cryptography our iphone enthusiasts could have avoided this particular incident this is why it's never recommended to visit unknown websites or share any personal information on them now that we understand why cryptography is so important let's now understand what cryptography is cryptography is the science of encrypting or decrypting information to prevent unauthorized access we transform our data and personal information so that only the correct recipient can understand the message as an essential

4:05 aspect of modern data security using cryptography allows the secure storage and transmission of data between willing parties encryption is the primary route for employing cryptography by adding certain algorithms to jumble up the data decryption is the process of reversing the work done by encrypting information so that the data becomes readable again both of these methods form the basis of cryptography for example when simply learn is jumbled up or changed in any format not many people can guess the original word by looking at the encrypted text the only ones who can are the people who know how to decrypt the coded word thereby reversing the process of encryption any data pre-encryption is called plain

4:52 text or clear text to encrypt the message we use certain algorithms that serve a single purpose of scrambling the data to make them unreadable without the necessary tools these algorithms are called ciphers they are a set of detailed steps to be carried out one after the other to make sure the data becomes as unreadable as possible until it reaches the receiver we take the plain text pass it to the cipher algorithm and get the encrypted data this encrypted text is called the ciphertext and this is the message that is transferred between the two parties the key that is being used to scramble the data is known as the encryption key these steps that is the cipher and the encryption key are made known to the receiver who can then reverse the

5:37 encryption on receiving the message unless any third party manages to find out both the algorithm and the secret key that is being used they cannot decrypt the messages since both of them are necessary to unlock the hidden content wonder what else we would lose if not for cryptography any website where you have an account can read your passwords important emails can be intercepted and their contents can be read without encryption during the transit more than 65 billion messages are sent on whatsapp every day all of which are secured thanks to end to end encryption there is a huge market opening up for cryptocurrency which is possible due to blockchain technology that uses encryption algorithms and hashing

6:23 functions to ensure that the data is secure cryptography has been in practice for centuries julius caesar used a substitution shift to move alphabets a certain number of spaces beyond their place in the alphabet table a spy can't decipher the original message at first glance for example if he wanted to pass confidential information to his armies and decides to use the substitution shift of plus 2 a becomes c b becomes d and so on the word attack when passed through a substitution shift of plus 3 becomes d w d e f n this cipher has been appropriately named the caesar cipher which is one of the most widely used algorithms the enigma is probably the most famous

7:11 cryptographic cipher device used in ancient history it was used by the nazi german armies in the world wars they were used to protect confidential political military and administrative information and it consisted of three or more rotors that scrambled the original message depending on the machine state at that time the decryption is similar but it needs both machines to stay in the same state before passing the cipher text so that we receive the same plain text message there are two types of encryption in cryptography symmetric key cryptography and asymmetric key cryptography both of these categories have their pros and cons and differ only by the implementation today we are going to focus exclusively

7:56 on symmetry key cryptography let us have a look at its applications in order to understand its importance better this variant of cryptography is primarily used in banking applications where personally identifiable information needs to be encrypted with so many aspects of banking moving on to the internet having a reliable safety net is crucial symmetric cryptography helps in detecting bank fraud and boosts the security index of these payment gateways in general they are also helpful in protecting data that is not in transit and dress on servers and data centers these centers house a massive amount of data that needs to be encrypted with a fast and efficient algorithm so that when the data needs to be recalled by the respective service there is the

8:43 assurance of minor to no delay while browsing the internet we need symmetric encryption to browse secure https websites so that we get an all-around protection it plays a significant role in verifying website server authenticity exchanging the necessary encryption keys required and generating a session using those keys to ensure maximum security this helps us in preventing the rather insecure hdp website format so let us understand how symmetric key cryptography works first before moving on to the specific algorithms symmetric key cryptography relies on a single key for the encryption and decryption of information both the sender and receiver of the message need to have a pre-shared secret

9:28 key that they will use to convert the plain text into ciphertext and vice versa as you can see in the image the key used for encryption is the same key needed for decrypting the message at the other end the secret key shouldn't be sent along with the cipher text to the receiver because that would defeat the entire purpose of using cryptography key exchange can be done beforehand using other algorithms like the diffie-hellman key exchange protocol for example for example if paul wants to send a simple message to jane they need to have a single encryption key that both of them must keep secret to prevent snooping on by malicious actors it can be generated by either one of them but must belong to both of them before the messages start flowing suppose the message i am ready is

10:14 converted into ciphertext using a specific substitution cipher by paul in that case jane must also be aware of the substitution shift to decrypt the ciphertext once it reaches her irrespective of the scenario where someone manages to grab the ciphertext mid-transit to try and read the message not having the secret key renders everyone helpless looking to snoop in the symmetric key algorithms like the data encryption standard have been in use since the 1970s while the popular ones like the ees have become the industry standard today with the entire architecture of symmetric cryptography depending on the single key being used you can understand why it's of paramount importance to keep it secret on all occasions

11:00 the side effect of having a single key for the encryption and decryption is it becomes a single point of failure anyone who gets their hand on it can read all the encrypted messages and do so mainly without the knowledge of the sender and the receiver so it is the priority to keep the encryption and encryption key private at all times should it fall into the wrong hands the third party can send messages to either the sender or the receiver using the same key to encrypt the message upon receiving the message and decrypting it with the key it is impossible to guess its origin if the sender somehow transmits the secret key along with the cipher text anyone can intercept the package and access the information consequently this encryption category is termed private key cryptography since a big part of the data's integrity is

11:46 riding on the promise that the users can keep the key secret this terminology contrasts with asymmetry key cryptography which is called public key cryptography because it has two different keys at play one of which is public provided we managed to keep the key secret we still have to choose what kind of ciphers we want to use to encrypt this information in symmetric key cryptography there are broadly two categories of ciphers that we can employ let us have a look stream ciphers are the algorithms that encode basic information one bit at a time it can change depending on the algorithm being used but usually it's relies on a single bit or byte to do the encryption this is the relatively quicker alternative considering the algorithm

12:32 doesn't have to deal with blocks of data at a single time every piece of data that goes into the encryption can and needs to be converted into binary format in stream ciphers each binary digit is encrypted one after the other the most popular ones are the rc4 salsa and panama the binary data is passed through an encryption key which is a randomly generated bit stream upon passing it through we receive the ciphertext that can be transferred to the receiver without fear of man in the middle attacks the binary data can be passed through an algorithmic function it can have either x or operations as it is most of the time or any other mathematical calculations that have the singular purpose of scrambling the data the encryption key is generated using the random bitstream generator and it

13:18 acts as a supplement in the algorithmic function the output is in binary form which is then converted into the decimal or hexadecimal format to give our final ciphertext on the other hand block ciphers dissect the raw information into chunks of data of fixed size the size of these blocks depend on the exact cipher being used a 128-bit block cipher will break the plain text into blocks of 128 bit each and encrypt those blocks instead of a single digit once these blocks are encrypted individually they are chained together to form a final cipher text block ciphers are much slower but they are more tamper-proof and are used in some of the most widely used algorithms employed today

14:03 just like stream ciphers the original ciphertext is converted into binary format before beginning the process once the conversion is complete the blocks are passed through the encryption algorithm along with the encryption key this would provide us with the encrypted blocks of binary data once these blocks are combined we get a final binary string this string is then converted into hexadecimal format to get our ciphertext today the most popular symmetric key algorithms like aes des and 3des are all block cipher methodology subsets with so many factors coming into play there are quite a few things symmetrically cryptography excels at

14:49 while falling short and some other symmetric key cryptography is much faster variant when compared to asymmetric key cryptography there is only one key in play unlike asymmetric encryption and this drastically improves calculation speed in the encryption and decryption similarly the performance of symmetric encryption is much more efficient under similar computational limitations fewer calculations help in better memory management for the whole system bulk amounts of data that need to be encrypted are very well suited for symmetric algorithms since they are much quicker handling large amounts of data is simple and easy to use in servers and data forms this helps in better latency during data recall and fewer mixed packets

15:35 thanks to its simple single key structure symmetric key cryptography algorithms are much easier to set up a communication channel with and offer a much more straightforward maintenance duties once the secret key is transmitted to both the sender and receiver without any prior mishandling the rest of the system aligns easily and everyday communications becomes easy and secure if the algorithm is applied as per the documentation symmetric algorithms are very robust and can encrypt vast amounts of data with very less overhead we took a look at symmetric key cryptography we used a single private key for both the encryption and decryption of data and it works very well in theory let's take a look at a more realistic scenario now let's meet joe joe is a journalist who needs to

16:20 communicate with ryan via long distance messaging due to the critical nature of the information people are waiting for any message to leave joe's house so that they can intercept it now joe can easily use symmetric cryptography to send the encrypted data so that even if someone intercepts the message they cannot understand what it says but here's the tricky part how will joe send the required decryption key to ryan the sender of the message as well as the receiver need to have the same decryption key so that they can exchange messages otherwise ryan cannot decrypt the information even when he receives the cipher text if someone intercepts the key while transmitting it there is no use in employing cryptography since the third party can now decode all the information easily key sharing is a risk that will always

17:05 exist when symmetric key cryptography is being used thankfully asymmetric key encryption has managed to fix this problem let's understand what asymmetric key cryptography is asymmetric encryption uses a double layer of protection there are two different keys at play here a private key and a public key a public key is used to encrypt the information pre-transit and a private key is used to decrypt the data post transit these pair of keys must belong to the receiver of the message the public keys can be shared via messaging blog posts or key servers and there are no restrictions as you can see in the image the two keys are working in the system the sender first encrypts the message using the receiver's private key after

17:51 which we receive the ciphertext the ciphertext is then transmitted to the receiver without any other key on getting the ciphertext the receiver uses his private key to decrypt it and get the plain text back there has been no requirement of any key exchange throughout this process therefore solving the most glaring flaw faced in symmetric key cryptography the public key known to everyone cannot be used to decrypt the message and the private key which can decrypt the message need not be shared with anyone the sender and receiver can exchange personal data using the same set of keys as often as possible to understand this better take the analogy of your mailbox anyone who wants to send you a letter has access to the box and can easily share information with you

18:37 in a way you can say the mailbox is publicly available to all but only you have access to the key that can open the mailbox and read the letters in it this is how the private key comes to play no one can intercept the message and read its contents since it's encrypted once the receiver gets its contents he can use his private key to decrypt the information both the public key and the private key are generated so they are interlinked and you cannot substitute other private keys to decrypt the data in another example if alice wants to send a message to bob let's say it reads call me today she must use bob's public key while encrypting the message upon receiving the cipher message bob can proceed to use his private key in order to decrypt the message and hence

19:22 complete securities attained during transmission without any need for sharing the key since this type of encryption is highly secure it has many uses in areas that require high confidentiality it is used to manage digital signature so there is valid proof of a document's authenticity with so many aspects of business transitioning to the digital sphere critical documents need to be verified before being considered authentic and acted upon thanks to asymmetric cryptography senders can now sign documents with their private keys anyone who needs to verify the authenticity of such signatures can use the sender's public key to decrypt the signature since the public and the private keys are linked to each other mathematically

20:08 it's impossible to repeat this verification with duplicate keys document encryption has been made very simple by today's standards but the background implementation follows the stimulus approach in blockchain architecture asymmetry key cryptography is used to authorize transactions and maintain the system thanks to its two key structures changes are reflected across the blockchain's peer-to-peer network only if it is approved from both ends along with asymmetric key cryptography's tamper-proof architecture its non-repudiation characteristic also helps in keeping the network stable we can also use asymmetric key cryptography combined with symmetrical cryptography to monitor ssl or tls encrypted browsering sessions to make sure nobody can steal our personal information when accessing banking

20:54 websites or the internet in general it plays a significant role in verifying website server authenticity exchanging the necessary encryption keys required and generating a session using those keys to ensure maximum security instead of the rather insecure http website format security parameters differ on a session by session basis so the verification process is consistent and utterly essential to modern data security another great use of the asymmetric key cryptography structure is transmitting keys for symmetric key cryptography with the most significant difficulty in symmetric encryption being key exchange asymmetric keys can help clear the shortcoming the original message is first encrypted using a symmetric key the key used for encrypting the data is

21:40 then converted into the cipher text using the receiver's public key now we have two cipher text to transmit to the receiver on receiving both of them the receiver uses his private key to decrypt the symmetry key he can then use it to decrypt the original information on getting the key used to encrypt the data while this may seem more complicated than just asymmetric cryptography alone symmetric encryption algorithms are much more optimized for vast amounts of data on some occasions encrypting the key using asymmetric algorithms will definitely be more memory efficient and secure you might remember us discussing why symmetric encryption was called private key cryptography let us understand why asymmetric falls under the public key cryptography

22:25 we have two keys at our disposal the encryption key is available to everyone the decryption key is supposed to be private unlike symmetric key cryptography there is no need to share anything privately to have an encrypted messaging system to put that into perspective we share an email address with anyone looking to communicate with us it is supposed to be public by design so that our email login credentials are private and they help in preventing any data mishandling since there is nothing hidden from the world if they want to send us any encrypted information this category is called the public key cryptography with so many variables in play there must be some advantages that give asymmetrically cryptography an edge over the traditional symmetric encryption methodologies

23:11 let's go through some of them there is no need for any reliable key sharing channel in asymmetric encryption it was an added risk in private key cryptography that has been completely eliminated in public key architecture the key which is made public cannot recruit any confidential information and the only key that can decrypt doesn't need to be shared publicly under any circumstance we have much more extensive key lengths in rsa encryption and other asymmetric algorithms like 2048 bits key and 4096 bit keys larger keys are much harder to break into via brute force and are much more secure asymmetric key cryptography can use as a proof of authenticity since only the rightful owner of the keys can generate

23:57 the messages to be decrypted by the private key the situation can also be reversed encryption is done using a private key and decryption is done by the public key which would not function if the correct private key is not used to generate the message hence proving the authenticity of the owner it also has a tamper protection feature where the message cannot be intercepted and changed without invalidating the private key used to encrypt the data consequently the public key cannot decrypt the message and it is easy to realize the information is not 100 legitimate when and where the case requires before getting too deep into the topic let's get a brief overview of how hashing works hashing is the process of scrambling a piece of information or data beyond

24:43 recognition we can achieve this by using hash functions which are essentially algorithms that perform mathematical operations on the main plain text the value generated after passing the plaintext information through the hash function is called the hash value digest or in general just the hash of the original data while this may sound similar to encryption the major difference is hashes are meant to be irreversible no decryption key can convert a digest back to its original value however a few hashing algorithms have been broken due to the increase in computational complexity of today's new generation computers and processors there are new algorithms that stand the test of time and are still in news among multiple areas for password storage

25:29 identity verification etc like we discussed earlier websites use hashing to store the user's passwords so how do they make use of these hash passwords when a user signs up to create a new account the password is then run through the hash function and the resulting hash value is stored on the servers so the next time a user comes to login to the account the password he enters is passed to the same hash function and compared to the hash stored on the main server if the newly calculated hash is the same as the one stored on the website server the password must have been correct because according to hash functions terminology same inputs will always provide the same outputs if the hashes do not match then the

26:14 password entered during login is not the same as the password entered during the signup hence the login will be denied this way no plain text passwords get stored preventing both the owner from snooping on user data and protecting users privacy in the unfortunate event of a data breach or a hack apart from password storage hashing can also be used to perform integrity checks when a file is uploaded on the internet the files hash value is generated and it is uploaded along with the original information when a new user downloads the file he can calculate the digest of the downloaded file using the same hash function when the hash values are compared if they match then file integrity has been maintained and there has been no data

27:00 corruption since so much important information is being passed on to the hash function we need to understand how they work a hash function is a set of mathematical calculations operated on two blocks of data the main input is broken down into two blocks of similar size the block size is dependent on the algorithm that is being used hash functions are designed to be one way they shouldn't be reversible at least by design some algorithms like the previously mentioned md5 have been compromised but most secure algorithms are being used today like the sha family of algorithms the digest size is also dependent on the respective algorithm being used md5 has a digest of 128 bits while

27:47 srg-256 has a digest of 256 bits this digest must always be the same for the same input irrespective of how many times the calculations are carried out this is a very crucial feature since comparing the hash value is the only way to check if the data is untouched as the functions are not reversible there are certain requirements of a hash function that need to be met before they are accepted while some of them are easy to guess others are placed in order to preserve security in the long run the hash function must be quick enough to encrypt large amounts of data at a relatively fast pace but it also shouldn't be very fast running the algorithm on all cylinders makes the functions easy to boot force

28:33 and a security liability there must be a balance to allow the hash function to handle large amounts of data and not make it ridiculously easy to brute force by running through all the possible combinations the hash function must be dependent on each bit of the input the input can be text audio video or any other file extension if a single character is being changed it doesn't matter how small that character may be the entire digest must have a distinctly different hash value this is essential to create unique digest for every password that is being stored but what if two different users are using the same password since the hash function is the same for all users both the digest will be the same

29:18 this is called a hash collision you may think this must be a rare occasion where two users have exactly the same password but that is not the case we have techniques like salting that can be used to reduce these hash collisions as we will discuss later in this video you would be shocked to see the most used passwords of 2020. all of these passwords are laughably insecure and since many people use the same passwords repeatedly on different websites hash collisions risks are more common than one would expect let's say the hash functions find two users having the same password how can they store both the hashes without messing up the original data this is where salting and peppering come to play salting is the process of adding a

30:04 random keyword to the end of the input before it is passed on to the hash function this random keyword is unique for each user on the system and it is called the solved value or just the sort so even if two passwords are exactly the same the solved value will differ and so will their digest there is a small problem in this process though since the salt is unique for each user they need to be stored in the database along with the passwords and sometimes even in plain text to speed up the process of continuous verification if the server is hacked then the hashes will need to be brute forced which takes a lot of time but if they receive the salts as well the entire process becomes very fast this is something that peppering aims to solve

30:50 peppering is the process of adding a random string of data to the input before passing them to the hash function but this time the random string is not unique for each user it is supposed to be common for all users in the database and the extra bit added is called the pepper in this case the pepper isn't stored on the servers it is mostly hard coded onto the website source code since it's going to be the same for all credentials this way even if the servers get hacked they will not have the right pepper needed to crack into all the passwords many websites use a combination of salting and preparing to solve the problem of hash collision and bolster security since brute force takes such a long time many hackers avoid taking the effort the returns are mostly not worth it and the

31:36 possible combinations of using both salting and peppery is humongous in today's world the most widely used symmetric encryption algorithm is aes 256 that stands for advanced encryption standard which has a key size of 256 bit with 128 bit and 196 bit key sizes also being available other primitive algorithms like the data encryption standard that is the des the triple data encryption standard 3des and blowfish have all fallen out of favor due to the rise of aes the es algorithm stands for data encryption standard it is a symmetric key cipher that is used to encrypt and re-kept information and are blocked by block manner each block is encrypted individually and

32:22 they are later chained together to form our final cipher text which is then sent to a receiver des takes the original unaltered piece of data called the plain text in a 64-bit block and it is converted into an encrypted text that is called the ciphertext it uses 48-bit keys during the encryption process and follows a specific structure called the fiscal cipher structure during the entire process it is a symmetric key algorithm which means des can reuse the keys used in the encryption format to decrypt the cipher text back to the original plain text once the 64-bit blocks are encrypted they can be combined together before being transmitted let's take a look at the origin and the reason the es was founded das is based on a fiscal block cipher

33:09 called lucifer developed in 1971 by ibm cryptography researcher host vista des uses 16 rounds of the swisstal structure using a different key for each round it also utilizes a random function with two inputs and provides a single output variable the es became the organization's approved encryption standard in november 1976 and was later reaffirmed as our standard in 1983 1988 and finally in 1999 but eventually the es was cracked and it was no longer considered a secure solution for all official routes of communication consequently triple ds was developed triple res is a symmetric key block cipher that uses a double ds cipher encrypt with the first key delete

33:56 encryption with the second key and encrypt again with a third key there is also a variation of the two keys where the first and second key are duplicate of each other but triple ds was ultimately deemed too slow for the growing need for fast communication channels and people eventually fell back to using ds for encrypting messages in order to search for a better alternative a public wide competition was organized and helped cryptographers develop their own algorithm as a proposal for the next global standard this is where the rindyle algorithm came into play and was later credited to be the next advanced encryption standard for a long time des was the standard for data encryption for data security its rule ended in 2002 when finally the advanced encryption standard replaced

34:43 des as an acceptable standard following a public competition for a place to understand the structure of a fistal cipher we can use the following image as a reference the block being encrypted is divided into two parts one of which is being passed on to the function while the other part is xored with the function's output the function also uses the encryption key that differs for each individual round this keeps going on until the last step until where the right hand side and the left hand side are being swapped here we receive our final ciphertext for the decryption process the entire procedure is reversed starting from the order of the keys to the block sorting if the entire process is repeated in a reverse order we will eventually get

35:29 back our plain text and this simplicity helps the speed overall this was later detrimental to the efficiency of the algorithm hence the security was compromised a fiscal block cipher is a structure used to derive many symmetry block ciphers such as des which as we have discussed in our previous comment crystal cipher proposed a structure that implements substitution and permutation alternately so that we can obtain cipher text from the plain text and vice versa this helps in reducing the redundancy of the program and increases the complexity to combat brute force attacks the pistol cipher is actually based on the shannon structure that was proposed in 1945 the fistel cipher is the structure suggested by horst feistel

36:15 which was considered to be a backbone while developing many symmetric block ciphers the shannon structure highlights the implementation of alternate confusion and diffusion and like we already discussed the fiscal cipher structure can be completely reversed depending on the data however we must consider the fact that to decrypt the information by reversing the physical structure we will need the exact polynomial functions and the key orders to understand how the blocks are being calculated we take a plain text which is of 64-bit and it is later divided into two equal halves of 32-bit each in this the right half is immediately transferred to the next round to become the new left half of the second row the right hand is again passed off to a

37:02 function which uses an encryption key that is unique to each round in the fisted cipher whatever the function gives off as an output it is passed on as an xor input with the left half of the initial plain text the next output will become the right half of the second round for the plain text this entire process constitutes of a single round in the fiscal cipher taking into account what happens in a polynomial function we take one half of the block and pass it through an expansion box the work of the expansion box is to increase the size of the half from 32-bit to 48-bit text this is done to make the text compatible to a 48-bit keys we have generated beforehand

37:49 once we pass it through the xor function we get a 48-bit text as an output now remember a half should be of 32-bit so this 48-bit output is then later passed on to a substitution box this substitution box reduces its size from 48 bit to 32 bit output which is then later xor with the first half of the plain text a block cipher is considered the safest if the size of the block is large but large block sizes can also slow down encryption speed and the decryption screen generally the size is 64 bit sometimes modern block ciphers like aes have a 128 bit block size as well the security of the block server increases with increasing key size

38:36 but larger key sizes may also reduce the speeds of the process earlier 64-bit keys were considered sufficient modern ciphers need to use 128-bit keys due to the increasing complexity of today's computational standards the increasing number of rounds also increase the security of the block cipher similarly they are inversely proportional to the speed of encryption a highly complex round function enhances the security of the block cipher always we must maintain a balance between the speed and security the symmetric block cipher is implemented in a software application to achieve better execution speed there is no use of an algorithm it cannot be implemented in a real-life

39:21 framework that can help organizations to encrypt or decrypt the data in a timely manner now that we understand the basics of fiscal ciphers we can take a look at how des manages to run through 16 rounds of the structure and provide the cipher text at the end now that we understand the basics of crystal cybers we can take a look at how des manages to run through 16 rounds of this structure and provide a cipher text in simple terms ds takes the 64-bit plaintext and converts it into a 64-bit cipher text and since we are talking about these symmetric algorithms the same key is being used when it is decrypting the data as well we first take a 64-bit clip plain text and we pass it to an initial permutation

40:07 function the initial permission function has the job of dividing the block into two different parts so that we can perform fiscal recycler structures on it there are multiple rounds being procured in the ds algorithm namely 16 rounds of fiscal cipher structure each of these rounds will need keys initially we take a 56 bit cipher key but it is a single key we pass it on to a round key generator which generates 16 different keys for each single round that the fistal cipher is being run these keys are passed on to the rounds as 48 bits the size of these 48 bits case is the reason we use the substitution and permutation bonds in the polynomial functions of the special ciphers

40:52 when passing through all these rounds we reach round 16 but the final key is passed on from the round key generator and we get a final permutation in the final permutation the values are swapped and we get our final cipher text this is the entire process of des with 16 rounds of pistol servers encompassed in it to decrypt our cipher text back to the plain text we just have to reverse the process we did in the des algorithm and reverse the key order along with the functions this kind of simplicity is what gave des the bonus when it comes to speed but eventually it was detrimental to the overall efficiency of the program when it comes to security factors bes have five different modes of operation to choose from this one of those is electronic code book

41:38 each 64-bit block is encrypted and decrypted independently in the electronic code book format we also have cipher block chaining or the cbc method here each 64-bit block depends on the previous one and all of them use an initialization vector we have a cipher feedback block mechanism where the preceding ciphertext becomes the input for the encryption algorithm it produces a pseudo random output which in turn is xored with the plain text there is an output feedback method as well which is the same as cipher feedback except that the encryption algorithm input is the output from the preceding des a counter method has a different way of approach where each plaintext block is

42:24 xored with an encrypted counter the counter is then incremented for each subsequent block there are a few other alternatives to these modes of operation but the five mentioned above are the most widely used in the industry and recommended by cryptographers worldwide let's take a look at the future of des dominance of des ended in 2002 when the advanced encryption standard replaced the ds encryption algorithm as the accepted standard it was done by following a public competition to find a replacement nist officially withdrew the global acceptance standard in may 2005 although triple des has approved for some sensitive government information through 2030. nist also had to change the ds algorithm because its key length was too short

43:10 given the increased processing power of the new computers encryption power is related to the size of the queue and des found itself a victim of ongoing technological advances in computing we have received a point where 56 bit was no longer a challenge to the computers of tracking note that because ds is no longer the nist federal standard does not mean that it is no longer in use triple ds is still used today and is still considered a legacy encryption algorithm in our last video we saw how the data encryption standard also known as ds became the global standard for encryption and data security eventually with so much computing power growth the need for a stronger algorithm was necessary to safeguard our personal data as solid as des was the computers of

43:57 today could easily break the encryption with repeated attempts thereby rendering the data security helpless to counter this dilemma a new standard was introduced which was termed as the advanced encryption standard or the aes algorithm let's learn what is advanced encryption standard the aes algorithm also known as the raindial algorithm is a symmetric block cipher with a block size of 128 bits it is converted into cipher text using keys of 128 192 or 256 bits it is implemented in software and hardware throughout the world to encrypt sensitive data the national institute of standards and technology also known as nist started development on aes in 1997 when it was

44:45 announced the need for an alternative to the data encryption standard the new internet needed a replacement for des because of its small key size with increasing computing power it was considered unsafe against entire key search attacks the triple ds was designed to overcome this problem however it was deemed to be too slow to be deployed in machines worldwide strong cases were present by the mars rc6 serpent and the two fish algorithms but it was the rindal encryption algorithm also known as aes which was eventually chosen as the standard symmetric key encryption algorithm to be used its selection was formalized with the release of federal information processing standards publication 197 in the november of 2001. it was approved by

45:32 the u.s secretary of commerce now that we understand the origin of aes let us have a look at the features that make aes encryption algorithm unique the aes algorithm uses a substitution permutation or sp network it consists of multiple rounds to produce a ciphertext it has a series of linked operations including replacing inputs with specific outputs that is substitutions and others that involve bit shuffling which is permutations at the beginning of the encryption process we only start out with a single key which can be either a 128-bit key a 192-bit key or a 256-bit key eventually this one key is expanded to be used in multiple rounds throughout the encryption and the decryption cycle

46:19 interestingly aes performs all its calculations on byte data instead of bit data as seen in the case of the ds algorithm therefore aes treats 128 bits of a clear text block as 16 bytes the number of rounds during the encryption process depends on the key size that is being used the 128 bit key size fixes 10 rounds the 192 bit key size fixes 12 rounds and the 256 bit key holds 14 rounds a round key is required for each of these rounds but since only one key is input into the algorithm the single key needs to be expanded to get the key for each own including the round zero with so many mathematical calculations going on in the background there are

47:05 bound to be a lot of steps throughout the procedure let's have a look at the steps followed in aes before we move ahead we need to understand how data is being stored during the process of aes encryption everything in the process is stored in a 4 into 4 matrix format this matrix is also known as a state array and we'll be using these state arrays to transmit data from one step to another and from one round to the next round each round takes state arrow as input and gives a straight array as output to be transferred into the next round it is a 16 byte matrix with each cell representing one byte with each four bytes representing a word

47:50 so every state area will have a total of four words representing it as we previously discussed we take a single key and expand it to the number of rounds that we need the key to be used in let's say the number of rounds are n then the key has to be expanded to be used with n plus 1 rounds because the first round is the key 0 round let's say n is the number of rounds the key is expanded to n plus 1 rounds it is also a state array having 4 words in its vicinity every key is used for a single round and the first key is used as a round key before any round begins in the very beginning the plain text is

48:36 captured and passed through an xor function with the round key as a supplement this key can be considered the first key from the n plus 1 expanded set moving on the state array resulting from the above step is passed on to a byte substitution process beyond that there is a provision to shift rows in the state arrays later on the state array is mixed with a constant matrix to shuffle its column in the mix column segment after which we add the round key for that particular round the last four steps mentioned are part of every single round that the encryption algorithm goes through the state arrays are then passed from one round to the next as an input

49:22 in the last round however we skip the mix columns portion with the rest of the process remaining unchanged but what are these byte substitution and row shifting processes let's find out regarding each step in more detail in the first step the plain text is stored in a state array and is absorbed with the k0 which is the first key in the expanded key set this step is performed only once on a block while being repeated at the end of each round as per iteration demands the state array is xored with the key to get a new state array which is then passed off as input to the sub bytes process in the second stage we have byte substitution we leverage an xbox called as a

50:08 substitution box to randomly switch data among each element every single byte is converted into a hexadecimal value having two parts the first part denotes the row value and the second part denotes the column value the entire state array is passed through the s box to create a brand new state array which is then passed off as an input to the row shifting process the 16 input bytes are replaced by looking at a fixed table given in the design we finally get a matrix with four rows and four columns when it comes to row shifting each bit in the four rows of the matrix is shifted to the left an entry that is a falloff is reinserted to the right of the line the change is done as follows

50:54 the first line is not moved in any way the second line is shifted to a single position to the left the third line is shifted two positions to the left and the fourth line is shifted three positions to the left the result is a new matrix that contains the same 16 bytes but has been moved in relation to each other to boost the complexity of the program in mixed columns each column of 4 bytes is now replaced using a special mathematical function the function takes 4 bytes of a column as input and outputs 4 completely new bytes we will get a new matrix with the same size of 16 bytes and it should be noted that this phase has not been done in the last round of the iteration

51:42 when it comes to adding a round key the 16 bytes of the matrix are treated as 128 bits and the 128 bits of the round key are exot if it is the last round the output is the cipher text if you still have a few rounds remaining the resulting 128 bits are interpreted as 16 bytes and we start another similar round let's take an example to understand how all these processes work if our plain text is the string 2 1 9 2 we first convert it into a hexadecimal format as follows we use an encryption key which is that's my kungfu and it is converted into a hexadecimal format as well as per the guidelines we use a single

52:27 key which is then later expanded into n plus 1 number of keys in which case is supposed to be 11 keys for 10 different rounds in round 0 we add the round key the plain test is xor with the k0 and we get a state array that is passed off as an input to the substitution by its process when it comes to the substitution bytes process we leverage an s box to substitute the elements of each byte with a completely new byte this way the state array that we receive is passed off as an input to the row shifting process on the next step when it comes to row shifting each element is shifted a few places to the

53:14 left with the first two being shifted by zero places second row by one place third row by two places and the last by three the state array that we received from the row shifting is passed off as an input to mix columns in mixed columns we multiply the straight array with a constant matrix after which i receive a new state array to be passed on onto the next step we add the name state array as an xor with the round key of the particular iteration whatever state array we receive here it becomes an output for this particular round now since this is the first round of the entire encryption process the state

54:00 array that we receive is passed off as an input to the new round we repeat this process for 10 more rounds and we finally receive a ciphertext once the final state array can be denoted in the hexadecimal format this becomes our final ciphertext that we can use for transferring information from the sender and receiver let's take a look at the applications of aes in this world aes finds most use in the area of wireless security in order to establish a secure mode of authentication between routers and clients highly secure mechanisms like wpa and wpa2 psk are extensively used in

54:46 securing wi-fi endpoints with the help of rindel's algorithm it also helps in ssl tls encryption that is instrumental in encrypting our internet browser sessions aes works in tandem with other asymmetric encryption algorithms to make sure the web browser and web server are properly configured and use encrypted channels for communication aes is also prevalent in general file encryption of various formats ranging from critical documents to the media files having a large key allows people to encrypt media and decrypt data with maximum security possible aes is also used for processor security in hardware appliances to prevent machine hijacking among other things

55:34 as a direct successor to the des algorithm there are some aspects that aes provides an immediate advantage in let us take a look when it comes to key length the biggest flaw in ds algorithm was its small length was easily vulnerable by today's standards aes has managed to nab up 128 192 and 256 bit key lens to bolster the security further the block size is also larger in aes leaving to more complexity of the algorithm the number of rounds in des is fixed irrespective of the plain text being used in aes the number of round depends on the key length that is being used for the particular iteration thereby providing more randomness and complexity

56:21 in the algorithm the ds algorithm is considered to be simpler than aes even though aes beats des when it comes to relative speed of encryption and decryption this makes advanced encryption standard much more streamlined to be deployed in frameworks and systems worldwide when it compares to the data encryption standard if getting your learning started is half the battle what if you could do that for free visit scale up by simply learn click on the link in the description to know more with the decline of symmetric encryption algorithms or private message encryption new cypher suits came into light the glaring issue with symmetric algorithms was key exchange having to pass secret keys is a risk on

57:06 its own right and that we were unable to solve in a lot of scenarios thankfully ds algorithm has managed to solve this problem the use cases for this cipher is rather niche but crucial nonetheless let's understand what digital signatures are before moving on to the algorithm the objective of digital signatures is to authenticate and verify documents and data this is necessary to avoid tampering and digital modification or forgery of any kind during the transmission of official documents they work on the public key cryptography architecture with one exception typically an asymmetric key system encrypts using a public key and decrypts the private key for digital signatures however the

57:52 reverse is true the signature is encrypted using a private key and is decrypted with the public key because the keys are inked together decoding it with the public key verifies that the proper private key was used to sign the document therefore verifying the signature's provenance let's go through each step to understand the procedure thoroughly in step 1 we have m which is the original plain text message and it has passed on to a hash function denoted by h to create a digest next it bundles the message together with the hash digest and encrypts it using the sender's private key it sends the encrypted bundle to the

58:37 receiver who can decrypt it using the sender's public key once the message is decrypted it is passed through the same hash function h hash to generate a similar digest it compares the newly generated hash with the bundled hash value received along with the message if they match it verifies data integrity in many instances they provide a layer of validation and security messages through non-secure channel properly implemented a digital signature gives the receiver reason to believe that the message was sent by the claimed sender digital signatures are equivalent to traditional handwritten signatures in many respects but properly implemented digital signatures are more difficult to

59:22 forge than the handwritten type digital signature schemes in the sense used here are cryptographically based and must be implemented properly to be effective they can also provide non-repudiation meaning that the signer cannot successfully claim that they did not sign a message while also claiming their private key remains secret further some non-repudiation schemes offer a timestamp for the digital signature so that even if the private key is exposed the signature is valid to implement the concept of digital signature in real world we have two primary algorithms to follow the rsa algorithm and the dsl algorithm but the latter is a topic of learning today so let's go ahead and see what the digital signature algorithm is supposed

1:00:09 to do digital signature algorithm is fips standard which is a federal information processing standard for digital signatures it was proposed in 1991 and globally standardized in 1994 by the national institute of standards and technology also known as the nist it functions on the framework of modular exponential and discrete logarithmic problems which are difficult to compute as a force brute system unlike dsa most signature types are generated by signing message digest with the private key of the originator this creates a digital thumbprint of the data since just the message digest is signed the signature is generally much smaller compared to the data that was saying

1:00:55 as a result digital signatures impose less load on processors at the time of signing execution and they use small volumes of bandwidth dsa on the other hand does not encrypt message digest using private key or dkip message digest using public key instead it uses mathematical functions to create a digital signature consisting of two 160 bit numbers which are originated from the message digest and the private key dc's make use of the public key for authenticating the signature but the authorization process is much more complicated when compared with rsa dsa also provides three benefits which is the message authentication integrity verification and non-repardiation in the image we can see the entire

1:01:41 process of dsf validation a plain text message is passed on to a hash function where the digest is generated which is passed on to a signing function signing function also has other parameters like a global variable g of random variable k and the private key of the sender the outputs are then bundled onto a single pack with the plain text and sent to the receiver the two outputs we receive from the signing functions are the two 160 bit numbers denoted by s and r on the receiver end we pass the plain text to the same hash function to regenerate the message digest it is passed on to verification function which has other requirements such as the public key of the sender global variable

1:02:28 g and snr received from the sender the value generated by the function is then compared to r if they match then the verification process is complete and data integrity is verified this was an overview of the way the dsa algorithm works you already know it depends on logarithmic functions to calculate the outputs so let us see how we can do the same in our next section we have three phases here the first of which is key generation to generate the keys we need some prerequisites we select a queue which becomes a prime divisor we select a prime number p such that p minus 1 mod q equal to 0

1:03:13 we also select a random integer g which must satisfy the two formulas being mentioned on the screen right now once these values are selected we can go ahead with generating the keys the private key can be denoted by x and it is any random integer that falls between the bracket of 0 and the value of q the public key can be calculated as y equal to g to the power x mod p where y stands for the public key the private key can then be packaged as a bundle which comprises of values of p q g and x similarly the public key can also be packaged as a bundle having the values of p q g and y once we are done with key generation we

1:04:00 can start verifying the signature and this generation repeat once the keys are generated we can start generating the signature the message is passed through a hash function to generate the digest h first we can choose any random integer k which falls under the bracket of 0 and q to calculate the first 160 bit number of assigning function of r we use the formula g to the power k mod p into mod cube similarly to calculate the value of the second output that is s we use the following formula that is shown on the screen the signature can then be packaged as a bundle having r and s this bundle along with a plain text

1:04:47 message is then passed on to the receiver now with the third phase we have to verify the signature we first calculate the message i just received in the bundle by passing it to the same hash function we calculate the value of w u1 and u2 using the formulas shown on the screen we have to calculate a verification component which is then to be compared with the value of r being sent by the sender this verification component can be calculated using the following formula once calculated this can be compared with the value of r if the values match then the signature verification is successful and the entire process is complete starting from key generation to the signature generation all the way up

1:05:33 to the verification of the signature with so many steps to follow we are bound to have a few advantages to boot this and we would be right to think so dsa is highly robust in the security and stability aspect when compared to alternative signature verification algorithms we have a few other ciphers that aim to achieve the simplicity and the flexibility of dsa but it has been a tough ask for all the other suits key generation is much faster when compared to the rsa algorithm and such while the actual encryption and decryption process may falter a little in comparison a quicker start in the beginning is well known to optimize a lot of frameworks

1:06:19 dsa requires less storage space to work its entire cycle in contrast its direct correspondent that is rsa algorithm needs a certain amount of computational and storage space to function efficiently this is not the case with dsl which has been optimized to work with weaker hardware and lesser resources the dsa is patented but nist has made this pattern available worldwide royalty free a draft version of the speculation fips1865 indicates that dsa will no longer be approved for digital signature generation but it may be used to verify signatures generated prior to the implementation date of that standard the rsa algorithm can be used for general data encryption and decryption as well functioning on a similar public key

1:07:06 cryptography architecture it is seen as a more complex solution to bolster security so let's go ahead and see what the rsa algorithm is supposed to do the rsa algorithm is a public key signature algorithm developed by ron

…

Share

More video summaries