N
N
Nikita2014-11-25 19:42:49
Encryption
Nikita, 2014-11-25 19:42:49

How are padding issues solved when using encryption algorithms?

I became interested in this topic and faced two similar questions when using block algorithms:
1. How in practice is the encrypted data block supplemented to the required length?
2. How is the user-supplied key completed to the required length? For example, the user wants to use AES-256 but has specified a key <256 bits long. What is done in such a case? The first thing that comes to mind is to hash the key, then it will certainly be 256 bits (if, of course, the appropriate hashing algorithm is used). But I don't know if this is done in practice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2014-11-25
@Nikitko_Cent

  1. For a modern cipher with proven security, it makes no difference what data to mince, so the missing length is usually finished off with zeros or another constant value. No, it does not affect cryptographic strength.
  2. This is called literally "Key stretching" and is carried out, among other things, by hashing the password, possibly multiple times.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question