Different key material lengths are often used when using cryptography, yet it is claimed that they have the same resistance. Aren't we counting apples and pears together?
Cryptographic protection is based on encryption, and some key material is always needed for encryption. However, for symmetric ciphers, the key is very short and for asymmetric ciphers, the key is very long, apart from which the algorithm differs from the algorithm. So does it make sense to work with the key length at all? And how does the security of the algorithm be determined? For a start, before we go any further, it is necessary to quickly stop at the term key, because everyone understands something different under it.
In a very simplified way, the password is input from the user, but the key is generated by the system. Generally based on user input. Unfortunately, a password like a user input is often predictable and not random enough. That's why reasonable programs have methods for distilling sufficiently random and unpredictable key material from a password. These functions are called the key derivation function (KDF). If your software doesn't use it or doesn't know it, stay alert and get your money back. In this article, we'll deal with the key material and its properties, and the password itself doesn't interest us all that much.
Asymmetrical ciphers have the biggest differences in key length. Asymmetrical, because the key is used asymmetrically. For example, a private key is designed for signing a document, and a public key (which is derived from a private key) allows all of its holders to verify the authenticity of the signature. But how come the RSA algorithm with a 3072b key and the ECDSA algorithm with a 256b key have the same security? I guess the question is whether there's some kind of betrayal. But there really isn't. Security can be compared quite simply, using the so-called security equivalent. And according to the said equivalent, all is well. The length of the keys, on the other hand, is used as a recommendation to avoid mistakes. Especially if someone doesn't know the security equivalent. So, how is it possible to calculate this equivalent?
If I have a task, I can fairly accurately express its complexity. Whether I will need a thousand, a million, a billion operations or more. Since we are talking about the world of computers, I can express complexity as a power, for example, 2^20, 2^64, 2^128. So how many operations do I need to successfully solve the problem. And here's the important figure. The security equivalent of 128b means that I need 2^128 operations. And the number 2^128 can be expressed as a 128b number. So it's not appropriate to calculate the length of the key, but the complexity. And complexity is nothing else than the difficulty of solving the problem. At the same time, such a statement of complexity can be used as a universal translation of the ability to protect symmetric and asymmetric algorithms, hashes and, under certain conditions, passwords. The truth is that in the case of passwords, this is already an extreme interpretation of the security equivalent.
The RSA algorithm is currently (2024) still used for the purposes of digital signature and key agreement. Its security provides the difficulty of factoring large numbers. In translation, this means a way to find two primes whose mutual multiplication produces this large number. Currently, the most effective method on classical computers is the so-called General Number Field Sieve (GNFS), on quantum computers the Shorr algorithm (based on QFT - Quantum Fourier Transformation). In the case of GNFS, our ability to attack this algorithm is very limited. Another disadvantage of the RSA algorithm is its sub-exponential complexity. In translation, this means that its resistance to attacks grows more slowly than the size of the key. Thanks to this, we can easily encounter technical limitations e.g. in popular protocols SSL/TLS, SSH, IPSec and others. For an idea of these dependencies, it is possible to provide a table for conversion to and from the security equivalent, which looks like this. An explanation of the impacts of quantum computers on asymmetric algorithms will be in another article.
RSA Key Width | 512 | 768 | 1024 | 2048 | 3072 | 4096 | 8192 | 16384 | 32768 | 65536 |
Security equivalent | 64 | 77 | 87 | 117 | 139 | 157 | 209 | 326 | 365 | 481 |
Security equivalent | 64 | 80 | 112 | 128 | 168 | 192 | 224 | 256 | 384 | 512 |
RSA Key Width | 514 | 851 | 1855 | 2540 | 4857 | 6710 | 9763 | 13550 | 37100 | 76608 |
These algorithms use the discrete logarithm problem in a body for protection. In this case, under a numerical body, we mean additive (i.e. single numbers are increased by a certain number each time, usually by 1 or 2, resulting in the remainder after division by a prime number) or multiplicative (single numbers are multiplied by a certain number, resulting in the remainder after division by a prime number) group. In simple terms, it's easy to raise some numbers in such a body, but practically impossible to square those numbers. To give you an idea, if we use modular multiplication (i.e. multiply by two numbers, multiply by divide by the chosen prime number, resulting in the remainder), we can easily write 5*8 mod 13 = 1. In this case, it's challenging, but still possible, to find which number multiplied by 5. But even if we have 5^8 mod 13, the situation is much worse. We're not able to figure out if it was 8, 10, 92 ... or maybe it was another number? In any case, it is still a primary school curriculum. To derive complexity, it is possible to use the so-called. Pollard's algorithm, which allows classical computers to attack this structure, on quantum computers it is again a modified Shore algorithm algorithm (uses QFT - Quantum Fourier Transformation). Interestingly, although the complexity of attacking these algorithms is significantly higher, is a key of similar size to RSA. However, this is due to the design of the key. It contains both a body definition and a generator (i.e. from what point starts with the calculation), so the public key. Because the information is quite large, a similar situation arises with the size of the resulting keys like the RSA. Therefore, for simplicity, the key size corresponding to the previous table is given. In reality, however, the width of secret key is important. An explanation of the impacts of quantum computers on asymmetric algorithms will be in another article.
Key File | 2048 | 3072 | 3584 | 4096 | 5120 | 6144 | 8192 | 9216 | 13550 | 16384 | 32768 |
Private Key | 224 | 256 | 288 | 320 | 352 | 384 | 416 | 448 | 480 | 512 | 544 |
Security equivalent | 112 | 128 | 144 | 160 | 176 | 192 | 208 | 224 | 240 | 256 | 272 |
Security equivalent | 56 | 64 | 80 | 112 | 128 | 168 | 192 | 224 | 256 | 384 | 512 |
Private Key | 112 | 128 | 160 | 224 | 256 | 336 | 384 | 448 | 512 | 768 | 1024 |
Key File | 2048 | 3072 | 3584 | 4096 | 5120 | 6144 | 8192 | 9216 | 13550 | 16384 | 32768 |
Note: Because of other data that are part of the key, the resulting size of the key file is approximately equivalent to the size of the keys in RSA and therefore resistance is considered in a similar way.
Algorithms based on elliptic curves use a similar principle as the algorithms Diffie-Hellman, ElGamal, Schnorr signature and DSA. Unlike them, however, they do not use general bodies, but bodies above elliptic curves. These add an additional layer of complexity. In fact, this is again an elementary school curriculum, only the mentioned body arises above an equation, usually a quadratic one. The other parts of the procedure are the same, i.e. again a division with the rest is used, a kind of "size limiter" of the body. In terms of the complexity of the attack, it is again possible to use the Pollard algorithm on a digital computer, the modified Shor algorithm on a quantum computer (it uses two QFTs - Quantum Fourier Transformation). Explanation of the effects of quantum computers on asymmetric algorithms will be in another article. Dependence on security is more complicated here, therefore only a simplified explanation is given. The key file is at the moment corresponding to the size of the key bit width, therefore the key file is significantly smaller.
Key width | 224 | 256 | 288 | 320 | 352 | 384 | 416 | 448 | 480 | 512 | 544 |
Security equivalent | 112 | 128 | 144 | 160 | 176 | 192 | 208 | 224 | 240 | 256 | 272 |
Security equivalent | 56 | 64 | 80 | 112 | 128 | 168 | 192 | 224 | 256 | 384 | 512 |
Key width | 112 | 128 | 160 | 224 | 256 | 336 | 384 | 448 | 512 | 768 | 1024 |
For symmetric encryption algorithms, the bit width of the key is used as the security equivalent. However, new attacks are emerging and each of these methods may result in weakening of existing resistance. An example of such weakening is the RC-4 algorithm, which, although it may have a 128b key, is breakable in a matter of seconds. And there are more examples.
For hash functions, the security equivalent is based on the birthday paradox, i.e. the probability of two identical texts with similar output. In simple terms, therefore, it can be argued that the security equivalent is roughly half the output width of the hash function, i.e. length/2. For quantum computers, this is a similar value, which should be length/3
Hash function | SHA-256 | SHA-384 | SHA-512 | SHA-512/256 | SHA3-256 | SHA3-384 | SHA3-512 | SHAKE128 | SHAKE256 |
Security Equivalent | 128 | 192 | 256 | 128 | 256 | 192 | 256 | 64 | 128 |
Quantum Security Equivalent | 85 | 128 | 170 | 85 | 85 | 128 | 170 | 42 | 85 |
Mathematicians are special people, able to entertain themselves at celebrations by calculating probabilities.
For example, how many people could have the same birthday, hence the birthday paradox. But a mathematician is
not looking for a specific example where someone will have the same birthday as the birthday boy, he is looking
for a general case. This means that anyone at a celebration can have the same birthday as someone else.
Surprisingly, only 23 people are needed for a 50% probability. These can be calculated using the following procedure.
Probability = (1 − variation (365, participants) / variation with repetition (365, participants))
Whatever cryptography is involved, it is advisable to deploy approximately the same security equivalent. Otherwise, the weakest algorithm may compromise the security of the more heavily protected, i.e. algorithms with a higher security equivalent. As for the stronger algorithms, on the other hand, they unnecessarily burn machine time on tasks that are unnecessarily demanding. At such a moment, computing can only become an overpriced direct-fuel. Currently, the corresponding security equivalent is 128b, but due to the risks posed by quantum computers, there are significant changes, for symmetric algorithms the requirement of a key width of 192b to 256b is being considered. Classical asymmetric algorithms are no longer sufficient and their substitution is being addressed.
List of problems of classical asymmetric cryptography and their explanation, taken from prof. Bill Buchannan asecurity [1]
Factorization Problem | (FACTORING) Find two primes greater than 1 that multiply to give N. |
RSA Problem | (RSAP) This is a "reverse" RSA problem. |
Quadratic Residuosity Problem | (QRP) If two numbers are available, decide if the number is a quadratic residual after the square root of the number in the body modulo n. |
Square Root Problem | (SQROOT - Square Roots modulo N) If the remainder is available after the square root of the number in the body, determine what number it was originally. |
Discrete logarithm problem | (DLP) There is a number for which it is necessary to find the exponent in such a way that a certain remainder can be obtained. |
General Discrete Logarithm Problem | (GDLP) There is a number for which it is necessary to find the exponent in such a way that it is possible to get a certain number.|
Diffie Hellman Problem | (DHP) - If there are two powers of numbers in a body, find the sum of those powers in that body. |
General Diffie Hellman Problem | (GDHP) - If there are remnants of power in a body, find the modular product of those powers. |
Subset Sum Problem | (SUBSET-SUM) If I have a set of numbers and a sum, determine whether the sum of the parts is part of the total. |
1. Introductory Provisions
1.1. These General Terms and Conditions are, unless otherwise agreed in writing in the contract, an integral part of all contracts relating to training organised or provided by the trainer, Jan Dušátko, IČ 434 797 66, DIČ 7208253041, with location Pod Harfou 938/58, Praha 9 (next as a „lector“).2. Creation of a contract by signing up for a course
2.1. Application means unilateral action of the client addressed to the trainer through a data box with identification euxesuf, e-mailu with address register@cryptosession.cz or register@cryptosession.info, internet pages cryptosession.cz, cryptosession.info or contact phone +420 602 427 840.3. Termination of the contract by cancellation of the application
3.1. The application may be cancelled by the ordering party via e-mail or via a data mailbox.4. Price and payment terms
4.1. By sending the application, the ordering party accepts the contract price (hereinafter referred to as the participation fee) indicated for the course.5. Training conditions
5.1. The trainer is obliged to inform the client 14 days in advance of the location and time of the training, including the start and end dates of the daily programme.6. Complaints
6.1. If the participant is grossly dissatisfied with the course, the trainer is informed of this information.7. Copyright of the provided materials
7.1. The training materials provided by the trainer in the course of the training meet the characteristics of a copyrighted work in accordance with Czech Act No 121/2000 Coll.8. Liability
8.1. The trainer does not assume responsibility for any shortcomings in the services of any third party that he uses in the training.9. Validity of the Terms
9.1 These General Terms and Conditions shall be valid and effective from 1 October 2024.Consent to the collection and processing of personal data
According to Regulation (EU) No 2016/679 of the European Parliament and of the Council on the protection of individuals with regard to the processing of personal data and on the free movement of such data and repealing Directive 95/46/EC (General Data Protection Regulation, hereinafter referred to as "the Regulation"), the processor xxx (hereinafter referred to as "the Controller") processes personal data. Individual personal data that are part of the processing during specific activities at this web presentation and in the course of trade are also broken down.Information about the records of access to the web presentation
This website does not collect any cookies. The site does not use any analytical scripts of third parties (social networks, cloud providers). For these reasons, an option is also offered for displaying the map in the form of a link, where the primary source is OpenStreet and alternatives then the frequently used Maps of Seznam, a.s., or Google Maps of Google LLC Inc. The use of any of these sources is entirely at the discretion of the users of this site. The administrator is not responsible for the collection of data carried out by these companies, does not provide them with data about users and does not cooperate on the collection of data.Information about contacting the operator of the site
The form for contacting the operator of the site (administrator) contains the following personal data: name, surname, e-mail. These data are intended only for this communication, corresponding to the address of the user and are kept for the time necessary to fulfil the purpose, up to a maximum of one year, unless the user determines otherwise.Information about the order form
In case of an interest in the order form, the form contains more data, i.e. name, surname, e-mail and contact details for the organisation. These data are intended only for this communication, corresponding to the address of the user and are kept for one year, unless the user determines otherwise. In the event that a business relationship is concluded on the basis of this order, only the information required by Czech law on the basis of business relations (company name and address, bank account number, type of course and its price) will continue to be kept by the administrator.Information about the course completion document
Within the course, a course completion document is issued by the processor. This document contains the following data: student's name and surname, the name and date of the course completion and the employer's name. The information is subsequently used for the creation of a linear hash tree (non-modifiable record). This database contains only information about the provided names and company names, which may or may not correspond to reality and is maintained by the processor for possible re-issuance or verification of the document's issuance.Rights of the personal data subject
The customer or visitor of this website has the possibility to request information about the processing of personal data, the right to request access to personal data, or the right to request the correction or deletion of any data held about him. In the case of deletion, this requirement cannot be fulfilled only if it is not data strictly necessary in the course of business. The customer or visitor of this website also has the right to obtain explanations regarding the processing of his personal data if he finds out or believes that the processing is carried out in violation of the protection of his private and personal life or in violation of applicable legislation, and the right to request removal of the resulting situation and to ensure the correction.