1 00:00:00,000 --> 00:00:01,580 Hello, everybody. 2 00:00:01,580 --> 00:00:05,260 Thank you for being here today in this session. 3 00:00:05,700 --> 00:00:09,140 In this presentation, we're going to talk about security. 4 00:00:09,500 --> 00:00:18,320 And the algorithms and the devices in charge of our security when we are navigating on the Internet or we are sharing files or information. 5 00:00:18,420 --> 00:00:22,880 We're going to talk about keys, hashes, and DPMs. 6 00:00:23,240 --> 00:00:29,500 Also, we're going to talk about the future threats that can essentially break them. 7 00:00:29,500 --> 00:00:32,300 For example, quantum computing. 8 00:00:32,580 --> 00:00:46,900 Also, at the end of the presentation, I want to propose you to use reconfigurable devices to be in charge of that security. 9 00:00:47,160 --> 00:01:09,040 Reconfigurable devices are devices that the designer can program or can configure its internal hardware architecture in order to make them resilient to new threats, for example, or to update the algorithms which are running inside of the device. 10 00:01:09,200 --> 00:01:12,100 But first of all, let me introduce myself. 11 00:01:12,600 --> 00:01:17,800 I have to say that I am the freak on that conference because I am not a software developer. 12 00:01:17,800 --> 00:01:20,280 I am an FPGA designer. 13 00:01:20,280 --> 00:01:37,100 FPGAs are reconfigurable devices that I can program or I can design or I can implement the design which is printed inside of the integrated circuit. 14 00:01:37,540 --> 00:01:38,820 I also write on the Internet. 15 00:01:38,820 --> 00:01:40,060 You can read me. 16 00:01:40,520 --> 00:01:41,480 Sorry? 17 00:01:43,020 --> 00:01:44,380 Better? 18 00:01:44,680 --> 00:01:47,520 Ah, thanks. 19 00:01:47,520 --> 00:01:50,500 Okay, I also write on the Internet. 20 00:01:50,500 --> 00:01:58,520 You can read me on Hackster, X, Hackaday, and also on my own blog, controlpath.com. 21 00:01:59,200 --> 00:02:07,800 If you want to tell me something, you can write me on my email and you can find me also on Twitter with the name controlpaths. 22 00:02:08,540 --> 00:02:12,520 Well, first we're going to talk about the privacy protectors. 23 00:02:12,520 --> 00:02:19,560 The privacy protectors, now we can find hash algorithms and keys. 24 00:02:19,560 --> 00:02:27,060 Regarding hash algorithms, we have MD5 and the SHA family, SHA1, 2, and 3. 25 00:02:27,060 --> 00:02:31,100 If you're still using MD5 or SHA1, you are in the correct talk. 26 00:02:31,100 --> 00:02:38,340 Regarding the keys, we have RSA, we have Kyber, and we have IS. 27 00:02:38,340 --> 00:02:41,860 We're going to see how they work very quickly. 28 00:02:42,280 --> 00:02:55,940 Regarding hash algorithms, a hash algorithm is an algorithm in which I can introduce a variable length string and then it will return me a fixed length string. 29 00:02:56,640 --> 00:03:08,520 The key is that a very small change in the input string will produce a big change in the output string. 30 00:03:08,520 --> 00:03:17,840 So they can be used in order to verify if a file has been changed in the transmission or not. 31 00:03:18,780 --> 00:03:23,020 As I said before, we have different hash algorithms. 32 00:03:23,020 --> 00:03:28,820 We have MD5 and the SHA family, 0, 1, 2, and 3. 33 00:03:28,820 --> 00:03:36,200 Now, only SHA2 and SHA3 are still alive. 34 00:03:36,200 --> 00:03:48,920 The first one that was broken was SHA0 in 1999, then MD5, and the last one broken was SHA1. 35 00:03:49,100 --> 00:04:04,180 All of them died, all of them were broken because a group of investigators got to create a custom hash by modifying the input string. 36 00:04:04,180 --> 00:04:06,180 This is known as a collision. 37 00:04:06,180 --> 00:04:09,900 Nowadays, SHA2 and SHA3. 38 00:04:09,900 --> 00:04:18,520 But if we add a new player, like quantum computing, only SHA3 will be alive. 39 00:04:18,920 --> 00:04:22,860 Regarding the keys, keys are essentially passwords. 40 00:04:22,860 --> 00:04:28,080 They are passwords that I can use to encrypt a file or encrypt some information. 41 00:04:28,860 --> 00:04:37,960 The thing is that only the user who has the password, who has the key, are able to read the data or decrypt the data. 42 00:04:38,140 --> 00:04:41,200 When I talk about data, I'm not talking about just files. 43 00:04:41,200 --> 00:04:46,180 I'm talking about real-time data, for example, in TLS communications or SSH. 44 00:04:46,180 --> 00:04:51,140 It's data that I send and receive in real time. 45 00:04:51,140 --> 00:04:53,600 We have two types of keys. 46 00:04:53,600 --> 00:04:57,280 We have symmetric keys and asymmetric keys. 47 00:04:57,700 --> 00:05:00,760 Regarding symmetric keys are the easiest ones. 48 00:05:01,360 --> 00:05:07,100 There's only one key for encrypt and the same key for decrypt. 49 00:05:07,260 --> 00:05:15,760 The problem here is the way in which the creator of the key shares the key with all the recipients. 50 00:05:17,980 --> 00:05:23,740 To fix that, we have the asymmetric keys or asymmetric encryption. 51 00:05:23,780 --> 00:05:25,960 We have two different keys. 52 00:05:25,960 --> 00:05:27,700 We have a pair of keys. 53 00:05:27,700 --> 00:05:33,260 One key is used for encrypting the data and the other one is used for decrypting the data. 54 00:05:33,260 --> 00:05:37,200 And the password used for decrypting the data cannot encrypt the data. 55 00:05:37,200 --> 00:05:49,020 Usually the key used for encrypting the data is known as a public key because anyone can encrypt the data that I may be able to read. 56 00:05:50,400 --> 00:05:57,140 All of these algorithms are just math and some logic. 57 00:05:57,560 --> 00:06:04,740 The names like Rindle, Diffie-Hellman, Chacha and Salsa are the names of that algorithm. 58 00:06:04,740 --> 00:06:09,880 As I said, they are based on mathematical and logic operations. 59 00:06:10,840 --> 00:06:16,140 Key of that algorithm is the performance of them. 60 00:06:16,160 --> 00:06:23,300 The performance is the speed of how quick they can encrypt and decrypt data. 61 00:06:23,300 --> 00:06:28,220 And this is very important if we are performing real-time ciphering. 62 00:06:28,220 --> 00:06:33,580 For example, in the case of the TLS or SSH. 63 00:06:33,820 --> 00:06:38,180 So we don't talk just about algorithms. 64 00:06:38,180 --> 00:06:42,920 We also talk about the way in which we calculate the cipher. 65 00:06:42,920 --> 00:06:46,020 We encrypt the data or we decrypt the data. 66 00:06:46,240 --> 00:06:51,160 This is known as the operation mode and it is critical, for example, for IS encryption. 67 00:06:53,780 --> 00:06:59,900 Okay, so we have the algorithm that we know now that are based on mathematical and logic operations. 68 00:06:59,900 --> 00:07:01,760 We need to make them a reality. 69 00:07:01,760 --> 00:07:04,560 We need to implement them. 70 00:07:04,560 --> 00:07:09,540 We have two different ways of implementing these kinds of algorithms. 71 00:07:10,000 --> 00:07:13,740 We have the software implementation and the hardware implementation. 72 00:07:13,740 --> 00:07:14,660 The software is easy. 73 00:07:14,660 --> 00:07:23,940 It is the usual way in which we write the code in order to solve all the mathematical operations. 74 00:07:23,940 --> 00:07:39,500 When we are talking about hardware implementation, we are talking about using an external hardware to let the external hardware compute the mathematical equations and the encryption or the decryption. 75 00:07:41,620 --> 00:07:43,820 Okay, regarding the software implementation. 76 00:07:44,640 --> 00:07:47,680 As I said before, the implementation is made by code. 77 00:07:47,680 --> 00:07:49,780 C, Python, whatever. 78 00:07:50,640 --> 00:07:57,860 The performance that we can reach with this kind of implementation is very poor. 79 00:07:57,980 --> 00:07:58,440 Why? 80 00:07:58,440 --> 00:08:08,860 Because if I have a processor that is running at 3 GHz or 5 GHz, the processor does not execute the instructions at that speed. 81 00:08:09,700 --> 00:08:12,080 In addition, we have the operating system. 82 00:08:12,080 --> 00:08:30,460 So all of these elements between the hardware of the processor and the algorithm will make that the implementation of these algorithms just using code won't be... 83 00:08:30,460 --> 00:08:33,180 well, the performance is not good. 84 00:08:34,040 --> 00:08:35,400 Manufacturers know that. 85 00:08:35,400 --> 00:08:41,420 So what they do is implement the processor extension. 86 00:08:41,420 --> 00:08:44,600 These are pieces of hardware that are near to the processor. 87 00:08:44,600 --> 00:08:48,580 We have processor extensions to calculate SHA, to calculate I. 88 00:08:48,580 --> 00:08:53,680 The SHA is the SHA-ni and the IS is the IS-ni. 89 00:08:54,020 --> 00:09:00,340 Another key of that kind of software implementation is that the keys have been stored in the hard disk. 90 00:09:00,340 --> 00:09:09,720 In the hard disk, if we want to make them non-volatile, they will be implemented in the RAM memory if they can be volatile. 91 00:09:11,460 --> 00:09:18,740 One thing that makes these software implementations very useful is that they are very easy to update. 92 00:09:18,740 --> 00:09:30,420 If I want to change some of the algorithms that I have implemented, I just need to make an update of the software running another script and it will work. 93 00:09:30,500 --> 00:09:35,940 However, this is not all good. 94 00:09:35,940 --> 00:09:44,400 As I said, the implementation of the algorithms made in bytecode has a very poor performance. 95 00:09:44,400 --> 00:09:53,280 Also, yes, we can use the processor extension, but in this case we are going to create a dependency of the processor. 96 00:09:53,280 --> 00:10:09,000 And if we create an algorithm that uses a processor extension and then the other user executes that algorithm in a processor which doesn't have those extensions, our algorithm won't work. 97 00:10:09,000 --> 00:10:18,900 This is especially critical when we are working with an embedded system, because not all the manufacturers create the same processors, even if they use the same ARM core. 98 00:10:19,900 --> 00:10:24,160 Keys stored in hard disks are absolutely not secure. 99 00:10:24,160 --> 00:10:30,620 And the same for the easy-to-update, another player can update the software in order to make them vulnerable. 100 00:10:32,420 --> 00:10:36,060 The other implementation we talked about is hardware implementation. 101 00:10:36,060 --> 00:10:44,260 When I talk about hardware implementation, I talk about using an external device to execute the algorithms, which is great. 102 00:10:44,700 --> 00:10:53,880 This allows us to store the keys very securely, because those keys can be read and write only. 103 00:10:53,880 --> 00:11:02,060 So I can send the key and then no one will be able to read the same key. 104 00:11:03,900 --> 00:11:15,040 The hardware used in these cases are made by manufacturers that implement algorithms that are widely used. 105 00:11:15,400 --> 00:11:30,560 For example, usually all the hardware of this type implements SHA-2, SHA-256 normally, and ICE up to SHA-256. 106 00:11:30,600 --> 00:11:37,160 And finally, it is true that we eliminate the dependency of the CPU. 107 00:11:37,720 --> 00:11:51,780 However, using an external device to execute the different cryptographic algorithms is more than executing these cryptographic algorithms in other processors. 108 00:11:51,780 --> 00:12:03,220 They allow secure storage for keys, which is great, and we eliminate the dependency on the CPU, but we are going to create a dependency of the hardware used. 109 00:12:03,600 --> 00:12:07,880 And standardize the algorithms used. 110 00:12:08,640 --> 00:12:18,300 As I said, the manufacturer wants to sell the hardware, so they will implement the widely used algorithms. 111 00:12:20,260 --> 00:12:27,580 One of that hardware is the well-known TPM, Structured Platform Modules. 112 00:12:27,580 --> 00:12:33,260 They are cryptographic coprocessors usually integrated in the same motherboard. 113 00:12:33,600 --> 00:12:40,660 They allow secure storage for keys and they include a set of cryptographic functions. 114 00:12:41,260 --> 00:12:46,540 Nowadays we have two important versions, TPM 1.2 and TPM 2.0. 115 00:12:46,540 --> 00:12:59,120 TPM 2.0 is very famous because if you want to run Windows 11 on an old computer, you will need to include a TPM 2.0 in the motherboard. 116 00:13:02,470 --> 00:13:12,630 Let's take a look at the Practical Guide of the Trusting Computing Group, which is the group in charge of developing the TPM 2.0. 117 00:13:12,630 --> 00:13:19,790 We can read, one problem that begs the developers for a long time was how to integrate multiple hash algorithms. 118 00:13:19,790 --> 00:13:24,030 If one of those hash algorithms was later broken. 119 00:13:24,510 --> 00:13:31,670 We have seen that the hash algorithms will be broken. 120 00:13:32,070 --> 00:13:33,250 Ever. 121 00:13:36,500 --> 00:13:41,180 And what can break those algorithms? 122 00:13:41,180 --> 00:13:46,260 Well, for now, the most important threat is the quantum threat of quantum computing. 123 00:13:46,260 --> 00:13:54,540 Quantum computing is a new computational mode that is based on quantum physics. 124 00:13:55,260 --> 00:14:00,900 It uses the traditional bits that we can find in a regular computer. 125 00:14:01,540 --> 00:14:04,400 They can take values of 1 or 0. 126 00:14:04,400 --> 00:14:13,280 Quantum computing uses quantum bits or qubits that can take values of 1, 0 and all the values between them. 127 00:14:13,280 --> 00:14:19,120 They can do this because of the superposition principle of quantum physics. 128 00:14:19,340 --> 00:14:28,300 This allows the processor to be able to execute or evaluate multiple choices at the same time. 129 00:14:28,300 --> 00:14:33,920 And, obviously, the quantum processors allow the execution of quantum algorithms. 130 00:14:33,920 --> 00:14:47,140 The quantum algorithms that are related to cryptography are the Gruber's algorithms, which use the quantum superposition principle. 131 00:14:47,480 --> 00:14:56,980 And the use of these algorithms helps us to find elements within an unordered list. 132 00:14:56,980 --> 00:15:06,380 Summarizing, if we have a set of solutions of length n, the set of solutions is reduced to a square root of n, which is great. 133 00:15:06,900 --> 00:15:15,600 The other algorithm that can represent a threat to the cryptography, to the scriptography, is the source algorithm. 134 00:15:15,860 --> 00:15:20,000 This algorithm is used for finding the prime factors of an integer n. 135 00:15:20,000 --> 00:15:33,140 This results in, if we have a set of solutions with a length n, it will be reduced to a logarithm of n cubed, which is also great. 136 00:15:33,140 --> 00:15:39,760 The use of these two algorithms is related to this table. 137 00:15:39,760 --> 00:15:56,860 We can see how algorithms of 256 bits are reduced to 128, and the same for the keys, and RSA is another case. 138 00:15:57,220 --> 00:16:11,460 Regarding SHAs and IS, all of them can be broken using the Gruber's algorithm, except SHA3, that you can see the reduction when we use quantum computing is none. 139 00:16:11,460 --> 00:16:19,400 So we still have keys or hashes with a length of 256. 140 00:16:20,400 --> 00:16:36,280 The result of this is SHA256 will be broken, IS128 will be also broken, RSA will be broken. 141 00:16:36,840 --> 00:16:48,480 Fortunately, TPM manufacturers know that, and they will implement algorithms that resist quantum computing, or not. 142 00:16:48,480 --> 00:17:02,980 This is the TPM from Infineon, and we can see in the bottom, symmetric cryptographic, the algorithm that it supports. 143 00:17:02,980 --> 00:17:08,160 And there are no SHA2, 512, or SHA3. 144 00:17:08,160 --> 00:17:15,380 So this kind of, or this group of TPMs will be vulnerable in a time. 145 00:17:15,380 --> 00:17:19,560 So what I propose, use reconfigurable devices. 146 00:17:19,640 --> 00:17:33,300 They are devices that are able to reconfigure its internal hardware, and by reconfiguration I am not talking about reprogrammability, I am talking about reconfigure, redo its internal hardware. 147 00:17:33,300 --> 00:17:47,440 They also allow partial reconfiguration, we can update only a part of the integrated circuit, and they will keep all the benefits of the hardware implementations. 148 00:17:48,060 --> 00:17:54,300 They can be based on FPGAs or other devices, but mostly on FPGAs. 149 00:17:54,620 --> 00:17:57,020 But what is an FPGA? 150 00:17:57,020 --> 00:18:04,080 FPGA is a matrix, it is an integrated circuit, in which inside we can find a matrix of different elements. 151 00:18:04,080 --> 00:18:10,180 We have input and output blocks, and we have a big set of configurable logic blocks. 152 00:18:10,180 --> 00:18:15,180 Also we can find multiplication and accumulation blocks, and block RAM blocks. 153 00:18:15,700 --> 00:18:27,060 The key of these elements, or what makes them great, is that I can use a set of blocks to implement SHA-256, for example. 154 00:18:27,060 --> 00:18:34,840 And in another part of the FPGA, we can implement an RSA-2048. 155 00:18:34,840 --> 00:18:42,640 These two algorithms are executed, are implemented in different parts of the FPGA, so they can be run in parallel. 156 00:18:43,060 --> 00:18:53,980 If any of them will become vulnerable because of the quantum computing or something else, it is easy to change them to a post-quantum algorithm. 157 00:18:53,980 --> 00:19:03,020 For example, the SHA-2 will be converted into SHA-3, which is post-quantum, and RSA can be converted to Kiber. 158 00:19:07,680 --> 00:19:11,760 To test this, I created this project. 159 00:19:11,760 --> 00:19:14,040 I am not trying to sell you anything. 160 00:19:14,040 --> 00:19:21,740 This is an open source project, and it is a hardware secure model based on the AMD Spartan 7 FPGA. 161 00:19:21,740 --> 00:19:35,780 As I said, it is open source, and it changes the traditional I2C algorithm by an SPI interface, which can reach a speed up to 50 megabits per second. 162 00:19:35,780 --> 00:19:40,740 The limitation of the 50 megabits per second is because of this device, because of the device I designed. 163 00:19:41,280 --> 00:19:45,820 We can't reach higher speeds if we, for example, use a PCI communication. 164 00:19:46,940 --> 00:19:54,420 And, obviously, it allows a remote update once it will be deployed. 165 00:19:55,680 --> 00:19:59,280 The advantages of using this kind of HSMs. 166 00:19:59,280 --> 00:20:05,280 Reconfigurability allows to implement or to update the algorithms. 167 00:20:05,280 --> 00:20:19,300 And also, they avoid or allow us to confuse side-channel attacks and timing attacks, because I am implementing the hardware within the device. 168 00:20:19,300 --> 00:20:33,860 So I can, for example, if someone wants to attack me using a timing attack, I just have to make that the encryption using any key will take the same time. 169 00:20:34,400 --> 00:20:37,160 And the same for side-channel attacks. 170 00:20:37,320 --> 00:20:50,260 They are able to generate two random numbers, and they allow also to implement or to execute multiple algorithms at the same time. 171 00:20:50,260 --> 00:20:55,400 And also, parallelizable operation modes can be used. 172 00:20:56,030 --> 00:20:57,240 Possible disadvantages. 173 00:20:57,240 --> 00:21:02,220 Okay, FPGAs are primarily based on RAM memory. 174 00:21:02,220 --> 00:21:03,560 This can be fixed. 175 00:21:03,840 --> 00:21:09,700 The design typically will require an external memory in order to store the design. 176 00:21:09,700 --> 00:21:14,400 And usually, they don't incorporate inside a non-volatile memory. 177 00:21:14,400 --> 00:21:16,040 Also, we can fix that. 178 00:21:16,040 --> 00:21:23,620 And regarding the power consumption, FPGAs will consume more than a regular TPM. 179 00:21:25,000 --> 00:21:33,900 However, regarding the handicap, they need an external memory to store the design. 180 00:21:34,240 --> 00:21:42,600 AMD, for example, allows us to encrypt the design with IS-256. 181 00:21:42,600 --> 00:21:51,200 The good side is that the key is stored within the FPGA using fuses, so they cannot be read externally. 182 00:21:51,200 --> 00:22:02,340 Also, if I disable the G-tag interface to avoid anyone reprogramming that FPGA, it will increase the security. 183 00:22:02,340 --> 00:22:14,200 And the encryption key used for the flash memory that stores the design is generated and fused in the manufacturing process of the FPGA. 184 00:22:15,400 --> 00:22:17,940 And regarding the key storage, well, it is easy. 185 00:22:17,940 --> 00:22:28,760 I just need to add to the board an APROM memory, for example, and then I can use an SPI driver that encrypts all data that I write in the APROM memory. 186 00:22:28,840 --> 00:22:36,740 The key, in this case, can be also stored in fuses inside the FPGA, so they can be also write-only. 187 00:22:38,080 --> 00:22:40,420 The encryption key cannot be read. 188 00:22:41,120 --> 00:22:43,200 Real-time cipher. 189 00:22:43,200 --> 00:22:52,300 I said before that I implemented an SPI interface instead of a regular I2C interface. 190 00:22:52,300 --> 00:22:52,640 Why? 191 00:22:52,640 --> 00:22:53,760 Because the speed. 192 00:22:54,040 --> 00:23:02,600 With a SPI interface, we can reach around 50 megabits or even 100 megabits per second. 193 00:23:02,600 --> 00:23:09,460 And it will be very crucial when we are talking about real-time ciphering. 194 00:23:10,600 --> 00:23:12,940 And true random number generation. 195 00:23:13,060 --> 00:23:23,240 I said before that I am writing the hardware which is running inside of the FPGA, which is printed in the FPGA. 196 00:23:23,240 --> 00:23:33,360 So I can control the length between the connection of one logic block to another. 197 00:23:33,360 --> 00:23:43,410 But what I cannot control is the purity of the wafer that the manufacturer uses to print the circuit. 198 00:23:43,410 --> 00:23:59,850 This results in the delay between two logic blocks will depend on the purity of the wafer, and also the external temperature and the external pressure. 199 00:24:00,270 --> 00:24:12,790 This will result in the time spent by a bit or by the electricity to go from one logic block to the other is completely random. 200 00:24:14,170 --> 00:24:22,590 And the use of this kind of HSMs also allows us to create very customized solutions. 201 00:24:22,590 --> 00:24:25,570 In this case, I created a very simple example. 202 00:24:25,570 --> 00:24:33,170 When I have a camera connected through MIPI to one cryptolite, and then the communication with the host will be encrypted. 203 00:24:33,290 --> 00:24:47,550 On the host side, I can add another cryptolite in order to decrypt the data and talk with the host using SPI interface at 50 megabits per second. 204 00:24:48,670 --> 00:24:49,730 And that's all. 205 00:24:49,810 --> 00:24:53,490 Thank you very much for being here and thank you to CryptoVillage.