Secure Hash Algorithms Using Python- SHA256,SHA384,SHA224,SHA512,SHA1- Hashing In BlockChain
Key Takeaways
Explains secure hash algorithms using Python, including SHA256, SHA384, SHA224, SHA512, and SHA1, and their application in blockchain
Full Transcript
hello all my name is krishnak and welcome to my youtube channel so guys today in this particular video we are going to discuss about check your hash algorithm we also say it as sha okay and this algorithm is the base of blockchain this algorithm is mostly used in blockchain for some specific use case over there uh i'll tell you i'll show you some of the examples with respect to that also and this algorithm is pretty much amazing guys because if we take some information and if we try to apply a hashing algorithm onto it it is very very difficult to crack you know you cannot just again come back with the same information again uh we'll be discussing about that what are the properties of this kind of hash algorithms and all before that let's see some example with respect to this so here we have amazing github link from handles94 so over here uh this person is actually shown a blockchain demo you know from this particular url this url is also available over here you can just click over here and you can see this this is an amazing algorithm uh and they are different kind of secure hash algorithm we say something like shah 256 we have sha 384 shah 224 shah 512 sha1 okay i'll just tell you one example of shah 256 white is basically called as 256 and just by understanding this you'll be able to understand why do we call this algorithm as short 384 224 512 and many more right so we're going to discuss about all these kind of algorithms and we will also see how we can implement it with the help of python programming language now let's proceed without wasting any time now first of all i'll just go to this particular demo and show it to you right now default nothing no information is present inside this particular data and here you can see that there is a default uh hash key okay and this is basically implemented by sha 256 now why this is called as sha 256 i'll just tell you an example before going ahead with respect to this particular video this video has been sponsored by an academy so an academy has come up with is java average 2.0 c plus average 2.0 and python average 2.0 which are complete courses in competitive programming if you really want to know more about this particular thing this is nothing but a 10-month batch course which will give a learner the end-to-end subject matter expertise required to get placed in fan companies create tech products from scratch and crack international coding context here you can also see all the topics from intermediate to beginner to advanced advanced courses will be added soon but here you can see all the topics like o and square sorting algorithm merson counting inversion and many more like this you can also check out the complete schedule with respect to this one more interesting thing about it this is that guys you will be able to see that the instructor that is via bunsel uh deeper gore arjun arul and sanket singh chakraborty they are working in some amazing product based companies which will definitely help you to guide towards competitive programming and crack interview jobs if you are going ahead with the six to six to six months to 12 month subscription you'll also get an attempt to add code chef's dsa exam and if you're planning to take up the subscription guys please do use kn06 code so that you'll be able to get 10 off from this particular subscription so if you really want to find out more information regarding this all the information will be given in the description of this particular video please go ahead and check it out now suppose i'll write krish over here now as soon as i write krish over here you see that the entire information has been changed now what happens is that if i try to just add one character you'll be able to see that this entire thing will change okay so see this if i write krish 1 everything each and every character is basically getting changed in this particular algorithm so it is very very difficult to crack you know and this technique is also called as adventure effect now elementary effect basically means that whenever i just change the data with something like with at least a additional character like comma or full stop you'll be able to see that this entire character is basically cheating change and why do we call it as sha256 why is this 256 coming over here understand guys over here the total number of characters that you'll be able to see over here if you count it it is somewhere around 64 characters and each character is basically represented by four bytes right so when i say four bytes you can see that four into eight is nothing but 32 bits so each character is basically stored in 32 bits if you want to take an example of 256 see each character is represented by four bytes four multiplied by uh 64 it is nothing but 256 right so 256 characters over here sorry 64 characters over here each character is being represented by four bytes and each byte is represented by 8 bits so each character internal storage will be somewhere around 32 bit so that is the reason why we call it as 256 okay again let me repeat it you can see the total number of characters over here are 64 characters each character is basically having 4 bytes so 4 into 64 is nothing but 256 right so all this particular information similarly if you go with sha 5 to l then again the number of characters will be changing with respect to this now let me just show you some more example if i try to write more information you can see that uh the entire information is changed now see this i'll write one okay one or just let me write uh something like child okay so child over here you can see that this is the hash key here you can see the characters are like ddc ending with 9 a3 now if i just try to add only one character the entire information is changing and this is called as adventure effect this is the base in the blockchain because if i take an example here you can see the blockchain demo also if i click on the block over here this is how a blockchain is represented in my blockchain you know a blockchain is nothing but it is a combination of blocks okay again we are not detailedly discussing about blockchain probably i'll create a separate playlist for that but if you really want to understand about blockchain blockchain is nothing but it is a growing chain of blocks okay and inside the blocks you have like block sequence number you have nonce number used or number once used something like that it is uh here you it is we basically say it has nonce then here you have the data in this particular data and then you actually create this hash key okay when you basically mine a block you know it is basically you're creating a new hash key and this hash key is basically generated by using this sha 256 uh shah 256 algorithm okay but again i'll be discussing more about it in my problem in my blockchain playlist but the thing that i really want to show you over here is that we'll try to see how to implement this shah 256 shah 384 shah 224 and all with the help of python okay so to begin with first of all what i'm going to do is that i'm going to import hash lib here this is the library that will be having all the shah algorithms right what is the shah algorithm it is nothing but secure hash algorithms and different different algorithms are there like you have shot of 56 384 224 52 l and char so first of all i'm just going to write a string so i'm writing a string over here as krishnayak now if i really want to apply a sha algorithm into this so first of all what are the process of hashing first of all we need to encode this entire string in order to encode it what i have done is that i've just written str1 dot encode right and then i'm using hash lib.256 dot uh sha256.256 is basically my hashing function and this will basically convert that into 64 uh characters like how we have actually converted over here okay so here you can basically write over here hash lib.shar256 htr one dot encode and once i print this hashed value here it will show that okay this is basically my hash object at this specific memory location now if it is present in this specific memory location if i really want to see that particular hash key i have to convert this into hexadecimal in order to convert this into hexadecimal we used a inbuilt function inside this hash value which is called as hex digest now once i use this you will be able to see that it will be creating this kind of 64 characters so once i execute it here you can see this one now probably i just want to change the string with my one value if i execute now and if i execute this hex digest now you'll be seeing that the entire value will be changing okay entire value but the length will be almost same because we are using shard 256 right similarly if i try to apply with sha 384 now just our interview question for you in sha 384 you know when we say 384 just imagine that what will be the length of this particular string that is getting then generated and probably see every every uh character over here is having four bytes right so four multiplied by something will be 384 and that will basically be the length and probably i think four multiplied by uh four times at 36 if i if i say uh the length of this will be 96 characters if you don't believe me just see this guys i'll write length off value dot hex digest and in order to apply sha 284 i'll again use this hash slip and use this sha 384 okay 384 is again an inbuilt function which will be converting this into a hashing algorithm by using this technique and then if i execute it now you can see the length of this is 96. so 96 multiplied by 4 is nothing but 384 right so here i'm just going to execute and if i really want to see the value here you are having the entire value here similarly with respect to sha 224 now you can also subject that how much what will be the length of this if you want to apply this all you have to do is that hash lib dot sha 224 you just have to write and you will be getting and then you have sha 52 l again phi 2 l is also there now where is this kind of sha algorithms getting used sha algorithms may be getting used in different different uh blockchain technology probably in ethereum we may be using a different one probably uh in ripple we may be using a different one so different kind of hashing algorithms are used in different different things if you want to consider the example of blockchain and bitcoin uh right now you know bitcoin price is like peak it's going up uh so there it is basically it's the sha 256 is being used okay so this was some example probably if you really want to send some information by using this hashing algorithm also you can do it because it is available completely with the help of python so all these information github will be provided in the github ring and yes i'll be showing you some of the examples of blockchain how to create a blockchain with the help of python now because of the sha algorithm right yoga guys companies are using python also for creating blockchain technologies you know tomorrow if you have an idea and probably want to do it yes you can also definitely use python programming language for this because you have this kind of hashing algorithm available one example of blockchain mining if you really want to see suppose this is my information probably uh krish wants to send his friend um because inside this you know inside a blockchain their data that is getting captured is basically called as transaction don't worry i'll probably try to create uh so i i want to probably send 250 bitcoins i'm just telling you an example okay so this is the transaction that has been getting captured in the data i'll probably create a very good playlist on blockchain and once i click on mine so after mining right it will try to find out the suitable hash key unless currently don't find a suitable hash key this blockchain will not be mined so once it gets successfully mined the miner will be getting bitcoins in rewards you know it will be getting bitcoins in reward apart from this this transaction will also happen okay and this entire block will be added to the blockchain once it is mined successfully so there are a lot of things that we need to discuss about blockchain so which i will probably create a playlist for that but i hope you got an idea about shah that is secure hash algorithms you can use it for various purpose uh whichever you like so in this video we have seen sha 256 chart 384 224 52 and sha one show one also if you want to use it all you have to do is that just copy this paste it over here instead of writing sha 5 to l you can basically write sha 1 and here is basically your entire key or the hash key that is basically you think generate so i hope you like this video please do subscribe the channel if you're not already subscribe i'll see you in the next video have a great day thank you bye
Original Description
github: https://github.com/krishnaik06/SHA-Algorithms-Blockchain
(Java) Everest 2.0 - Complete Course in Competitive Programming: https://unacademy.com/batch/java-everest-20-complete-course-in-competitive-programming/RFHYYL0I
(C++) Everest 2.0 - Complete Course in Competitive Programming: https://unacademy.com/batch/c-everest-20-complete-course-in-competitive-programming/N10W1V8S
(Python) Everest 2.0 - Complete Course in Competitive Programming: https://unacademy.com/batch/python-everest-20-complete-course-in-competitive-programming/P67NL1DE
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for a few months and I love it! https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=krishnaik&utm_content=description-only
All Playlist In My channel
Interview Playlist: https://www.youtube.com/playlist?list=PLZoTAELRMXVM0zN0cgJrfT6TK2ypCpQdY
Complete DL Playlist: https://www.youtube.com/watch?v=9jA0KjS7V_c&list=PLZoTAELRMXVPGU70ZGsckrMdr0FteeRUi
Julia Playlist: https://www.youtube.com/watch?v=Bxp1YFA6M4s&list=PLZoTAELRMXVPJwtjTo2Y6LkuuYK0FT4Q-
Complete ML Playlist :https://www.youtube.com/playlist?list=PLZoTAELRMXVPBTrWtJkn3wWQxZkmTXGwe
Complete NLP Playlist:https://www.youtube.com/playlist?list=PLZoTAELRMXVMdJ5sqbCK2LiM0HhQVWNzm
Docker End To End Implementation: https://www.youtube.com/playlist?list=PLZoTAELRMXVNKtpy0U_Mx9N26w8n0hIbs
Live stream Playlist: https://www.youtube.com/playlist?list=PLZoTAELRMXVNxYFq_9MuiUdn2YnlFqmMK
Machine Learning Pipelines: https://www.youtube.com/playlist?list=PLZoTAELRMXVNKtpy0U_Mx9N26w8n0hIbs
Pytorch Playlist: https://www.youtube.com/playlist?list=PLZoTAELRMXVNxYFq_9MuiUdn2YnlFqmMK
Feature Engineering :https://www.youtube.com/playlist?list=PLZoTAELRMXVPwYGE2PXD3x0bfKnR0cJjN
Live Projects :https://www.youtube.com/play
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Krish Naik · Krish Naik · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Natural Language Processing|Stemming
Krish Naik
Natural Language Processing|BagofWords
Krish Naik
Gaussian distribution or Normal Distribution in statisctics
Krish Naik
Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Krish Naik
Log Normal Distribution in Statistics
Krish Naik
Covariance in Statistics
Krish Naik
Confusion matrix, Precision, Recall| Data Science Interview questions
Krish Naik
Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Krish Naik
Implementing a Spam classifier in python| Natural Language Processing
Krish Naik
Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Krish Naik
Face Recognition using open CV and VGG 16 Transfer Learning
Krish Naik
Pedestrian Detection using OpenCV from Videos
Krish Naik
Face and Eye Detection from Videos using HAAR Cascade Classifier
Krish Naik
Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Krish Naik
OpenCV Installation | OpenCV tutorial
Krish Naik
Face and Eye Detection from Images using HAAR Cascade Classifier
Krish Naik
Car Detection using HAAR Cascade and Opencv from Videos.
Krish Naik
Using OpenFace for Face recognition in Keras
Krish Naik
OpenPose Tutorial with Tensorflow
Krish Naik
Multiple Linear Regression using python and sklearn
Krish Naik
Dimensional Reduction| Principal Component Analysis
Krish Naik
Movie Recommender System using Python
Krish Naik
TPR,FPR,FNR,TNR, Confusion Matrix
Krish Naik
Precision, Recall and F1-Score
Krish Naik
Artificial Neural Network for Customer's Exit Prediction from Bank
Krish Naik
GridSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
RandomizedSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
K Nearest Neighbor classification with Intuition and practical solution
Krish Naik
K Means Clustering Intuition
Krish Naik
Create custom Alexa Skill- Lambda function- Part2
Krish Naik
Hierarchical Clustering intuition
Krish Naik
Implement Transfer Learning with a generic Code Template
Krish Naik
Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Krish Naik
Unlock Your Application With Your Face using OpenCV
Krish Naik
Draw rectangle from webcam and sketch process it on a live feed
Krish Naik
Complete Life Cycle of a Data Science Project
Krish Naik
How we can apply Machine Learning in Finance
Krish Naik
Deep Learning in Medical Science
Krish Naik
How to switch your career to Data Science.
Krish Naik
Linear Regression Mathematical Intuition
Krish Naik
Handle Categorical features using Python
Krish Naik
Machine Learning Algorithm- Which one to choose for your Problem?
Krish Naik
DBSCAN Clustering Easily Explained with Implementation
Krish Naik
Curse of Dimensionality Easily explained| Machine Learning
Krish Naik
Feature Selection Techniques Easily Explained | Machine Learning
Krish Naik
Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Krish Naik
Cross Validation using sklearn and python | Machine Learning
Krish Naik
Handling Missing Data Easily Explained| Machine Learning
Krish Naik
Deploy Machine Learning Model using Flask
Krish Naik
Deployment of Deep Learning Model using Flask
Krish Naik
How to Visualize Multiple Linear Regression in python
Krish Naik
K Nearest Neighbour Easily Explained with Implementation
Krish Naik
Predicting Heart Disease using Machine Learning
Krish Naik
Predicting Lungs Disease using Deep Learning
Krish Naik
Stock Sentiment Analysis using News Headlines
Krish Naik
Random Forest(Bootstrap Aggregation) Easily Explained
Krish Naik
Voting Classifier(Hard Voting and Soft Voting Classifier)
Krish Naik
Credit Card Fraud Detection using Machine Learning from Kaggle
Krish Naik
Hyperparameter Optimization for Xgboost
Krish Naik
Tutorial 45-Handling imbalanced Dataset using python- Part 1
Krish Naik
More on: Algorithm Basics
View skill →
🎓
Tutor Explanation
DeepCamp AI