title
Python Encryption Tutorial with PyCrypto
description
Sentdex.com
Facebook.com/sentdex
Twitter.com/sentdex
How to use python to encrypt sensitive information, and later decrypt it, using PyCrypto!
PyCrypto: https://www.dlitz.net/software/pycrypto/
The Code: http://sentdex.com/sentiment-analysisbig-data-and-python-tutorials/encryption-and-decryption-in-python-code-example-with-explanation/
detail
{'title': 'Python Encryption Tutorial with PyCrypto', 'heatmap': [{'end': 913.587, 'start': 868.812, 'weight': 1}, {'end': 1177.528, 'start': 1154.6, 'weight': 0.845}], 'summary': 'Tutorial covers python encryption using pycrypto and 7zip, provides a guide for installing pycrypto, explains aes encryption and key sizes, explores padding in encryption, and discusses aes encryption for function abstraction, catering to beginners and emphasizing practical implementation.', 'chapters': [{'end': 67.953, 'segs': [{'end': 27.68, 'src': 'embed', 'start': 0.265, 'weight': 2, 'content': [{'end': 5.368, 'text': 'Hello, and welcome to my tutorial on encryption with Python.', 'start': 0.265, 'duration': 5.103}, {'end': 9.19, 'text': 'Someone made a request for this video, so I went ahead and made it.', 'start': 5.388, 'duration': 3.802}, {'end': 12.932, 'text': "It's going to be a little bit longer than most of the videos.", 'start': 10.11, 'duration': 2.822}, {'end': 14.213, 'text': 'By a little bit, I mean a lot of it.', 'start': 13.012, 'duration': 1.201}, {'end': 19.195, 'text': "Simply because there's a lot of information to pass on with this.", 'start': 15.473, 'duration': 3.722}, {'end': 24.578, 'text': "And I can't really make it in chunks because it kind of needs to be all together.", 'start': 20.676, 'duration': 3.902}, {'end': 27.68, 'text': "So if you don't like long tutorials, I'm sorry.", 'start': 24.678, 'duration': 3.002}], 'summary': 'Tutorial on encryption with python, longer video due to a lot of information.', 'duration': 27.415, 'max_score': 0.265, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g265.jpg'}, {'end': 67.953, 'src': 'embed', 'start': 43.11, 'weight': 0, 'content': [{'end': 50.075, 'text': 'this is the website for pi crypto, which is probably the most popular encryption tool with python.', 'start': 43.11, 'duration': 6.965}, {'end': 52.176, 'text': 'i would just download the latest version.', 'start': 50.075, 'duration': 2.101}, {'end': 58.389, 'text': "you just click here and you'll download the tarball If you don't have.", 'start': 52.176, 'duration': 6.213}, {'end': 59.689, 'text': "I'm not really talking too much about this.", 'start': 58.389, 'duration': 1.3}, {'end': 65.792, 'text': "If you don't have anything to extract the tarball with, you can use a program called 7zip.", 'start': 59.709, 'duration': 6.083}, {'end': 67.953, 'text': "It's like 7-zip or something like that.", 'start': 65.852, 'duration': 2.101}], 'summary': 'Pi crypto is a popular encryption tool with python. download the latest version and use 7-zip to extract the tarball.', 'duration': 24.843, 'max_score': 43.11, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g43110.jpg'}], 'start': 0.265, 'title': 'Python encryption tutorial', 'summary': 'Explores encryption with python, highlighting the use of pi crypto and 7zip for tarball extraction.', 'chapters': [{'end': 67.953, 'start': 0.265, 'title': 'Python encryption tutorial', 'summary': 'Explores encryption with python, emphasizing the need for encryption software like pi crypto and mentioning the use of a program called 7zip for extracting the tarball.', 'duration': 67.688, 'highlights': ['The chapter emphasizes the need for encryption software like pi crypto for Python, which is mentioned as the most popular encryption tool with python.', 'It mentions the use of a program called 7zip for extracting the tarball.', 'The tutorial is longer than most videos due to the complexity and volume of information to be covered.', 'The speaker addresses the potential length of the tutorial, acknowledging that it may not be suitable for those who prefer shorter content.']}], 'duration': 67.688, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g265.jpg', 'highlights': ['The chapter emphasizes the need for encryption software like pi crypto for Python, the most popular encryption tool with python.', 'It mentions the use of a program called 7zip for extracting the tarball.', 'The tutorial is longer than most videos due to the complexity and volume of information to be covered.', 'The speaker addresses the potential length of the tutorial, acknowledging that it may not be suitable for those who prefer shorter content.']}, {'end': 328.053, 'segs': [{'end': 181.092, 'src': 'embed', 'start': 116.331, 'weight': 0, 'content': [{'end': 121.453, 'text': "So now that you're on desktop, I've got PyCrypto on my desktop.", 'start': 116.331, 'duration': 5.122}, {'end': 124.515, 'text': "So I'm going to say cd into PyCrypto.", 'start': 121.473, 'duration': 3.042}, {'end': 127.636, 'text': "It's like a file folder basically for PyCrypto.", 'start': 125.015, 'duration': 2.621}, {'end': 132.598, 'text': "What did I do wrong? Oh, we didn't have the y there.", 'start': 127.656, 'duration': 4.942}, {'end': 136.874, 'text': 'Py, pie crypto.', 'start': 133.499, 'duration': 3.375}, {'end': 142.356, 'text': "there we go, and so once you're in the pie crypto folder,", 'start': 136.874, 'duration': 5.482}, {'end': 149.237, 'text': "you should see like a bunch of stuff in that folder like this is the folder here you've got billable all this stuff and if you scroll down,", 'start': 142.356, 'duration': 6.881}, {'end': 150.598, 'text': "here's a setup.py.", 'start': 149.237, 'duration': 1.361}, {'end': 156.659, 'text': "that's the file that will basically set up whatever install that you want to do,", 'start': 150.598, 'duration': 6.061}, {'end': 163.518, 'text': 'and so the way that you do that is you just you type in python setup setup.py and then install.', 'start': 156.659, 'duration': 6.859}, {'end': 166.14, 'text': "Now I've already installed it myself, so I'm not going to do it,", 'start': 163.538, 'duration': 2.602}, {'end': 173.666, 'text': 'but then you would just hit enter here and that will install PyCrypto and really any other import that has setup.py in it.', 'start': 166.14, 'duration': 7.526}, {'end': 179.831, 'text': "Once you've got it installed and downloaded from here, generally you're going to.", 'start': 174.367, 'duration': 5.464}, {'end': 181.092, 'text': "well, first I'll teach you how to do it.", 'start': 179.831, 'duration': 1.261}], 'summary': 'Installing pycrypto using setup.py on desktop.', 'duration': 64.761, 'max_score': 116.331, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g116331.jpg'}, {'end': 258.445, 'src': 'embed', 'start': 231.053, 'weight': 4, 'content': [{'end': 238.594, 'text': "There's symmetric key algorithms, and this is where you have the same key for encryption and decryption, which is what AES has.", 'start': 231.053, 'duration': 7.541}, {'end': 246.436, 'text': "And then there's also asymmetric key algorithms where you have one key for encrypting and then one key for decrypting.", 'start': 239.435, 'duration': 7.001}, {'end': 258.445, 'text': 'Generally the more accepted version of encryption is indeed AES and you want 128-bit encryption, just for the record.', 'start': 248.699, 'duration': 9.746}], 'summary': 'Aes is the preferred 128-bit symmetric key algorithm for encryption.', 'duration': 27.392, 'max_score': 231.053, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g231053.jpg'}, {'end': 328.053, 'src': 'embed', 'start': 282.367, 'weight': 5, 'content': [{'end': 285.872, 'text': 'Basically encodings for putting data in a specific format.', 'start': 282.367, 'duration': 3.505}, {'end': 288.729, 'text': 'so it can be recognized.', 'start': 287.728, 'duration': 1.001}, {'end': 291.171, 'text': "It's kind of like you convert something to a string or something.", 'start': 288.909, 'duration': 2.262}, {'end': 293.853, 'text': 'It needs to be in a specific format to be read by something.', 'start': 291.351, 'duration': 2.502}, {'end': 295.555, 'text': "That's what base64 is doing.", 'start': 294.234, 'duration': 1.321}, {'end': 296.436, 'text': "It's encoding it.", 'start': 295.595, 'duration': 0.841}, {'end': 299.338, 'text': 'Kind of like encoding a URL so it can be recognized.', 'start': 296.716, 'duration': 2.622}, {'end': 300.299, 'text': "It's the same stuff.", 'start': 299.378, 'duration': 0.921}, {'end': 303.822, 'text': "So you'll need base64 for encoding.", 'start': 301.8, 'duration': 2.022}, {'end': 309.467, 'text': "And then the third and final import that we're going to need is import os.", 'start': 305.363, 'duration': 4.104}, {'end': 315.292, 'text': 'And the reason for os and what we want an os for is for the function called urandom.', 'start': 310.288, 'duration': 5.004}, {'end': 320.771, 'text': "which is kind of an accepted producer of randomness that's suitable for cryptology.", 'start': 316.409, 'duration': 4.362}, {'end': 324.672, 'text': "Simple random isn't really as accepted.", 'start': 321.731, 'duration': 2.941}, {'end': 328.053, 'text': 'I mean, you can use it, but people prefer U random over that.', 'start': 324.832, 'duration': 3.221}], 'summary': 'Base64 encoding for data recognition, using os for urandom function.', 'duration': 45.686, 'max_score': 282.367, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g282367.jpg'}], 'start': 68.634, 'title': 'Pycrypto installation and python encryption', 'summary': 'Provides a guide for installing pycrypto via command prompt, and covers aes encryption, symmetric key algorithms, base64 and os usage in python, catering to beginners and focusing on practical implementation.', 'chapters': [{'end': 181.092, 'start': 68.634, 'title': 'Installing pycrypto via command prompt', 'summary': 'Explains how to install pycrypto using the command prompt, including changing directories, running setup.py, and installing the package, providing a helpful guide for beginners.', 'duration': 112.458, 'highlights': ['The chapter explains the process of installing PyCrypto using the command prompt, including changing directories, running setup.py, and installing the package, making it easy for beginners to follow along.', 'Using the CD command, the chapter instructs to change the directory to the location of the PyCrypto file, providing a clear demonstration of the process for beginners.', "The chapter emphasizes the importance of running 'python setup setup.py install' to install PyCrypto, providing a crucial step in the installation process for beginners.", "The chapter discusses the presence of 'setup.py' file, which is essential for setting up the installation, offering crucial information for beginners."]}, {'end': 328.053, 'start': 181.092, 'title': 'Encryption and decryption in python', 'summary': 'Covers the process of encryption and decryption in python, focusing on aes encryption, symmetric key algorithms, and the use of base64 and os for encoding and randomness.', 'duration': 146.961, 'highlights': ['AES is the most popular form of encryption, and it is recommended to use 128-bit encryption for security purposes.', 'Base64 is used for encoding data into a specific format for recognition, distinct from encryption.', 'The import os is necessary for the function urandom, which is an accepted producer of randomness suitable for cryptology.']}], 'duration': 259.419, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g68634.jpg', 'highlights': ['The chapter explains the process of installing PyCrypto using the command prompt, including changing directories, running setup.py, and installing the package, making it easy for beginners to follow along.', 'Using the CD command, the chapter instructs to change the directory to the location of the PyCrypto file, providing a clear demonstration of the process for beginners.', "The chapter emphasizes the importance of running 'python setup setup.py install' to install PyCrypto, providing a crucial step in the installation process for beginners.", "The chapter discusses the presence of 'setup.py' file, which is essential for setting up the installation, offering crucial information for beginners.", 'AES is the most popular form of encryption, and it is recommended to use 128-bit encryption for security purposes.', 'Base64 is used for encoding data into a specific format for recognition, distinct from encryption.', 'The import os is necessary for the function urandom, which is an accepted producer of randomness suitable for cryptology.']}, {'end': 473.848, 'segs': [{'end': 428.479, 'src': 'embed', 'start': 384.628, 'weight': 0, 'content': [{'end': 390.511, 'text': "if you're trying to learn how to do encryption because you accept maybe like people's credit card information online or something like that,", 'start': 384.628, 'duration': 5.883}, {'end': 398.347, 'text': "you're kind of like obligated to encrypt their data, and the basic I'm trying to think,", 'start': 390.511, 'duration': 7.836}, {'end': 403.47, 'text': 'like the widely except the one that the US government backs is 128 bit AES encryption.', 'start': 398.347, 'duration': 5.123}, {'end': 408.614, 'text': "so that's what I suggest you use if you're liable for any of the information that you're storing.", 'start': 403.47, 'duration': 5.144}, {'end': 413.217, 'text': "but also the reason they support it is because it's good.", 'start': 408.614, 'duration': 4.603}, {'end': 424.156, 'text': "just another side, basically a, you can go as low as like a 32-bit encryption and, Basically, with today's computational power,", 'start': 413.217, 'duration': 10.939}, {'end': 428.479, 'text': 'a decent computer would have that key just by brute force techniques only.', 'start': 424.156, 'duration': 4.323}], 'summary': 'Use 128-bit aes encryption for secure data protection.', 'duration': 43.851, 'max_score': 384.628, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g384628.jpg'}], 'start': 328.853, 'title': 'Aes encryption and key sizes', 'summary': 'Explains the importance of choosing the appropriate key sizes for aes encryption, emphasizing the widespread acceptance of 128-bit aes encryption for securing sensitive information and highlighting vulnerabilities of lower bit keys.', 'chapters': [{'end': 473.848, 'start': 328.853, 'title': 'Encryption function and aes key sizes', 'summary': "Discusses defining an encryption function and explains the importance of choosing the appropriate key sizes for aes encryption, emphasizing that 128-bit aes encryption is widely accepted and recommended for securing sensitive information, while also highlighting the vulnerabilities of lower bit keys in today's computational environment.", 'duration': 144.995, 'highlights': ["The importance of selecting an appropriate key size for AES encryption is stressed, with 128-bit encryption being widely accepted and recommended for securing sensitive information, as it would take centuries with a bunch of computers to crack it (128-bit) but considerably less time for lower bit keys due to vulnerabilities in today's computational power.", 'The obligation to encrypt sensitive data, such as credit card information, is highlighted, with the recommended 128-bit AES encryption being backed by the US government and considered secure at the moment, in contrast to lower bit encryptions which are vulnerable to being cracked within a relatively short time using brute force techniques.', 'The vulnerability of lower bit keys, such as 32-bit and 64-bit encryption, is explained in relation to computational power, with a 32-bit key being crackable in less than an hour and a 64-bit key taking a few months with a decent computer, emphasizing the need for stronger encryptions as processors continue to improve.']}], 'duration': 144.995, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g328853.jpg', 'highlights': ['128-bit AES encryption widely accepted and recommended for securing sensitive information.', 'Recommended 128-bit AES encryption backed by US government and considered secure at the moment.', 'Vulnerability of lower bit keys explained in relation to computational power.']}, {'end': 665.048, 'segs': [{'end': 564.147, 'src': 'embed', 'start': 476.161, 'weight': 0, 'content': [{'end': 480.123, 'text': 'So anyways, moving right along after block size, the next thing you have to define is padding.', 'start': 476.161, 'duration': 3.962}, {'end': 483.105, 'text': 'This is the only thing that really confuses me.', 'start': 481.284, 'duration': 1.821}, {'end': 488.228, 'text': "It's like some sort of algorithm that you can use, but you can put, like, anything in here.", 'start': 483.966, 'duration': 4.262}, {'end': 490.609, 'text': 'Like, you can put, like, 9999 and all this kind of stuff.', 'start': 488.248, 'duration': 2.361}, {'end': 495.092, 'text': 'Like, apparently, like, this open curly brace is, like, some sort of algorithm.', 'start': 490.649, 'duration': 4.443}, {'end': 498.774, 'text': 'If you understand that, let me know.', 'start': 497.293, 'duration': 1.481}, {'end': 500.615, 'text': "I don't really understand it myself.", 'start': 499.034, 'duration': 1.581}, {'end': 503.177, 'text': "I just know that that's what people do, so that's what I'm doing.", 'start': 500.695, 'duration': 2.482}, {'end': 510.883, 'text': "Um, And I guess the reason you use a padding at all is so it's for sure.", 'start': 503.757, 'duration': 7.126}, {'end': 516.388, 'text': 'like whatever your, the values that you encrypt are multiple of the block size and length.', 'start': 510.883, 'duration': 5.505}, {'end': 521.272, 'text': 'So this is just like you use some sort of padding to ensure that that is the case.', 'start': 517.149, 'duration': 4.123}, {'end': 524.415, 'text': 'So it can actually be like understood and encrypted later on.', 'start': 521.673, 'duration': 2.742}, {'end': 541.081, 'text': "So now the next thing is if I just pad and to do this, we're gonna call lambda And our parameter for lambda will just be c, or I'm sorry, lambda,", 'start': 526.657, 'duration': 14.424}, {'end': 542.962, 'text': 'our parameter will be s.', 'start': 541.081, 'duration': 1.881}, {'end': 555.385, 'text': "And then we're going to say s plus block size minus the length of s.", 'start': 542.962, 'duration': 12.423}, {'end': 564.147, 'text': 'And then block size, block size times.', 'start': 555.385, 'duration': 8.762}], 'summary': 'Padding ensures values encrypted are multiples of block size and length.', 'duration': 87.986, 'max_score': 476.161, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g476161.jpg'}, {'end': 639.42, 'src': 'embed', 'start': 596.268, 'weight': 2, 'content': [{'end': 597.549, 'text': 'I just need to have Python up.', 'start': 596.268, 'duration': 1.281}, {'end': 602.513, 'text': "So if you're not familiar with Lambda, let me just show you how Lambda really works.", 'start': 598.13, 'duration': 4.383}, {'end': 606.156, 'text': "It's kind of like a really, really quick way to embed a function in a function.", 'start': 602.573, 'duration': 3.583}, {'end': 608.198, 'text': "And it's like a one-liner function.", 'start': 606.797, 'duration': 1.401}, {'end': 610.26, 'text': "It's just really easy to do it.", 'start': 608.238, 'duration': 2.022}, {'end': 613.542, 'text': 'So, or really like a function and a variable.', 'start': 611.441, 'duration': 2.101}, {'end': 614.343, 'text': 'Anyway Okay.', 'start': 614.023, 'duration': 0.32}, {'end': 626.478, 'text': "so, just as a quick example, let's say we want to define our variable as addition equals and then lambda and this, basically like lambda,", 'start': 615.535, 'duration': 10.943}, {'end': 632.039, 'text': "is like notifying Python that we're about to do this really weird thing and then, kind of like a function,", 'start': 626.478, 'duration': 5.561}, {'end': 635.6, 'text': "you have to define what your parameters are, but there's no parentheses.", 'start': 632.039, 'duration': 3.561}, {'end': 639.42, 'text': 'so you do like lambda x and then, just like at the end of a function,', 'start': 635.6, 'duration': 3.82}], 'summary': 'Lambda in python allows quick embedding of one-liner functions and variables.', 'duration': 43.152, 'max_score': 596.268, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g596268.jpg'}], 'start': 476.161, 'title': 'Padding in encryption', 'summary': 'Explores defining padding for encryption, ensuring encrypted values are multiples of block size and length. it discusses padding data using lambda functions with an emphasis on lambda parameters and block size calculation, and demonstrates defining and using a lambda function in python, showcasing a quick and concise method to embed a function within a function.', 'chapters': [{'end': 521.272, 'start': 476.161, 'title': 'Defining padding for encryption', 'summary': 'Discusses the confusion around defining padding for encryption, highlighting its purpose of ensuring that encrypted values are multiples of the block size and length, with the speaker admitting lack of understanding but following the practice.', 'duration': 45.111, 'highlights': ['The purpose of using padding is to ensure that the values encrypted are multiples of the block size and length.', 'The speaker admits confusion around defining padding for encryption but follows the practice as it is commonly done.', 'The speaker describes padding as an algorithm that can be used with flexibility, allowing for different input values like 9999.']}, {'end': 596.248, 'start': 521.673, 'title': 'Padding data with lambda', 'summary': 'Discusses the process of padding data using lambda functions, emphasizing the usage of lambda parameters and block size calculation.', 'duration': 74.575, 'highlights': ['Explaining the process of padding data with lambda functions and demonstrating the usage of lambda parameters and block size calculation.', 'Demonstration of the process to pad the data with padding, using lambda parameters and block size calculation.']}, {'end': 665.048, 'start': 596.268, 'title': 'Lambda function in python', 'summary': 'Demonstrates how to define and use a lambda function in python, showcasing a quick and concise method to embed a function within a function, with an example of adding 5 to a given input.', 'duration': 68.78, 'highlights': ['Lambda in Python is a quick way to embed a function in a function, providing a concise, one-liner approach to defining functions.', 'The example demonstrates defining a lambda function for addition, showcasing how 3 plus 5 equals 8, illustrating the functionality of lambda in Python.']}], 'duration': 188.887, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g476161.jpg', 'highlights': ['Explaining the process of padding data with lambda functions and demonstrating the usage of lambda parameters and block size calculation.', 'The purpose of using padding is to ensure that the values encrypted are multiples of the block size and length.', 'Lambda in Python is a quick way to embed a function in a function, providing a concise, one-liner approach to defining functions.', 'The example demonstrates defining a lambda function for addition, showcasing how 3 plus 5 equals 8, illustrating the functionality of lambda in Python.', 'The speaker admits confusion around defining padding for encryption but follows the practice as it is commonly done.', 'The speaker describes padding as an algorithm that can be used with flexibility, allowing for different input values like 9999.', 'Demonstration of the process to pad the data with padding, using lambda parameters and block size calculation.']}, {'end': 1262.989, 'segs': [{'end': 746.686, 'src': 'embed', 'start': 666.598, 'weight': 0, 'content': [{'end': 673.77, 'text': "Now the reason why it's actually used in encryption is it's used for abstraction of functions.", 'start': 666.598, 'duration': 7.172}, {'end': 681.619, 'text': "So that's really the reason why you're using it with encryption, basically.", 'start': 676.835, 'duration': 4.784}, {'end': 688.024, 'text': "So moving right along now, we're going to define how we want this to be encoded.", 'start': 682.119, 'duration': 5.905}, {'end': 699.594, 'text': "And so we'll call this encode AES equals, and then we'll hit up lambda again, C, and then S, basically to correspond here.", 'start': 688.485, 'duration': 11.109}, {'end': 719.792, 'text': "we want to call base64 and again this is base64 is for encoding dot b64, I want to say encode and then so that's what you're actually going to encode.", 'start': 703.982, 'duration': 15.81}, {'end': 721.773, 'text': 'and then you want to encode whatever you know.', 'start': 719.792, 'duration': 1.981}, {'end': 738.244, 'text': 'the c variable is or c parameter, rather c dot encrypt, and then we want to encrypt the padded version of this S variable basically, or S parameter.', 'start': 721.773, 'duration': 16.471}, {'end': 744.805, 'text': 'And close that again.', 'start': 741.925, 'duration': 2.88}, {'end': 746.686, 'text': 'And one more time.', 'start': 744.825, 'duration': 1.861}], 'summary': 'Aes encryption involves abstraction of functions and base64 encoding for security.', 'duration': 80.088, 'max_score': 666.598, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g666598.jpg'}, {'end': 818.176, 'src': 'embed', 'start': 769.24, 'weight': 2, 'content': [{'end': 794.513, 'text': "and then you have block size here block size and then, just so we can actually see it, we'll want to say print encryption key and secret.", 'start': 769.24, 'duration': 25.273}, {'end': 804.321, 'text': 'And now what we need to do is establish a cypher object basically.', 'start': 800.418, 'duration': 3.903}, {'end': 810.266, 'text': "So to do that you're going to need cypher equals AES dot new and then secret.", 'start': 805.242, 'duration': 5.024}, {'end': 812.508, 'text': "I think we've added a space here.", 'start': 810.286, 'duration': 2.222}, {'end': 818.176, 'text': 'and then finally, we encode.', 'start': 816.195, 'duration': 1.981}], 'summary': 'Creating a cipher object for encryption using aes with a specified secret key.', 'duration': 48.936, 'max_score': 769.24, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g769240.jpg'}, {'end': 913.587, 'src': 'heatmap', 'start': 868.812, 'weight': 1, 'content': [{'end': 877.159, 'text': 'And then finally, you can print out encrypted string colon comma, and then encode it.', 'start': 868.812, 'duration': 8.347}, {'end': 881.803, 'text': 'And now we have hopefully explained to you how encryption works.', 'start': 879.06, 'duration': 2.743}, {'end': 883.764, 'text': "And now let's see what it looks like for us.", 'start': 882.123, 'duration': 1.641}, {'end': 887.848, 'text': "And we'll call encryption.", 'start': 886.226, 'duration': 1.622}, {'end': 908.103, 'text': "and then inside, here is where we're going to put a secret message that is very sensitive and we want no one to read it, even the government.", 'start': 892.631, 'duration': 15.472}, {'end': 913.587, 'text': 'hit enter and, as you can see, here is our encryption key, and then this is the actual encrypted info.', 'start': 908.103, 'duration': 5.484}], 'summary': 'Explanation of encryption process and generation of encrypted info.', 'duration': 44.775, 'max_score': 868.812, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g868812.jpg'}, {'end': 913.587, 'src': 'embed', 'start': 879.06, 'weight': 3, 'content': [{'end': 881.803, 'text': 'And now we have hopefully explained to you how encryption works.', 'start': 879.06, 'duration': 2.743}, {'end': 883.764, 'text': "And now let's see what it looks like for us.", 'start': 882.123, 'duration': 1.641}, {'end': 887.848, 'text': "And we'll call encryption.", 'start': 886.226, 'duration': 1.622}, {'end': 908.103, 'text': "and then inside, here is where we're going to put a secret message that is very sensitive and we want no one to read it, even the government.", 'start': 892.631, 'duration': 15.472}, {'end': 913.587, 'text': 'hit enter and, as you can see, here is our encryption key, and then this is the actual encrypted info.', 'start': 908.103, 'duration': 5.484}], 'summary': 'Explained encryption process with example of sensitive message and encryption key.', 'duration': 34.527, 'max_score': 879.06, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g879060.jpg'}, {'end': 1177.528, 'src': 'heatmap', 'start': 1154.6, 'weight': 0.845, 'content': [{'end': 1164.839, 'text': "so obviously we're referencing up here cipher using that cipher that we've just said and then we want to use it on the encrypted string.", 'start': 1154.6, 'duration': 10.239}, {'end': 1170.163, 'text': 'Close And then finally print decoded.', 'start': 1166.921, 'duration': 3.242}, {'end': 1173.545, 'text': "So hopefully we've not spelled anything wrong.", 'start': 1171.744, 'duration': 1.801}, {'end': 1174.105, 'text': 'Yeah, sure.', 'start': 1173.565, 'duration': 0.54}, {'end': 1177.528, 'text': 'Okay, so we need to add this to the top of the file.', 'start': 1174.125, 'duration': 3.403}], 'summary': 'Referencing cipher for encryption and decoding.', 'duration': 22.928, 'max_score': 1154.6, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g1154600.jpg'}], 'start': 666.598, 'title': 'Aes encryption and function abstraction', 'summary': 'Discusses aes encryption for function abstraction, encoding with base64, encrypting parameters, and emphasizes the importance of securing the encryption key. it also explains the process of generating an encryption key, establishing a cipher object, and encrypting a message using aes algorithm in python.', 'chapters': [{'end': 746.686, 'start': 666.598, 'title': 'Aes encryption and function abstraction', 'summary': 'Discusses the use of aes encryption for function abstraction, specifically focusing on encoding with base64 and encrypting parameters, aiming to achieve secure encryption.', 'duration': 80.088, 'highlights': ['AES encryption is used for abstraction of functions in encryption, providing a secure way to encode and encrypt parameters.', 'The process involves encoding with base64 and encrypting the padded version of the parameter, ensuring secure encryption.']}, {'end': 1262.989, 'start': 748.106, 'title': 'Encryption and decryption in python', 'summary': 'Explains the process of generating an encryption key, establishing a cipher object, and encrypting a message using aes algorithm in python, emphasizing the importance of securing the encryption key and demonstrating the decryption process.', 'duration': 514.883, 'highlights': ['Explaining the process of generating an encryption key and establishing a cipher object using AES algorithm in Python The chapter explains the process of generating an encryption key, establishing a cipher object, and encrypting a message using AES algorithm in Python.', 'Emphasizing the importance of securing the encryption key and demonstrating the decryption process The chapter emphasizes the importance of securing the encryption key and demonstrates the decryption process, highlighting the need for proper key management and secure storage.']}], 'duration': 596.391, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8PzDfykGg_g/pics/8PzDfykGg_g666598.jpg', 'highlights': ['AES encryption is used for abstraction of functions in encryption, providing a secure way to encode and encrypt parameters.', 'The process involves encoding with base64 and encrypting the padded version of the parameter, ensuring secure encryption.', 'Explaining the process of generating an encryption key and establishing a cipher object using AES algorithm in Python.', 'Emphasizing the importance of securing the encryption key and demonstrating the decryption process, highlighting the need for proper key management and secure storage.']}], 'highlights': ['AES is the most popular form of encryption, and it is recommended to use 128-bit encryption for security purposes.', '128-bit AES encryption widely accepted and recommended for securing sensitive information.', 'Recommended 128-bit AES encryption backed by US government and considered secure at the moment.', 'Vulnerability of lower bit keys explained in relation to computational power.', 'The process involves encoding with base64 and encrypting the padded version of the parameter, ensuring secure encryption.', 'Emphasizing the importance of securing the encryption key and demonstrating the decryption process, highlighting the need for proper key management and secure storage.', 'Explaining the process of installing PyCrypto using the command prompt, including changing directories, running setup.py, and installing the package, making it easy for beginners to follow along.', 'Using the CD command, the chapter instructs to change the directory to the location of the PyCrypto file, providing a clear demonstration of the process for beginners.', "The chapter emphasizes the importance of running 'python setup setup.py install' to install PyCrypto, providing a crucial step in the installation process for beginners.", "The chapter discusses the presence of 'setup.py' file, which is essential for setting up the installation, offering crucial information for beginners."]}