What does “key with length of x bits” mean?

Technology CommunityCategory: CryptographyWhat does “key with length of x bits” mean?
VietMX Staff asked 3 years ago

Consider the simple encryption of shifting every letter one to the right in the alphabet, so that A becomes B, B becomes C, and so forth. So that: HELLO becomes encrypted as: IFMMP

I can shift one letter to the right, two letters to the right, or up to 25 letters to the right. Consider the “number of letters to the right” as the “key”. It takes 5 bites to hold a number between 0 and 25. Therefore, the key size is “5 bits”. The problem with a 5 bit key is that it only has 32 combinations. If I know the encryption algorithm, I can try all 32 keys until I find the right combination. The larger the key, the harder this becomes – EXPONENTIALLY.

  • For symmetric algorithms (symmetric encryption, Message Authentication Code), a key is a sequence of bits, such that any sequence of the right length is a possible key. For instance, AES is a symmetric encryption algorithm which is defined over keys of 128, 192 and 256 bits: any sequence of 128, 192 or 256 bits can be used as a key.
  • For asymmetric algorithms (also known as public-key cryptography, encompassing asymmetric encryption, digital signatures, some key exchange protocols, and a few more esoteric algorithms), keys work by pairs consisting in a public key and a private key. These keys are mathematical objects with some heavy internal structure. The “key length” is then a conventional measure of the size of one of the involved mathematical objects.

    For instance, a RSA public key contains a big integer called the modulus, as well as an other integer (usually small) called the public exponent. When we say a “1024-bit RSA key”, we mean that the modulus has length 1024 bits, i.e. is an integer greater than 21023 but lower than 21024. Such an integer could be encoded as a sequence of 1024 bits, i.e. 128 bytes.