1
$\begingroup$

I am current learning the internal working of several Symmetric key Cryptographic algorithms, and came across DES and AES.

DES takes in input a 64 bit key and AES-128 takes in input a 128 bit key

My question is, since the user provides these algorithms inputs of variable size (or bits), then how is it able to upscale/downscale it to lower bits in order to feed it to the algorithm. Does it uses KDF (key Derivation function)? If yes, then is the KDF capable of decreasing the size of bits too?

By decreasing I mean, If the User Inputs a key = APPLE PIES, and gives it as an input to DES. Then how is DES able to convert this (80 bit) key into a 64 bit one?

$\endgroup$
1
$\begingroup$

Does it use KDF (key Derivation function)? If yes, then is the KDF capable of decreasing the size of bits too?

...how is DES able to convert this (80 bit) key into a 64 bit one?

AES and DES do not perform this task. The specification states that AES uses two sequence of 128 bits as input.

"key" means "cryptographically strong bits".

Something like APPLE PIES is a password rather than a key.

how is it able to upscale/downscale it to lower bits in order to feed it to the algorithm. Does it uses KDF (key Derivation function)? If yes, then is the KDF capable of decreasing the size of bits too?

The key derivation process may involve multiple invocations and iterations to generate output larger then the output size of the hash function, and the application may truncate keys down to the correct size when necessary.

How to derive a key from a password

This question has already been asked: see this answer.

A KDF is used to turn a password into a suitable key, but this is a separate process that is not performed by the AES/DES algorithms.

$\endgroup$
  • $\begingroup$ So is it possible to create a variable sized key from a password, i.e. a key from a password could be produced via a hashing algorithm. A hashing algorithm has a definite length output, but as mentioned DES and AES used two different sized keys (64 bits and 128 bits). Then how is different sized keys derived out from arbitrary length password. Let's say i want to use the same passphrase for both AES and DES, then how does different sized key's calculated out of the same password? $\endgroup$ – Vasu Deo.S Jun 17 at 18:23
  • $\begingroup$ A hashing algorithm has a definite length output. But a hash function is not a key derivation function. A hash function is used in the key derivation process, but it is only a part of the procedure. The key derivation process may involve multiple invocations and iterations to generate output larger then the output size of the hash function, and the application may truncate keys down to the correct size when necessary. $\endgroup$ – Ella Rose Jun 17 at 18:34
  • $\begingroup$ So a KDF is capable of truncating the size too (to a lower key size), if it is the requirement? $\endgroup$ – Vasu Deo.S Jun 17 at 18:39
  • $\begingroup$ Of course; A program can do anything it wants with blocks of bits. $\endgroup$ – Ella Rose Jun 17 at 18:41
  • $\begingroup$ Thanks for taking time to answer my doubts, I am new to cryptography so my questions are a little dumb too T_T Pardon me for that $\endgroup$ – Vasu Deo.S Jun 17 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.