Full text
Treball de Fi de Grau Grau en Enginyeria en Tecnologies Industrials HARDWARE ALTERNATIVES FOR CRYPTO AUTHENTICATION REPORT Autor: Ignacio Saá Hernández Director: Manuel Moreno Eguílaz Convocatòria: Abril 2024 Escola Tècnica Superior d’Enginyeria Industrial de Barcelona
Pag. 2 Report
Hardware alternatives for crypto authentication Pag. 3 Resum Aquesta memòria presenta al lector un anàlisi de les diferents alternatives de hardware per a criptó autenticació presents en el mercat. Amb l'objectiu de trobar un dispositiu que permeti el seu ús a l'àmbit educatiu, així com demostrar les seves capacitats, aquesta memòria es pot dividir en tres apartats. Un primer apartat, introductori a la criptografia, presenta al lector els diferents conceptes bàsics que la defineixen. Els seus objectius, els diferents tipus de sistemes criptogràfics, així com els atacs més comuns als quals són sotmesos. Es fa especial incidència en la importància de l'autenticació com a objectiu bàsic de qualsevol sistema criptogràfic que vulgui obtenir el màxim nivell de seguretat possible. Per acabar, s'explica de manera més detallada els diferents algoritmes criptogràfics que es troben sovint en el hardware per a criptó autenticació. La memòria prossegueix definint els objectius de la nostra cerca en el mercat, per al qual una evolució històrica és donada, així com la seva previsió per al futur. Les diferents empreses consultades i el procés de selecció del dispositiu, prossegueixen, acabant amb la presentació de la nostra elecció, l'ATECC608A i el seu kit de desenvolupament SOIC XPRO STARTER KIT. Per acabar, es presenta una visió més pràctica de com utilitzar el dispositiu. Començant per una presentació detallada de l'algoritme Sign & Verify i de com utilitzar-lo per obtenir la característica desitjada de l'autenticació. Posteriorment es descriu el procés pràctic de com aconseguir-la utilitzant el programa Atmel Crypto Evaluation Studio de Microchip. De manera similar, el procés per obtenir autenticació amb l'ATECC608A és desenvolupat en codi Python, utilitzant la llibreria pública de Microchip, CryptoAuthLib. Finalitzant, diferents conclusions obtingudes durant la realització del projecte són presentades al lector. Des de la importància en l'educació de la població en un tema com aquest, que afecta la privacitat de les persones, fins a l'efecte que els avanços tecnològics tindran sobre el camp de la criptografia i els seus dispositius. Deixar de mantenir actualitzades les nostres solucions criptogràfiques i de privacitat, pot resultar fatal per a la seguretat de la nostra informació.
Pag. 4 Report Resumen Esta memoria presenta al lector un análisis de las diferentes alternativas de hardware para cripto autenticación presentes en el mercado. Con el objetivo de encontrar un dispositivo que permita su uso en ámbito educativo, así como demostrar sus capacidades, esta memoria puede dividirse en tres apartados Un primer apartado, introductorio a la criptografía, presenta al lector los diferentes conceptos básicos que la definen. Sus objetivos, los diferentes tipos de sistemas criptográficos, así como los ataques más comunes a las que son sometidos. Especial incidencia se hace en la importancia de la autenticación como objetivo básico de cualquier sistema criptográfico que desee obtener el máximo nivel de seguridad posible. Para acabar, se explica más detalladamente los distintos algoritmos criptográficos que se encuentran comúnmente en el hardware para cripto autenticación. La memoria prosigue definiendo los objetivos de nuestra búsqueda en el mercado, para el cual una evolución histórica es dada, así como su previsión para el futuro. Las diferentes empresas consultadas y el proceso de elección del dispositivo, prosiguen, finalizando con la presentación de nuestra elección, el ATECC608A y su kit de desarrollo SOIC XPRO STARTER KIT. Para acabar, una visión más práctica de como usar el dispositivo es presentada. Comenzando por una presentación detallada del algoritmo sign & verify y de como usarlo para obtener la deseada característica de la autenticación. Posteriormente se describe el proceso práctico de cómo conseguirla usando el programa Atmel Crypto Evaluation Studio de Microchip. De manera similar, el proceso para obtener autenticación con el ATECC608A es desarrollado en código Python, usando la librería pública de Microchip, CryptoAuthLib. Finalizando, distintas conclusiones obtenidas durante la realización del proyecto son presentadas al lector. Desde la importancia en la educación de la población en un tema como este, que afecta a la privacidad de las personas, hasta el efecto que los avances tecnológicos tendrán sobre el campo de la criptografía y sus dispositivos. Dejar de mantener actualizadas nuestras soluciones criptográficas y de privacidad, puede resultar fatal para la seguridad de nuestra información.
Hardware alternatives for crypto authentication Pag. 5 Abstract This report presents the reader with an analysis of the different hardware alternatives for crypto authentication available in the market. Aiming to find a device suitable for educational purposes and demonstrating its capabilities, this report can be divided into three sections. The first section, serving as an introduction to cryptography, outlines the various basic concepts defining it. It covers its objectives, the different types of cryptographic systems, as well as the most common attacks they face. Special emphasis is placed on the importance of authentication as a fundamental objective of any cryptographic system seeking to achieve the highest possible level of security. Additionally, a more detailed explanation of the different cryptographic algorithms commonly found in hardware for crypto authentication is provided. The report then proceeds to define the objectives of our market search, providing a historical evolution and future forecast. The different consulted companies and the process of selecting the device are outlined, culminating in the presentation of our choice, the ATECC608A and its development kit, the SOIC XPRO STARTER KIT. Furthermore, a more practical vision of how to use the device is presented. Starting with a detailed explanation of the sign & verify algorithm and how to use it to achieve the desired authentication feature. Subsequently, the practical process of obtaining it using the Atmel Crypto Evaluation Studio program from Microchip is described. Similarly, the process for obtaining authentication with the ATECC608A is developed in Python code, using Microchip's public library, CryptoAuthLib. Finally, various conclusions drawn during the project's execution are presented to the reader. These range from the importance of educating the population on a topic like this, which affects people's privacy, to the impact that technological advancements will have on the field of cryptography and its devices. Failing to keep our cryptographic and privacy solutions up to date could prove fatal to the security of our information.
Pag. 6 Report
Hardware alternatives for crypto authentication Pag. 7 Contents RESUM ______________________________________________________ 3 RESUMEN ___________________________________________________ 4 ABSTRACT ___________________________________________________ 5 CONTENTS ___________________________________________________ 7 ABBREVIATIONS ______________________________________________ 9 LIST OF FIGURES ____________________________________________ 11 LIST OF TABLES _____________________________________________ 13 1. PREFACE _______________________________________________ 15 2. INTRODUCTION __________________________________________ 16 2.1. Motivation ..................................................................................................... 16 2.2. Scope ........................................................................................................... 16 2.3. Prerequisites ................................................................................................ 16 2.4. Objectives .................................................................................................... 17 3. CRYPTOGRAPHY: DEFINING SECURITY IN COMMUNICATION __ 18 3.1. Introduction and definition ............................................................................ 18 3.2. A brief history of cryptography ..................................................................... 18 3.3. Basic principles ............................................................................................ 21 3.3.1. Information security and the CIA triad ............................................................. 21 3.3.2. Cryptosystems ................................................................................................ 23 3.3.2.1. Symmetric cryptosystems ..................................................................... 24 3.3.2.2. Asymmetric cryptosystems ................................................................... 25 3.3.2.3. Symmetric vs asymmetric. Which one is better? .................................. 26 3.3.2.4. Kerckhoffs’s principles for cryptosystems ............................................. 27 3.3.3. Attackers and attacks ...................................................................................... 28 3.3.4. Alice and Bob, encryption and decryption and the need for authentication ..... 30 3.4. Public Key Infrastructure (PKI) ..................................................................... 33 3.4.1. Digital certificates and Certification Authorities (CA) ....................................... 33 3.5. Cryptographic algorithms ............................................................................. 35 3.5.1. Hash functions ................................................................................................ 36 3.5.2. Symmetric encryption ...................................................................................... 39 3.5.2.1. Stream ciphers ..................................................................................... 39
Pag. 8 Report 3.5.2.2. Block ciphers ........................................................................................ 40 3.5.3. Asymmetric encryption .................................................................................... 42 4. CRYPTO AUTHENTICATION HARDWARE SOLUTIONS ON THE MARKET ________________________________________________ 45 4.1. Defining our search. Objectives ................................................................... 45 4.2. The cryptographic hardware markets. Companies and distributors............. 46 4.2.1. Companies ...................................................................................................... 47 4.2.2. Distributors ...................................................................................................... 49 4.3. Deciding on a chipset ................................................................................... 49 4.4. ATTEC608A ................................................................................................. 51 4.5. CRYPTOAUTHENTICATION™ SOIC XPRO STARTER KIT ..................... 52 5. ACHIEVING AUTHENTICATION. RESULTS AND DISCUSSION ___ 55 5.1. The importance of authentication and how to achieve it with our device ..... 55 5.1.1. The Sign & Verify algorithm ............................................................................. 56 5.2. Setting up our software and hardware ......................................................... 59 5.2.1. Software .......................................................................................................... 59 5.2.2. Hardware ........................................................................................................ 60 5.2.3. Configuring the ATECC608A .......................................................................... 62 5.3. Achieving authentication with Atmel Crypto Evaluation Studio .................... 63 5.4. Achieving authentication with Python .......................................................... 67 5.4.1. Libraries .......................................................................................................... 67 5.4.2. Functions ........................................................................................................ 68 5.4.3. Results ............................................................................................................ 70 6. PLANNING ______________________________________________ 75 7. ECONOMIC ASSESSMENT _________________________________ 76 8. ENVIRONMENTAL ASSESSMENT ___________________________ 78 9. SOCIAL AND GENDER EQUALITY ASSESSMENT ______________ 79 10. CONCLUSIONS __________________________________________ 80 11. ACKNOWLEDGMENTS ____________________________________ 82 12. BIBLIOGRAPHY __________________________________________ 83 References ............................................................................................................ 83 Additional bibliography .......................................................................................... 87
Hardware alternatives for crypto authentication Pag. 9 Abbreviations ACES – Atmel Crypto Evaluation Studio AES – Advanced Encryption Standard API – Application Programming Interface ASCII – American Standard Code of Information Interchange CA – Certification Authority CAGR – Compound Annual Growth Rate CBC – Cipher Block Chaining CNSS – Committee on National Security Systems CTR - Counter DES – Data Encryption Standard DLL – Dynamic-Link Library DNS – Domain Name System DDoS – Distributed Denial of Service DoS – Denial of Service DSA – Digital Signature Algorithm ECB – Electronic Codebook ECC – Elliptic Curve Cryptography ECDH – Elliptic Curve Diffie-Hellman ECDSA – Elliptic Curve Digital Signature Algorithm ECTS – European Credit Transfer System ETSEIB – Escola Tècnica Superior d’Enginyeria Industrial de Barcelona FIPS – Federal Information Processing Standard
Pag. 16 Report 2. Introduction 2.1. Motivation From the beginning, the primary motivation for this project is the identification, through an analysis of the hardware alternatives on the market, of a cryptographic authentication device that allows an educational purpose for years to come. By studying the different chipsets on the market, and the different cryptographic functions at our disposal, this study seeks to find a device that will allow this student, and others to come, a platform where to delve for the first time into the crypto authentication field. It also served a secondary motivation, which is none other than to satisfy the author’s curiosity about the field. In such a fast-paced technological world, privacy and information security should be a major concern for everyone, and understanding how we can protect ourselves and the technology behind it can hopefully can make a difference. 2.2. Scope This project is structured around the exploration of various key aspects, from the analysis of theoretical foundations to the practical evaluation of a specific selected product. Topics such as the importance of cryptographic authentication, its underlying technologies, and application scenarios will be addressed, culminating in a market analysis and detailed explanation of the selected chip and how it can be used to achieve authentication. 2.3. Prerequisites The requirements for this project are minimal, requiring only access to a computer and the financial means to purchase the designated educational chip. The following requirements are needed: Computer and internet access: In order to ensure the means to research, learn and later use of the software tools linked to the crypto authentication chip. Financial resources: In order to acquire the designated educational crypto authentication chip and allow the practical engagement with it. There is no cryptology field knowledge prerequisite for this project. A basic understanding of Python and coding logic is recommended. These prerequisites have been intentionally kept to a minimum, in order to allow others to
Hardware alternatives for crypto authentication Pag. 17 benefit from this project. 2.4. Objectives The global objective of this project is to study the hardware alternatives for crypto authentication on the market, to further identify a suitable chip for educational purposes. Several other objectives are defined: Provide the reader, as it has been for the author, a soft learning curve to cryptography. From zero knowledge to understanding the basics concepts and goals. Defining and understanding the different kinds of cryptosystems and how they work. What differentiates a symmetric and an asymmetric cryptosystem? Understanding the need and importance of authentication. What other properties and elements are needed in order to deem a system secure? Defining the different types of cryptographic algorithms that are found on today’s market, as well as the ones with a historical significance. Learn to use the development software provided by the company of the chosen chip. Demonstrate the chip capabilities with its in-built functions. Achieve authentication. Demonstrate how authentication can be achieved with the chosen chip, by coding a communication script between the device and the host, the author’s personal computer.
Pag. 18 Report 3. Cryptography: Defining security in communication 3.1. Introduction and definition Cryptography, derived from the Greek words "kryptos" (hidden) and "graphein" (to write), is the art and science of securing communications through encryption, by using mathematical techniques and algorithms. It encompasses the methods used to protect information from unauthorized access, ensuring confidentiality, integrity, authenticity and non-repudiation. At its core, cryptography is the transformation of plaintext (readable data) into ciphertext (encrypted data) using cryptographic algorithms and keys. The process of encryption converts the original message into an unintelligible form, making it accessible only to authorized parties who possess the decryption key. Decryption reverses this process and converts the ciphertext back to plaintext, allowing the intended recipient to understand the message. Figure 3.1: Cryptography process block diagram The National Institute of Standards and Technology (NIST) of the U.S. Department of Commerce defines cryptography as “the discipline that embodies the principles, means, and methods for the transformation of data in order to hide their semantic content, prevent their unauthorized use, or prevent their undetected modification” [1] . Such a broad definition has become necessary over time, as cryptography has evolved from a simple art defined by Cambridge: “The practice of creating and understanding codes that keep information secret” [2], to larger and deeper science, as described in the following chapter. 3.2. A brief history of cryptography Cryptology is a young science. Although it has been used for thousands of years to hide secret messages, the systematic study of cryptology as a science began only about one
Hardware alternatives for crypto authentication Pag. 19 hundred years ago. The earliest evidence of the use of cryptography was discovered in an inscription carved around 1900 BC in the main chamber of the tomb of Khnumhotep II in Egypt. The scribe employed a number of unconventional hieroglyphic symbols in place of more conventional ones. The purpose of this was not to conceal the message, but perhaps to alter its form in a way that would make it appear dignified. Although the inscription was not a form of secret writing, it incorporated some sort of transformation of the original text, and it is the oldest known text to do so. In approximately 100 BC, Julius Caesar is known to have employed a form of encryption to convey secret messages to his army generals stationed at the war front. This substitution cipher, where each character of the plaintext is substituted by another character to form the ciphertext, is known as the Caesar cipher. The variant employed by Caesar involved a shift of three positions, whereby each character was substituted by the character located three positions to the right. For example, the character "A" was replaced by "D," "B" by "E," and so on. As a consequence of this process, the characters would wrap around at the end, resulting in the substitution of "X" by "A." Figure 3.2: Caesar cipher [3]. This kind of ciphers rely on the confidentiality of the system. Once the system is identified, the encrypted messages can be easily decrypted. Substitution ciphers can be compromised by employing the frequency of letters in the language. In the 16th century, Blaise de Vigenère devised a cipher that was the first to employ an encryption key. In one of his ciphers, the encryption key was repeated multiple times throughout the message, after which the cipher text was generated by adding the message character with the key character modulo 26. As with the Caesar cipher, Vigenère's cipher can also be easily deciphered. Nevertheless, Vigenère's cipher introduced the concept of encryption keys, which differed from the Caesar cipher in that the secrecy of the message depended on the secrecy of the encryption key rather than
Pag. 20 Report the secrecy of the system. At the start of the 19th century, Edward Hugh Hebern devised an electro-mechanical apparatus, designated the Hebern rotor machine, which employed a single rotor. This rotor was inscribed with a secret key, which was housed within a rotating disc. The key was utilized to encode a substitution table, and each key press from the keyboard resulted in the output of cipher text. This process also rotated the disc by one notch, thereby enabling the use of a different table for the next plaintext character. The Enigma machine, invented by German engineer Arthur Scherbius at the conclusion of World War I, was extensively utilized by the German military during the Second World War. The Enigma machine employed three or four rotors, which rotated at varying rates as the user typed on the keyboard, outputting the appropriate letters of cipher text. In this instance, the initial setting of the rotors constituted the key. The enigma machine's cipher was cracked by Poland and its technology transferred to the British cryptographers, who devised a method for obtaining the daily key. Prior to the Second World War, the majority of cryptography research was conducted for military purposes, primarily to conceal sensitive military information. However, post-war, cryptography attracted commercial interest, with businesses seeking to safeguard their data from competitors. In the early 1970s, IBM recognized that their customers were demanding some form of encryption. Consequently, they established a "crypto group," led by Horst-Feistel, to develop a cipher. This group designed a cipher called Lucifer. In 1973, NIST issued a request for proposals for a block cipher that would become a national standard. The Lucifer cipher established the foundation for Feistel’s subsequent work, which was ultimately accepted and designated as the Data Encryption Standard (DES) in 1977. In 1976, Whitfield Diffie and Martin Hellman published a research paper on what would be defined as the Diffie-Hellman key exchange [4], where, for the first time, asymmetric encryption was presented and the, mathematically related, key-pair of private and public key explained. The first implementation of a public key cryptosystem was developed by Ronald Rivest, Adi Shamir and Leonard Adleman in 1978 and was designated the RSA algorithm [5]. In 1997, and in the following years, DES was broken by an exhaustive search attack. Given the small size of the encryption key used, as computing power increased, it became relatively simple to brute force all different combinations of the key to obtain a possible plain text message. In 1997, NIST again put out a request for proposal for a new block cipher. It received 50 submissions. In 2001, the Rijndael algorithm was accepted and designated as AES, or
Hardware alternatives for crypto authentication Pag. 21 the Advanced Encryption Standard. Currently, AES is a widely accepted standard utilized for symmetric encryption. In 2005, the Elliptic Curve Cryptography (ECC), which was initially proposed independently by Neal Koblitz and Victor S. Miller around 1985, was announced by the National Security Agency (NSA) as the preferred method for digital signatures. This approach allowed for the use of shorter encryption keys than ever before. Figure 3.3: Cryptography timeline. Source [6] 3.3. Basic principles 3.3.1. Information security and the CIA triad First and foremost, it is important to emphasize that cryptography is merely a tool that serves its purpose on a bigger concept: Information Security (IS). IS is defined by the United States Committee on National Security Systems (CNSS) as "the protection of information and information systems from unauthorized access, use, disclosure, disruption, modification, or destruction in order to provide confidentiality, integrity, and availability." [7]. Cryptography is an essential component of this broader concept, as it enables the achievement of the three primary security objectives outlined in the CNSS definition, commonly referred to as the CIA Triad (data confidentiality, data integrity, and data availability). Confidentiality (C): refers to the property that information is not made available or disclosed to unauthorized individuals, entities, or processes. Cryptographic techniques, such as encryption, can be used to protect the confidentiality of information by making it unreadable to anyone who does not have the proper decryption key. Integrity (I): refers to the ability to ensure that information has not been altered or tampered with. Cryptographic techniques, such as hash functions, can be used to Egypt (1900 B.C.) Caesar Cipher (100 B.C.) Vigenère Cipher (S.XVI) Hebern Rotor Machine (S.XIX) Enigma Machine (WWII) Diffie- Hellman Key exchange (1976) DES (1977) AES (2001) ECC (2005)
Pag. 22 Report ensure the integrity of information by providing a way to detect any changes to the data. Availability (A): refers to the ability to ensure that in any given moment, the information must be available. This means the computing systems used to store and process the information, the security controls used to protect it, and the communication channels used to access it must be functioning correctly. They must remain available at all times, preventing service disruptions due to power outages, hardware failures, system upgrades and also during denial-of-service attacks (DoS), such as a flood of incoming messages to the target system, essentially forcing it to shut down. In following years, two other properties were included, published on ISO-7498-2 [8]: Non-repudiation: refers to the ability to make sure that a person or a party associated with a contract or a communication cannot deny the authenticity of their signature over their document or the sending of a message. Authentication: refers to your systems’ ability to confirm an identity of a user or system attempting to access a resource or perform an action within a computer system or network. Each aspect of the CIA triad represents the foundational principles of information security. Between them, they cover every possible way that sensitive data can be compromised. However, the triad is not merely the sum of its parts; rather, the three components work together to achieve a level of data protection that is greater than the sum of their individual capabilities. Figure 3.4: CIA triad representation. Source [9]. The role of cryptography in the context of IS and the CIA triad is significant. First, it is of
Hardware alternatives for crypto authentication Pag. 23 the utmost importance to maintain all cryptographic and non-cryptographic solutions implemented within our environment up to date. Any flaw or weakness in one of these concepts makes the entire system vulnerable, as a system security is measured from the weakest point that can be exploited. Even if our system has the most sophisticated cryptographic solutions available on the market, a simple social engineering mistake could compromise the security of our data. For instance, a pen drive connected to a random USB port could allow unauthorized access to information that is supposed to be secure. Similarly, a power outage could render our data unavailable. Furthermore, if we fail to upgrade our cryptographic solutions as technology evolves and computation becomes more powerful, our efforts to maintain data security could be rendered ineffective, leaving our information vulnerable. As seen on the previous chapter, the Data Encryption Standard (DES) had to be put aside as computation evolved. The 3DES replaced it and, not much later, also had to be discarded and the Advanced Encryption Standard (AES) was approved as the new standard. Nowadays, as quantum computing starts to become a reality, we can safely predict that AES will end up being not enough as a security standard, as such a leap on computational power, will certainly reduce the difficulty to break any state-of-the-art algorithm from years to days. 3.3.2. Cryptosystems A cryptosystem is a structured set of algorithms that transforms plaintext into ciphertext, thereby enabling the secure encoding and decoding of messages. The term "cryptosystem" is a shorthand for "cryptographic system," which refers to a computer system that employs cryptography, a method of protecting information and communications with codes, ensuring that only those for whom the information is intended can read and process it. In order to maintain the security of data, cryptosystems incorporate algorithms for key generation, encryption, and decryption techniques. At the core of cryptographic operations is a cryptographic key, a string of bits utilized by a cryptographic algorithm to transform plaintext into ciphertext or the reverse. The key is a component of the variable data provided as input to a cryptographic algorithm, enabling the execution of this type of operation. The security of the cryptographic scheme is contingent upon the security of the keys utilized. A basic cryptosystem includes the following: Plaintext (M): Unencrypted information that needs protection. Ciphertext (C): The encrypted, or unreadable, version of the plaintext information. Encryption algorithm (E): The mathematical algorithm that takes plaintext as the input and encrypts to ciphertext. It also produces the unique encryption key for
Pag. 24 Report that text. Decryption algorithm (D): The mathematical algorithm that takes ciphertext as the input and decodes it into plaintext. It also uses the unique decryption key for that text. Encryption key (kE): The value known to the sender that is used to compute the ciphertext for the given plaintext. Decryption key (kD): The value known to the receiver that is used to decode the given ciphertext into plaintext. Figure 3.5: Representation of a cryptosystem. Source [10]. This scheme can be summarized in to two simple equations: Plaintext encryption: 𝐶 = 𝐸(𝑘, 𝑀) (Eq. 3.1) Ciphertext decryption: 𝑀 = 𝐷(𝑘, 𝐶) (Eq. 3.2) Following the scheme in Figure 3.5, confidentiality breaks when a message is intercepted by the attacker, while integrity breaks whenever the attacker usurps the user identity or simply modifies the message sent. Cryptosystems are usually categorized by the method they use to encrypt data, either symmetrically or asymmetrically. 3.3.2.1. Symmetric cryptosystems This kind of cryptosystem uses the same key for both encryption and decryption. In this method, keys are shared with both parties prior to transmission and the security of the system relies on the secrecy of the shared key. Symmetric cryptosystems are also sometimes referred to as secret key cryptosystems.
Hardware alternatives for crypto authentication Pag. 25 Some symmetric key encryption methods, which will be later explained in following chapters, are DES and AES. Figure 3.6: Representation of a symmetric cryptosystem. Source [10]. If the secret key is kept private, then confidentiality and integrity are achieved. An implicit requirement of this system is the trust between the sender and the receiver. It is highly recommended that keys between parties are changed regularly in order to prevent any attack. Also, a robust mechanism must exist to exchange the secret key. These two recommendations can make this mechanism become expensive and cumbersome. The length of the key required is smaller than the one needed on asymmetric cryptosystems, thus making the whole process faster and less computational power extensive. 3.3.2.2. Asymmetric cryptosystems This kind of cryptosystem uses different keys for encryption and decryption. In this method, every user of the system needs to have a pair of dissimilar keys, a private key and a public key. The keys have to be mathematically related, making it feasible to retrieve the plaintext by decrypting the cyphertext. The private key must be kept secret and personal. While the public can be put on a public repository shared between users. Hence, asymmetric cryptosystems are also sometimes referred as public key encryption. Though public and private keys of the user are related, it is computationally not feasible to find one from another. This is a strength of this scheme.
Pag. 32 Report message as authentic. If not, it indicates that the message may have been altered or tampered with during transmission. Symmetric MACs provide authentication and integrity assurances, as they require both the message and the secret key to produce and verify the MAC tag. This ensures that only parties with knowledge of the secret key can generate and verify valid MAC tags, thus providing a means of verifying the authenticity of the message. Figure 3.10: Symmetric MAC authentication. Source [18]. On asymmetric (public-key) cryptography, digital signatures are the usual method to provide authentication. They involve the use of a public-private key pair. The process, known as “Sign & Verify”, is as follows: Each party, Alice and Bob, generates a key pair consisting of a private key and a corresponding public key. The private key is kept secret and known only to its owner, while the public key is distributed freely. To sign the message Alice first generates a cryptographic hash of the message using a hash function. Alice then encrypts this hash using their private key, creating the digital signature. This process ensures that only the sender, with access to the private key, could have produced the signature. Bob receives the message, the digital signature, and Alice’s public key. Bob decrypts the digital signature using the sender's public key, revealing the original hash value. Bob computes the hash of the received message using the same hash function. If the computed hash matches the decrypted hash from the digital signature, it indicates that the message has not been altered in transit and that it was indeed
Hardware alternatives for crypto authentication Pag. 33 signed by Alice. Figure 3.11: Asymmetric Sign & Verify. Source [18]. By using digital signatures, the next properties can be assured: Authentication: The recipient can verify the identity of the sender by validating the digital signature. Integrity: Any alteration to the message will result in a mismatch between the computed hash and the decrypted hash from the digital signature. Non-repudiation: The sender cannot deny having signed the message, as the signature provides evidence of their involvement. 3.4. Public Key Infrastructure (PKI) Public Key Infrastructure, or PKI, can be defined as “the set of hardware, software, policies, processes, and procedures required to create, manage, distribute, use, store, and revoke digital certificates and public-keys” [19]. As seen before, with the development of the asymmetric cryptosystems and managing of public keys repositories, PKIs have become essential in order to ensure secure and trusted environments, in the likes of e-commerce or the growing Internet of Things (IoT). Even with asymmetric encryption, the risk of eavesdropping exists. For example, what if someone intercepted Bob’s public key, made his own private key, and then generated a new public key for Alice? In this case, Alice would encrypt messages for Bob, Eve could decrypt them, modify them and then re-encrypt them and neither Alice nor Bob would be any wiser. 3.4.1. Digital certificates and Certification Authorities (CA) PKI solves this challenge by issuing and managing digital certificates that confirm the
Pag. 34 Report identity of people, devices or applications that own private keys and their corresponding public keys. In short, PKI assigns identities to keys so that recipients can accurately verify the owners. This verification gives users confidence that when they send an encrypted message to that person, the intended recipient is the one who will actually read it, and not someone else who might be eavesdropping on the entire exchange. Digital certificates are based on the ITU standard X.509 [20], which defines a standard certificate format for public key certificates and certification validation. Hence, digital certificates are sometimes also referred to as X.509 certificates. The user client's public key is stored in digital certificates by the Certification Authority (CA) along with other relevant information such as client information, expiration date, usage, issuer, etc. The CA digitally signs all this information and includes the digital signature in the certificate. Anyone who needs to verify the public key and associated client information performs the signature validation process using the CA's public key. Successful validation ensures that the public key specified in the certificate belongs to the person whose details are specified in the certificate. Figure 3.12: Illustration of the process of obtaining a digital certificate. Source [21]. As depicted in Figure 3.12, the CA takes responsibility for identifying correctly the identity of the client asking for a certificate to be issued and ensures that the information contained within the certificate is correct and digitally signs it. But what happens when the networks are huge and communications are countless, as they are today? It is practically impossible to have only one trusted CA from which all users obtain their certificates. Moreover, having only one CA could lead to immense problems if it were to be compromised. The solution is to develop a hierarchical
Hardware alternatives for crypto authentication Pag. 35 certification model that allows digital certificates to be used in environments where Alice and Bob do not have trust relationships with the same CA. It is important to note that in a hierarchical solution, the root certificate is self-signed. As a result, people must trust the root CA, in order to trust any certificates that trace back to it. Should a root CA become compromised, the organization must make the security breach public. As a result, root CAs have the most stringent security measures. 3.5. Cryptographic algorithms Cryptographic algorithms are usually classified in three main categories: hashes, symmetric and asymmetric. This classification is based on the specific functions and purposes of each type. Under these main categories, sub-categories arise as different approaches to a same problem are used, leading to multiple kind of algorithms. Figure 3.13 shows a classification of the most important algorithms used today and in the past. Figure 3.13: Classification of cryptographic algorithms. Source [22] Many other algorithms exist for each branch. In this project, however, only those shown in Figure 3.13 will be presented and discussed, given their historical importance or their relevance nowadays. Cryptography is an extremely deep and intricate field and, given the Cryptographic algorithms Hashes - Message Digest (MD) - Secure Hash Function (SHA) Symmetric encryption Block Ciphers - DES - AES Stream Ciphers -RC4 - ChaCha20 Assymetric encryption - RSA - Elliptic Curve Cryptography (ECC)
Pag. 36 Report zero knowledge of the author beforehand and the limited time, this project its only able to scrape its surface. Behind all these cryptographic algorithms, a complex and deep mathematical background exists. An extensive bibliography can be easily found on the internet if anyone desires to delve and dig deeper into each of the mathematical functions behind them. For this project several papers and publications have been loosely read in order to gain some knowledge on the mathematical foundations of the later discussed algorithms. They can be found on the additional bibliography chapter. 3.5.1. Hash functions First and foremost, it is imperative to understand that Hash functions cannot be considered an encryption function, as they must have the feature of not being reversible. This means that after performing a hash function on any given data, converting the hash code obtained to the original value, or decrypting it, must be an impossible task to perform. This is the main difference between a hash function an encryption. But what is a hash function? A hash function is none other than a series of mathematical functions in which, given any data input of variable length, converts it into another compressed data value, of fixed length. Values returned, or output, by a hash function are usually called message digest or hash values. Figure 3.14 illustrates the hash function: Figure 3.14: Depiction of a hash function. Source [23]. Hash values or message digests are a character string that uniquely identifies a given data, like fingerprints are to humans. Any change on the original data will result on a completely different digest. Hash functions are based on a mathematical function that operates on two fixed-size blocks of data to create a hash code. This function lays at the heart of hashing algorithms. The size of each data block treated by the function, depends on the algorithm. Typically, the block sizes range from 128 bits to 512 bits.
Hardware alternatives for crypto authentication Pag. 37 Figure 3.15: Mathematical function at the heart of hash algorithms. Source [23]. This process, as depicted in Figure 3.16, is repeated as many times as needed in order to process the whole message M. Each round takes an input of a fixed size, typically a combination of the most recent message block and the output of the last round. The first two blocks consist of the first message block of the input M and the seed of the given hash. Figure 3.16: Diagram of a hashing algorithm. Source [23]. An avalanche effect is produced during the hashing. Since the hash of the first message block becomes an input of the second hash operation, and so on, any change on a single bit of the input data, will result in substantially different hash values for those, almost identical, messages. The features and properties of the hash functions can be resumed as follows: Non-reversible: Hash functions are designed to be a one-way function, meaning that it must be computationally impossible to find M knowing h(m). This property makes hash functions useful for verifying the integrity of data. Also storing passwords or other sensitive information, as the original input cannot be
Pag. 38 Report recovered from the hash value. Deterministic: Given the same input, the output will always be the same. This makes hash functions useful for verifying the authenticity of data. Fixed-sized output: Regardless of the size of the input, the message digest will always have the same length. Hence hash functions are sometimes called compression functions. Collision resistance: It must be near impossible to find two different inputs M1 and M2 that produce the same input. This property ensures that attackers cannot create a false message that has the same hash value as a legitimate message. It is also important to note that hash functions are designed to be fast to compute, which makes them useful for a variety of applications where efficiency is important. On the other hand, hash functions are vulnerable to collision attacks, as it is not impossible to have the same hash with two different inputs. Even though they are designed to avoid and make near impossible the collision of two inputs, throughout the years, since their first implementation, collision attacks have rendered vulnerable some old hash algorithms, such as the MD5. All algorithms that have been found vulnerable are no longer recommended for use. Throughout the years, the most popular hash functions have been the Message Digest (MD) and the Secure Hash Function (SHA) families. Message Digest (MD) The MD family comprises the hash functions known as MD2, MD4, MD5 and MD6. It is 128-bit function. MD5 was the most popular and widely used function for quite some years. As such, it was adopted as Internet Standard RFC 1321. However, in 2004, collisions were found in MD5. An analytical attack was reported to be successful only in one hour by clustering computers to have huge computational power. As a result of the successful attack, once it was rendered compromised, MD5 was no longer recommended for use. Secure Hash functions (SHA) The SHA family comprises the hash functions known as SHA-0, SHA-1, SHA-2 and SHA- 3. In 1993, the original version SHA-0 was published by NIST. It was a 160-bit function, which had known weaknesses. In 1995, SHA-1 was designed in order to correct those weaknesses.
Hardware alternatives for crypto authentication Pag. 39 SHA-1 was widely used up to 2005, when collisions were discovered, making long-term employability doubtful. SHA-2 family has four further versions depending on the number of bits in their hash value. SHA-224, SHA-256, SHA-384 and SHA-512. No successful attacks have yet been founded on them. However, as SHA-2 design follows its predecessor, NIST called for a new competitive hash function design. In August 2015, NIST presented the SHA-3 [24], based on the new Keccak algorithm. It offers and efficient performance and, as of today, good resistance to attacks. 3.5.2. Symmetric encryption Symmetric encryption, as presented already in chapter 3.3.2.1 when introducing symmetric cryptosystems, is a fundamental cryptographic technique where the same key is used for both encryption and decryption of the data. It is also known as secret key encryption or conventional encryption. As explained before, it relies on a shared secret key that must be known, only, by the sender and the receiver of the message. Its robustness against attacks relies, basically, in the secrecy of the key. Symmetric encryption algorithms can be classified into two main categories based on their operation: block ciphers and stream ciphers. Each one of them has its own characteristics, advantages and drawbacks, making them suitable for different applications and scenarios. 3.5.2.1. Stream ciphers Stream ciphers operate one bit or byte at a time, processing each element of the plaintext stream individually, producing a stream of ciphertext. Stream ciphers generate a keystream, which is a sequence of pseudorandom or random bits, using a key and an initialization vector (IV). The keystream is combined with the plaintext using a bitwise operation (usually XOR) to produce the ciphertext. They are often more efficient in terms of speed and memory usage compared to block ciphers. On the other hand, they can be vulnerable to plaintext attacks of stream cipher attacks, if the keystream is predictable or reused. Throughout the years, the most common stream ciphers have been the Rivest Cipher 4 (RC4) and the ChaCha20.
Pag. 40 Report Rivest Cipher 4 (RC4) The RC4 stream cipher was designed by Ronald Rivest in 1987. It became wildly popular due to its simplicity and speed. RC4 generates a pseudorandom keystream based on the secret key that the user provides. This keystream is then combined with the plaintext using bitwise XOR to produce the ciphertext. The keystream generation process involves a key scheduling algorithm (KSA) that initializes the internal state of the cipher based on the secret key. Given the simplicity and efficiency, RC4 was well-suited for any application that required real-time encryption. However, RC4 was found to have vulnerabilities over time, deprecating it in favor of more secure and state-of-the-art algorithms. ChaCha20 The ChaCha20 stream cipher was designed by Daniel J. Bernstein in 2008 [25]. It is an evolution of the Salsa20 algorithm, providing higher security and efficiency. ChaCha20 generates a pseudorandom keystream based on a secret key, a nonce (number used once), and a counter value. It uses a 256-bit secret key and a 64-bit nonce and a 32-bit counter value to generate the keystream. This counter value is incremented for each block encrypted, ensuring that the keystream remains unpredictable and nonrepeating. The combination of the key and nonce ensures the uniqueness of the keystream for each encryption session. This keystream is then combined with the plaintext using bitwise XOR to produce the ciphertext. ChaCha20 is regarded as a secure algorithm, as it has not been successfully attacked. 3.5.2.2. Block ciphers Block ciphers operate fixed-size blocks of plaintext, typically 64 or 128 bits long, into ciphertext. The plaintext is divided into blocks, which are independently encrypted using the same private key. Though any size of block is acceptable, the following recommendations are important while selecting the size of a block: Multiples of 8 bits: As most computer processors handle data in multiple of 8 bits, it is recommended that a block size multiple of 8 is selected. Avoid very small blocks: Given a m bit block size, the possible plaintext combinations are then 2m. If the attacker knows plain text blocks of some previously sent ciphertext, then a successful attack can be achieved by building up a dictionary of plaintext/ciphertext pairs sent using that encryption key. A larger
Hardware alternatives for crypto authentication Pag. 41 block size makes this kind of attack, known as “dictionary attacks”, much harder. Avoid really large blocks: As the block size growths, so does the computational power needed to encrypt it, rendering inefficient the algorithm. The fixed block size characteristic of this kind of encryption makes it necessary to introduce the concept of padding. The length of the plaintext is usually not a multiple of the block size, making necessary to add bits at the last block in order to match the desired block size. Padding can also enhance security by mitigating certain cryptographic attacks, such as padding oracle attacks. Block ciphers operate in different modes, such as Electronic Codebook (ECB), Cipher Block Chaining (CBC), Counter (CTR), and Galois/Counter Mode (GCM). These modes determine how the blocks are combined and encrypted and, by doing so, providing different security properties for each mode. Throughout the years, the most important block cipher algorithms have been the Data Encryption Standard (DES) and the Advanced Encryption Standard (AES). Data Encryption Standard (DES) The Data Encryption Standard was developed in the early 1970s by IBM and published by NIST [26]. It is one of the earliest and most-well known symmetric algorithms. It is based on the Feistel cipher, which was the first block cipher developed. DES operates on 64-bit long blocks and uses a 56-bit key. The real key-length is also 64- bits, but since 8 of the 64 bits of the key are not used in the encryption algorithm, only 56 are considered. It uses a 16 round Feistel structure, which is a two-block operation, meaning that in each round of encryption, left and right halve of the data are processed independently. The operations are as follows: 1. Initial permutation: The plaintext receives an initial permutation, rearranging the bits according to a predefined permutation table. 2. Key generation: The 56-bit key is expanded and modified to produce sixteen 48- bit keys, one for each round. 3. Encryption: For sixteen rounds, encryption is performed, involving cryptographic operations such as expansion, key mixing, substitution and permutation. 4. Final permutation: After the last round, the left and right halves of the data are swapped, and the final permutation is applied to produce the ciphertext. Even though DES withstood decades as a strong and secure algorithm, the advances on computational power rendered it ineffective. Nowadays, its evolved form (3DES) is still used.
Pag. 48 Report secure elements and cryptographic co-processors. Two NXP products were considered in the decision process [40], the EdgeLock A5000 and the EdgeLock SE050. Resources for them can be found on its corresponding page and also a developer kit is offered for the SE050, making it a serious contender. STMicroelectronics (STM) STMicroelectronics, commonly referred as STM, is a global semiconductor company [41]. Headquartered in Geneva, Switzerland, it was founded in 1987 as a merger between SGS Microelettronica (Italy) and Thomson Semiconducteurs (France). Its portfolio offers diverse cryptographic hardware solutions, including microcontrollers, cryptographic accelerators and hardware security modules. A total of 13 products [42] were considered for our project. Each of them had their datasheets available, as well as other resources, on their product page. A developer kit, related to the ST33 family products, is also offered on their site, making them a contender for our project. Infineon Technologies Infineon Technologies is a leading semiconductor manufacturer specializing in semiconductors, sensors and security solutions [43].Headquartered in Neubiberg, Germany, it was founded in 1999 as a spin-off from Siemens semiconductor division. They offer a range of cryptographic hardware solutions, including secure microcontrollers, cryptographic co-processors and hardware security modules. A total of 17 products [44], from the SLE and SLM families, were considered as possible suitors for this project. Permission to access datasheets and other resources had to be asked, in order to have them available. No developer kit was found for both family products considered, making them less desirable for us. Samsung Samsung, one of the giant global technology conglomerates in the world, offers, among many other things, semiconductor solutions [45].Headquartered in Seoul, South Korea, Samsung was created in 1938 by Lee Byung-Chul, as a trading company. It later diversified into various industries, including electronics. Ranging from secure communication, data protection to authentication, Samsung offers several cryptographic hardware solutions. A total of 5 products [46] were considered suitable for our work, the S3 family. However,
Hardware alternatives for crypto authentication Pag. 49 no datasheets were available to the public and no developer kit was found, making them not desirable for us. Other companies were considered, such as Renesas Electronics Corporation [47], Texas Instruments Incorporated [48] and Toshiba Electronic Devices & Storage Corporation [49]. No suitable cryptography solutions were found on them for our work. 4.2.2. Distributors Once a shortlist of cryptographic chips and its developer or starter kits was done, prices were looked up from the following distributors, as a recommendation from the director of this project. Farnell Mouser Electronics Digi-key Electronics RS Components 4.3. Deciding on a chipset Once studied the multiple options available on the mentioned companies, a short list or final list was made, based on the objectives defined in chapter 4.1. A total of seven chips were considered as the finalists. The final decision was consulted and decided with the supervisor, as the chip would be ordered by the ETSEIB. Table 4-1: Short list of chips considered for the project. Chip Company Cryptographic Functions Developer kit Worked before? DS28E36 Maxim SHA-256 ECDSA ECDH MAC HMAC DS28E36EVKIT Company DS28C36 Maxim SHA-256 DS28E36EVKIT Chip and company
Pag. 50 Report ECDSA ECDH HMAC DS28S60 Maxim SHA-256 AES ECDSA ECDH DS28E36EVKIT Company ATECC608A Microchip SHA-256 ECDSA ECDH AES-GCM MAC SOIC XPRO STARTER KIT No EdgeLockSE050 NXP SHA-256 ECC RSA AES 3DES HMAC OM-SE050X No ST33TPHF20SPI STM SHA-256 ECDAA ECDH RSA AES STPM4RasPI No ST33PHF2XI2C STM SHA-256 ECDSA STPM4RasPI No
Hardware alternatives for crypto authentication Pag. 51 ECDH RSA AES The DS28 chipset family by Maxim, as attractive as it was, given the number of open resources available, was discarded as previous work had been done with them at the ETSEIB, specifically with the DS28C36 [30][34]. So, given the similarity of the other four options on its characteristics and cryptographic functions, as well as the similarities on its prices and it not being the most important factor, what end up being the deciding one between the other four? The final decision came down to the open and public library offered by Microchip for working with their chips, the ATECC608 family. The CryptoAuthLib, a library for interacting with the crypto authentication secure elements of Microchip, can be found as a GitHub public repository [37] with all its information and examples. Also, the fact that a part of this public library is coded in Python was kept in mind, as it is the coding language that the author is more comfortable with. Moreover, a whooping total of 36 documents can be accessed and consulted on the product page, ranging from its own datasheet to other applications done with the chip. Having the possibility to consult all this information for this project and, especially, future educational projects was the cherry on top, in order to decide. Finally, a CRYPTOAUTHENTICATION™ SOIC XPRO STARTER KIT containing the ATECC608A was ordered from RS Components for a total of 177,31 €. 4.4. ATTEC608A Although a newer version on the ATTEC608 family exists, the ATTEC608B, the ATTEC608A has been the chip studied, as it is the one included in the development kit manufactured by Microchip. Moreover, the devices supported by the python CryptoAuthLib package are [50]: ATSHA204A ATECC108A ATECC508A ATECC608A The fact that the ATECC608B is not supported by the library, was also a deciding factor on not buying the latest version of the ATECC608 chipset family.
Pag. 52 Report Manufactured and deployed by Microchip, the ATECC608A is a secure element in Microchip's cryptographic authentication portfolio. It is NIST and FIPS compliant. Its main features are as follows: Cryptographic co-processor with secure hardware-based key storage: o Protected storage for up to 16 keys, certificates or data Hardware support for asymmetric sign, verify and key agreement: o ECDSA: FIPS186-3 Elliptic Curve Digital Signature o ECDH: FIPS SP800-56A Elliptic Curve Diffie-Hellman o NIST Standard P256 Elliptic Curve Support Hardware support for symmetric algorithms: o SHA-256 & HMAC Hash including off-chip context save/restore o AES-128: Encrypt/Decrypt, Galois Field Multiply for GCM Internal high-quality NIST SP 800-90A/B/C Random Number Generator (RNG) Unique 72-bit serial number Two interface options available: o High-speed single pin interface with one GPIO pin o 1 MHz standard I2C interface Its applications, as explained in its datasheet, are: IoT network endpoint key management & exchange Encryption for small messages and PII data Secure Boot and Protected Download Ecosystem Control, Anti-cloning An extensive description of the chip, its cryptographic operations, its applications and characteristics can be consulted on its datasheet, which can be found in Annex A.1. 4.5. CRYPTOAUTHENTICATION™ SOIC XPRO STARTER KIT The CRYPTOAUTHENTICATION™ SOIC XPRO STARTER KIT, manufactured and deployed by Microchip is latest addition to the crypto authentication evaluation kits of the company’s portfolio. Its intended use is exploring and interfacing crypto authentication devices in Windows, Linux and Mac environments. The starter kit comes ready to “plug and play”. It is recommended having a first look at it using the Atmel Crypto Evaluation Studio (ACES) by Microchip, a suite of PC-based software tools to configure and demonstrate the Microchip crypto authentication family of devices. The only requirement is to have installed a 6.0.3 ACES version, or higher, on
Hardware alternatives for crypto authentication Pag. 53 your PC. Figure 4.2: CryptoAuthentication SOIC Starter Kit. Source [51]. The kit consists of the SAMD21 Xplained Pro board and the AT88CKSCKTSOIC-XPRO socket board. The SAMD21 Xplained Pro is the blue board and the AT88CKSCKTSOIC- XPRO is the red board. A micro-B to type-B USB is also included in the kit. Three units of each of the following chips, are included along the boards and USB cable: ATECC608A ATECC508A ATSHA204A ATAES132A The SAMD21 Xplained Pro board comes already pre-programmed with Microchips protocols, in order to ensure communication between the device and the host. When transferring data between the kit and the PC, the status led on the SAMD21 board, will flash green. The board comes with two mini-USB ports, the TARGET USB, which will allow us to “plug and play”, as it comes pre-programmed, and the USB EDBG debug port, which allows data packets monitoring, as well as firmware upgrades if needed. The AT88CKSCKTSOIC-XPRO board can be connected to the SAMD21 Xplained Pro Board to the EXT1 or EXT2 extension headers. It should not be connected to the EXT3 header. In order to match with the desired interface, the I/O Interface Selection Switches on the top side of the AT88CKSCKTSOIC-XPRO board have to be correctly selected. For a detailed explanation of the features and functions of the kit, please refer to its datasheet, which can be found in Annex A.2.
Pag. 54 Report Further explanation on how to get started with the kit will be done on the following chapter. Figure 4.3: CryptoAuthentication SOIC Starter Kit key features. Source [51].
Hardware alternatives for crypto authentication Pag. 55 5. Achieving authentication. Results and discussion 5.1. The importance of authentication and how to achieve it with our device In the course of this report, authentication has already been defined in chapter 3.3.1 as: The systems’ ability to confirm an identity of a user or system attempting to access a resource or perform an action within a computer system or network. Authentication is therefore necessary to ensure that an entity attempting to access information or perform an action within our cryptosystem is who or what it claims to be. Without it, we cannot be sure that our data has not been tampered with. Several forms of authentication have been introduced. Message Authentication Codes (MAC) for symmetric cryptosystems and Digital Signatures Algorithms (DSA) for asymmetric cryptosystems. With them, authentication is achieved, but security is not complete. With symmetric cryptosystems, the robustness of the systems relies on the security of the private key shared between the parties, which may not always be as secure as desired. Algorithms such as ECDH are designed to provide a shared secret between the parties, allowing them to use that secret as the private key for the session, thus achieving a higher level of security. In asymmetric cryptosystems, the robustness of the systems rests on the ability to ensure that the key pair of private and public keys of one of the parties actually comes from that party. Without confirmation or identification of the parties, complete security cannot be guaranteed. PKI is designed to provide an identity to these key pairs, ensuring the identification of each of them. Digital certificates and Certificate Authorities provide this final layer of security. So how do we achieve authentication with our device, the ATECC608A chip, and the CryptoAuthentication SOIC Starter Kit? To reach the higher level of security, a Sign & Verify algorithm will be used to achieve authentication. In addition, a unique digital certificate is obtained from our device, demonstrating its ability to obtain an X.509 certificate by communicating with a certificate authority and submitting a given certificate, providing the device with its unique
Pag. 56 Report identification. By performing a Sign & Verify algorithm, we will not only ensure authentication. Integrity and non-repudiation are also achieved. 5.1.1. The Sign & Verify algorithm The two communicating parties involved in this Sign & Verify algorithm will be the ATECC608A, doing the device part, and the author’s PC, impersonating the host part. Although the common nomenclatures of “Alice and Bob” or “sender and receiver” have been used on the report up to this point, Host and Device will be the ones used from now on in order to ensure clear description of the process. ATECC608A Device Author’s PC Host As its name implies, a Sign & Verify algorithm can be described as the sum of two parts that are performed on different parts of the cryptosystem. The signing process will be performed on the device. The verification process will be performed on the host. Both the device and the host must have their own mathematically related key pair of private and public keys. The private keys must be kept secret and the public keys must be placed in a public repository for easy access by the other party. Once this is done, the Sign & Verify algorithm for achieving authentication can begin. Device – Signing with ATECC608A o Input: The input to the signing process will be, in this case, a salutation message from the device to the host. A random string option could also be used. The private key of the device is also considered part of the input, as it is imperative to the algorithm o Hashing: The first step of the algorithm will be hashing the message from the device using a cryptographic function, in this case a SHA-256. This will produce a fixed-length digest or hash value that uniquely identifies (given high improbability of collision) the input message. o Encryption: The device private key will then be used to encrypt the digest producing the desired digital signature, a unique cryptographic representation of the device message. o Output: The output to the signing process will be the digital signature, which will be attached to the original message.
Hardware alternatives for crypto authentication Pag. 57 Figure 5.1: Block diagram of the signing process within our device. Host – Verifying with own’s PC o Input: The input to the verifying process will include the original message, the digital signature and the public key corresponding to the private key used by the device for signing. o Hashing: Similar to the hashing made in the signing process, the host will hash the original salutation message received using the same cryptographic hash function employed during signing, in this case SHA- 256. o Decryption: The digital signature received as input will be decrypted using the public key mathematically related to the private key, and usually obtained via a public repository. This step retrieves the original hash value generated during signing and that uniquely identifies (given high improbability of collision) the original message. o Comparison: The digest or hash value obtained from the decrypted signature will be then compared to the hash value computed from the original data. If the two digests match, it will indicate that the data has not been tampered with since its signing and authentication will be ensured! o Output: The output of the verification process will be a Boolean. If true (signature is valid) authentication will be ensured as the data hasn’t been tampered with, and false (signature is not valid) if otherwise.
Pag. 64 Report Figure 5.9: ACES Help section. The main window of ACES displays several information zones. A navigation area, where you can select the slot you want to visualize and, if allowed, write its data. A configuration zone, where you can check the data and configuration of the selected slot. Lock status and system status, which provide information about the status of the device. And a communication log, where all the information, inputs, functions and outputs of the given commands are written. These zones can be further customized from the View menu. Since we have already configured the ATECC608A for use, there is no need to write data to any of the device slots. Figure 5.10: ACES main window.
Hardware alternatives for crypto authentication Pag. 65 On the tool’s menu, different options are given, some of them being: Write zone: Allows to write data in bytes to different addresses and blocks of the device. Command builder: Allows to send commands to the device. Many commands are available and further explained on the Help section of ACES. Validate MAC: Allows to run a Message Authentication Code algorithm. Figure 5.11: ACES validated MAC challenge. Crypto Calculator: Allows to run and demonstrate cryptographic algorithms such as SHA-256, SHA-1, AES-128 and others Finally, there is also a Sign & Verify tool, that allows us to achieve the desired authentication by running it. First a message is introduced. The desired character encoding can be selected. In this case ASCII is chosen. SHA-256 is selected as the hash function to be run to obtain the
Pag. 66 Report hash value needed to obtain the digital signature. In this case, the same message and encoding are used when using ACES and in the encoding section, which gives us, as it should, the same message digest, a unique identification of our message, proving the main feature of hash functions. Given the following message Hello user's personal computer! How are you doing? The unique message digest obtained after an ‘ASCII’ encoding and a SHA-256 function used is: CE B6 45 B5 3F C2 A3 F3 66 E0 1C 57 BE 1F 7F 77 CB 22 5C F9 43 58 C1 EC F9 13 2F 36 CE 7C B3 AD Next, key slot 0 is selected because this is where the device's private key resides. A message signature, or digital signature, is obtained. This digital signature is different each time encryption is performed on the same message digest. Finally, a public key is generated from the signing private key using a P256 ECC curve. Figure 5.12: ACES verified Sign & Verify function.
Hardware alternatives for crypto authentication Pag. 67 If everything is done correctly, the program will verify that the message has not been tampered with and, thus, authentication in achieved. 5.4. Achieving authentication with Python This section follows the same process, but from a coding perspective. All code used and written in Python can be found in Annex B. No code is shown here, just the results of the different scripts executed. Besides the CryptoAuthLib from Microchip, three scripts from the CryptoAuthTools GitHub public repository, have been used to help. No modifications have been made to them. The first, named common.py, is used to define helper functions for the CryptoAuthLib examples. The second, create_csr.py, allows the creation of a Certificate Signing Request for subsequent communication with a CA. It is used as a demonstration example only. The last one, named sign_verify.py defines the various functions used to run the Sign & Verify algorithm. These scripts will be imported in order to use the different functions in our scripts. 5.4.1. Libraries A brief explanation for each of the libraries called on this section of code, and for the configuration and tests part: CryptoAuthLib This library implements the APIs required to communicate with our Microchip Security device, the ATECC608A. The family of devices supported currently are: ATECC608B, ATECC608A, ATECC508A, ATECC108A, ATSHA204 and ATSHA206A. Most of the library is written in C code. Nevertheless, a smaller Python version is offered as well, which is the one called and imported. Cryptography Cryptography [54] is a package which provides cryptographic recipes and primitives to Python developers. Includes both high-level recipes and low-level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions Pytest Pytest [55] is a Python testing tool that helps the developers test its code, helping them on writing better programs. It allowed us to test the CryptoAuthLib against our device.
Pag. 68 Report Ctypes Ctypes [56] is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python, allowing our code to call and use functions of the C section of CryptoAuthLib. Base64 Base64 [57] provides us with functions to encoding binary data to printable ASCII characters and decoding such encodings back to binary data. 5.4.2. Functions The following functions are called during the code: init_device It initializes our device, by getting the default configuration, checking if the device is connected to a Raspberry Pi, which is not in our case, checking the device type, as the library supports different ones, and obtains the device’s public key. It takes the specific names used for calling the device being used, in this case eccx08 and kithid, and returns its public key. Figure 5.13: init_device function block diagram. sign_device Signs the message from the device. It takes the message digest and slot in which the private key is stored and returns the digital signature. Figure 5.14: sign_device function block diagram.
Hardware alternatives for crypto authentication Pag. 69 verify_device Verifies a received digital signature using the device. It takes the original message, the digital signature and the public key related to the private key used to sign the message digest by the host, and returns a Boolean indicating if TRUE if verified. Figure 5.15: verify_device function block diagram. sign_host Signs the message from the host. It takes the message digest and the private key and returns the digital signature. Figure 5.16: sign_host function block diagram. verify_host Verifies a received digital signature using the host software. It takes the message digest, the digital signature and the public key related to the private key used to sign the message digest by the device, and returns a Boolean indicating TRUE if the valid. Figure 5.17: verify_host function block diagram. csr Taking the specific names for calling the device, in this case ecc and hid, prints the certificate associated to the device. Uses a X.509 CSR builder to create the certificate
Pag. 70 Report template in order to comply with the Certification Authorities. Figure 5.18: csr function block diagram. 5.4.3. Results With this functions, three different scripts have been written: Dev_info_and_csr.py This simple script, given the coding names for the device, eccx08 and kithid, prints the device type, its serial number, the public key associated to the private key, located on socket number 0, and it ends by printing the certificate associated to this device, allowing identification with a CA. Figure 5.19: dev_info_and_csr.py script block diagram. It prints as shown in Figure 5.20:
Hardware alternatives for crypto authentication Pag. 71 Figure 5.20: Dev_info_and_csr.py results. It is meaningful to note that the serial number is unique to our device and the public key will stay the same, as the same method is employed each time we call it, to derive it from the private key of our ATECC608A. sign_verify_from_device.py This script performs a sign and verify algorithm with the ATECC608A sending the known message to the author PC. It starts by obtaining the public key by running the init_device function. It follows by printing the public key and the same message as the one used on ACES. Hello user's personal computer! How are you doing? It encodes it to a byte array, and by performing a SHA-256 function, gets and prints the unique message digest that identifies the previous message. CE B6 45 B5 3F C2 A3 F3 66 E0 1C 57 BE 1F 7F 77 CB 22 5C F9 43 58 C1 EC F9 13 2F 36 CE 7C B3 AD
Pag. 72 Report Calls the sign_device function, introducing the digest and the slot where the private key is located, 0, and prints the digital signature. It ends up by calling verify_device, taking the original message in bytes, the digital signature and the public key associated to the private key of the ATECC608A and returning TRUE if the data has not been tampered with. If verified, a message is printed indicating authentication. If not, a message is printed alerting that an attack has been successful and data should not be trusted. Figure 5.21: sign_verify_from_device.py script block diagram. It prints as shown in Figure 5.22: Figure 5.22: sign_verify_from_device.py results. Authentication is achieved!
Hardware alternatives for crypto authentication Pag. 73 sign_verify_from_host.py Following the author’s coding curiosity, this script has been made to demonstrate how the key-pair of private and public key, for a personal computer, are created and treated. The process is really similar to the one followed on the previous script; however, no private key is allocated in the author’s personal computer. By calling the function generate_private_key from the cryptography library, specifically the asymmetric primitives, a private key is generated, from which derive the related public key. Once the key-pair is obtained, the host sends a message to the device: Hello ATECC608A! How are you doing? It encodes it to a byte array, and by performing a SHA-256 function, gets and prints the unique message digest that identifies the previous message. C9 0F 97 28 0A 53 07 72 F6 C1 0F AA 33 D6 AA F4 12 F2 C6 2B 71 0C EC 0C CD DE 5E 18 69 F6 35 19 Note that this digest is completely different to the ones gotten before, as the message is different. It follows by calling sign_host, which obtains the digital signature related to the message, by entering the hash value and the private key of the host. Finally, through the verify_host function, authentication is validated if the hash value that the device obtains by hashing the original message, with the same hash function, equals the hash value obtained by decrypting the digital signature with the public key of the host, mathematically related to the private key used before. Equal to the previous script, authentication is verified if the function returns TRUE. A message indicating the validation is printed in that case. If not TRUE, a message is printed advising precaution as the data has been tampered with. Figure 5.23: sign_verify_from_host.py script block diagram.
Pag. 80 Report 10. Conclusions This project began with the clear objective of identifying a chip in the current cryptographic authentication market that would allow for an educational purpose, not only for this student, but for others to come. With no prior knowledge in the field, the author's starting point was to obtain a clear definition of what cryptography is and encompasses. Easier said than done, as cryptography does not have a set definition, as it has evolved many times since its inception. A great definition was found, provided by NIST: Discipline that embodies the principles, means, and methods for the transformation of data in order to hide their semantic content, prevent their unauthorized use, or prevent their undetected modification. This definition suggests that cryptography is a vast and complicated discipline, but it also suggests that it serves as a tool for broader concepts. The importance of information security, the protection of our communications and data, has been discussed at length throughout this report. Cryptography plays a major role in this, allowing us to secure communications by achieving the five main concepts of the now misnamed CIA Triad. By studying the different types of cryptosystems and the attacks they are subject to, the importance of the key length used has been demonstrated. The larger the key for a type of cryptographic algorithm, the more secure it is. However, for larger keys, the systems become highly inefficient, so other technological solutions are needed to avoid becoming resource-constrained. One of the most important conclusions to be drawn from this project is the importance of authentication as a key feature in making our communications secure. With the addition of PKI's, authentication, as the absolute need to be able to identify each user of a system, is more easily achievable. This is evident in our daily lives, where much of our communication with government services, for example, is done through digital media with personal certificates that identify each user. Without this kind of personal identification or blueprint, no digital communication would be secure and no government would be possible. By studying the most important cryptographic algorithms, we have also seen how time and the increase in computing power have rendered almost all previous algorithmic functions ineffective. This clear trend allows us to conclude that what is considered secure today is unlikely to withstand the passage of time and technological advances. However, this should not be used as a deterrent against incorporating cryptographic devices into our lives. It should be used as a cautionary tale to not put cryptography aside and to review
Hardware alternatives for crypto authentication Pag. 81 the advances in its field when deciding whether to upgrade our security systems. The unstoppable growth of the cryptographic authentication market was presented, confirming the increasing importance of cryptography in our lives. Nearly a hundred crypto authentication devices were considered, and many more are certainly available from other companies. The final decision to use the ATECC608A was based on the educational value of the chip and the resources the company provides to the public. Although proprietary information is of utmost importance to companies, open resources, such as the public GitHub repositories used during the course of this project, help make the technology more secure by giving attackers all the tools they need to try to successfully break the algorithms, as Kerckhoff and Shannon suggested. Finally, being able to test a cryptographic authentication device such as the ATECC608A with its development kit, the SOIC Starter Kit, is an amazing way to better understand the intricate functions and algorithms used in them. Once you get into this field, it is easy to see how deep it goes. Not only is a huge mathematical background needed to fully understand how the cryptographic algorithms work, but also a huge knowledge of code is highly recommended to be able to dig deep into the backend part of it. Cryptography is a deep and highly complicated field that is becoming more important every day. Educating the population on its importance and the implications of being able to authenticate ourselves and the devices we interact with to ensure the security of our communications should be of paramount importance, otherwise we will be vulnerable to attackers eavesdropping on our private lives. If this project helps even one person along this educational path, the main goal will have been achieved.
Pag. 82 Report 11. Acknowledgments First of all, I would like to thank my director, Manuel Moreno Eguílaz, without whom this project would not have been possible. My deepest appreciation for his guidance and patience during these months. I am deeply indebted to the Escola Tècnica Superior d'Enginyeria Industrial de Barcelona and its Electronic Engineering Department, EEL, for providing me with the means to carry out this project. Also, for allowing second chances, without which none of this would have been possible. I would also like to thank my parents for their support throughout the years. For believing in me even when I did not, and for encouraging me to see this chapter of my life through to the end.
Hardware alternatives for crypto authentication Pag. 83 12. Bibliography References [1] J. M. Franklin et al., “Mobile Device Security: Corporate-Owned Personally- Enabled (COPE),” Gaithersburg, MD, Sep. 2020. doi: 10.6028/NIST.SP.1800-21. [2] “CRYPTOGRAPHY | English meaning - Cambridge Dictionary.” Accessed: Apr. 16, 2024. [Online]. Available: https://dictionary.cambridge.org/dictionary/english/cryptography [3] “Caesar Cipher in Cryptography - GeeksforGeeks.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/ [4] W. Diffie and M. E. Hellman, “New Directions in Cryptography,” Nov. 1976. [5] R. L. Rivest, A. Shamir, and L. Adleman, “A Method for Obtaining Digital Signatures and Public-Key Cryptosystems,” Commun ACM, vol. 21, no. 2, 1978, doi: 10.1145/359340.359342. [6] V. Ralegankar et al., “Quantum Cryptography-as-a-Service for Secure UAV Communication: Applications, Challenges, and Case Study,” IEEE Access, vol. PP, Apr. 2021, doi: 10.1109/ACCESS.2021.3138753. [7] CNSS, “Committee on National Security Systems Committee on National Security Systems (CNSS) Glossary,” 2015. [8] ISO/IEC, “ISO-IEC 7498-2: Information processing systems Open Systems Interconnection Basic Reference Model. Part 2: Security Architecture,” 1989. [Online]. Available: https://www.iso.org/obp/ui/?_escaped_fragment_=iso:std:14256:en#!iso:std:14256: en [9] “What Is the CIA Triad and Why Is It Important?” Accessed: Apr. 17, 2024. [Online]. Available: https://www.itgovernance.co.uk/blog/what-is-the-cia-triad-and-why-is-it- important [10] “Cryptosystems.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.tutorialspoint.com/cryptography/cryptosystems.htm [11] A. Kakpohoue, “Embedded System design with implementation of a cryptographic algorithm for the development of Nadjibi’s Pay As You Go platform.” Apr. 2018.
Pag. 84 Report [12] A. Kerckhoffs, “La Cryptographie Militaire (Première partie),” Des Sciences Militaires, vol. IX, 1883. [13] A. Kerckhoffs, “La Cryptographie Militaire (Seconde partie),” Journal des sciences militaires, vol. IX, 1883. [14] C. E. Shannon, “Communication Theory of Secrecy Systems,” Bell System Technical Journal, vol. 28, no. 4, pp. 656–715, Oct. 1949. [15] “Category:Cryptographic attacks - Wikipedia.” Accessed: Apr. 17, 2024. [Online]. Available: https://en.wikipedia.org/wiki/Category:Cryptographic_attacks [16] E. Barker, “Recommendation for key management,” 2020. [17] “Week 2b: The Story of Alice and Bob | by Sophie Danielpour | Medium.” Accessed: Apr. 17, 2024. [Online]. Available: https://medium.com/@sophiedanielpour/week-2b-the-story-of-alice-and-bob- 2c1acb6db47f [18] Tadayoshi. Kohno, Niels. Ferguson, and B. Schneier, Cryptography engineering: design principles and practical applications. Wiley Pub., Inc, 2010. [19] “What is PKI?” Accessed: Apr. 17, 2024. [Online]. Available: https://cpl.thalesgroup.com/faq/public-key-infrastructure-pki/what-public-key- infrastructure-pki [20] “ITU-T Information technology-Open Systems Interconnection-The Directory: Public-key and attribute certificate frameworks.” [Online]. Available: http://handle.itu.int/11.1002/1000/11830-en. [21] “Public Key Infrastructure.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.tutorialspoint.com/cryptography/public_key_infrastructure.htm [22] M. Alrammahi and H. Kaur, “Development of Advanced Encryption Standard (AES) Cryptography Algorithm for Wi-Fi Security Protocol.” Apr. 2014. doi: 10.13140/RG.2.2.20993.97124. [23] “Cryptography Hash functions.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.tutorialspoint.com/cryptography/cryptography_hash_functions.htm [24] M. J. Dworkin, “SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions,” Gaithersburg, MD, Jul. 2015. doi: 10.6028/NIST.FIPS.202. [25] D. J. Bernstein, “ChaCha, a variant of Salsa20,” Workshop Record of SASC, 2008.
Hardware alternatives for crypto authentication Pag. 85 [26] FIPS, “Data Encryption Standard,” Jan. 1977. [27] M. J. Dworkin, “Advanced Encryption Standard (AES),” May 2023. doi: 10.6028/NIST.FIPS.197-upd1. [28] V. S. Miller, “Use of Elliptic Curves in Cryptography,” in Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 1986. doi: 10.1007/3-540-39799-X_31. [29] N. Koblitz, “Elliptic Curve Cryptosystems,” Math Comput, vol. 48, no. 177, pp. 203– 209, Jan. 1987. [30] B. Sanz Angrill, “Cryptography, IoT and how to secure a node,” Universitat Politècnica de Catalunya. Accessed: Apr. 17, 2024. [Online]. Available: https://apren.upc.edu/ca/materials/2117_189669 [31] A. Gupta, “Data Encryption Market Size, Outlook 2030.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.marketresearchfuture.com/reports/data-encryption- market-1733 [32] “Mixed-signal and digital signal processing ICs | Analog Devices.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.analog.com/en/index.html [33] “Selection Table for Secure Authenticators | Parametric Search | Analog Devices.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.analog.com/en/parametricsearch/12936#/ [34] G. Sánchez Martínez, “Implementing a secure node based on a Raspberry Pi and a Maxim DS28C36 authenticator,” Universitat Politècnica de Catalunya. Accessed: Apr. 17, 2024. [Online]. Available: https://apren.upc.edu/ca/materials/2117_189419 [35] “Empowering Innovation | Microchip Technology.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.microchip.com/ [36] “CryptoAuthentication-page Products Parametric Search.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.microchip.com/en-us/parametricsearch.html/227?filters=JTdCJTIyY2F0ZWdvcnlkcm9wZG93biUyMiUzQSU1QiUy Mk1pY3JvY29udHJvbGxlcnMlMjBhbmQlMjBNaWNyb3Byb2Nlc3NvcnMlMjIlMkMl MjIlMjIlMkMlMjIlMjIlNUQlN0Q= [37] “GitHub - MicrochipTech/cryptoauthlib: Library for interacting with the Crypto Authentication secure elements.” Accessed: Apr. 17, 2024. [Online]. Available: https://github.com/MicrochipTech/cryptoauthlib [38] “GitHub - MicrochipTech/cryptoauthtools: Tools for CryptoAuthentication Devices
Pag. 86 Report using CryptoAuthLib.” Accessed: Apr. 17, 2024. [Online]. Available: https://github.com/MicrochipTech/cryptoauthtools/tree/master [39] “Automotive, IoT & Industrial Solutions | NXP Semiconductors.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.nxp.com/ [40] “IoT Secure Elements and Authenticators | NXP Semiconductors.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.nxp.com/products/security-and- authentication/authentication:MC_71548 [41] “STMicroelectronics: Our technology starts with you.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.st.com/content/st_com/en.html [42] “Authentication - Products.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.st.com/en/secure-mcus/authentication/products.html [43] “Semiconductor & System Solutions - Infineon Technologies.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.infineon.com/cms/en/ [44] “Contactless and dual interface security controllers - Infineon Technologies.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.infineon.com/cms/en/product/security-smart-card-solutions/securitycontrollers/contactless-and-dual-interface-security-controllers/ [45] “Samsung Semiconductor Global Official Website | Samsung Semiconductor Global.” Accessed: Apr. 17, 2024. [Online]. Available: https://semiconductor.samsung.com/ [46] “IoT SE | Security Solution | Samsung Semiconductor Global.” Accessed: Apr. 17, 2024. [Online]. Available: https://semiconductor.samsung.com/security-solution/iotse/ [47] “Renesas Electronics Corporation.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.renesas.com/us/en [48] “Texas Instruments.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.ti.com/ [49] “Toshiba Electronic Devices & Storage Corporation.” Accessed: Apr. 17, 2024. [Online]. Available: https://toshiba.semicon-storage.com/eu/top.html [50] “CryptoAuthLib · PyPI.” Accessed: Apr. 17, 2024. [Online]. Available: https://pypi.org/project/cryptoauthlib/ [51] “CryptoAuthenticationTM Xplained-Pro Starter Kit User Guide,” 2018.
Hardware alternatives for crypto authentication Pag. 87 [52] “Python.org.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.python.org/ [53] “Sublime Text.” Accessed: Apr. 17, 2024. [Online]. Available: https://www.sublimetext.com/ [54] “cryptography · PyPI.” Accessed: Apr. 17, 2024. [Online]. Available: https://pypi.org/project/cryptography/ [55] “pytest · PyPI.” Accessed: Apr. 17, 2024. [Online]. Available: https://pypi.org/project/pytest/ [56] “ctypes — Python 3.12.3 documentation.” Accessed: Apr. 17, 2024. [Online]. Available: https://docs.python.org/3/library/ctypes.html [57] “base64 — Python 3.12.3 documentation.” Accessed: Apr. 17, 2024. [Online]. Available: https://docs.python.org/3/library/base64.html [58] “Agencia Tributaria: 3.5.4 Tabla de amortización simplificada.” Accessed: Apr. 17, 2024. [Online]. Available: https://sede.agenciatributaria.gob.es/Sede/ayuda/manuales-videos- folletos/manuales-practicos/folleto-actividades-economicas/3-impuesto-sobre- renta-personas-fisicas/3_5-estimacion-directa-simplificada/3_5_4-tabla- amortizacion-simplificada.html Additional bibliography R. Wobst, Cryptology Unlocked. Wiley & Sons, 2007. T. Shaska, W. C. Huffman, D. Joyner, and V. Ustimenko, Advances in Coding Theory and Cryptography, vol. 3. Singapore: World Scientific Publishing Co. Pte. Ltd., 2007. J. Hoffstein, P. Jill, and J. H. Silverman, An Introduction to Mathematical Cryptography. Springer, 2008. C. Paar and J. Pelzl, Understanding Cryptography: A Textbook for Students and Practitioners. Springer, 2010.