-1
$\begingroup$

I was wondering which block encryption mode or modes will be most appropriate for transport of random values of one-block length. Block length could be of size 256 bytes and transport is from person to person, direct message.

This can be a password or an username. Certainly not the video streaming.

$\endgroup$
4
  • $\begingroup$ Block length = ?. Also, transport from where to where? If 128 that means you limit the username to 16 characters, that is not appropriate in the user's perspective. And same for the passwords. $\endgroup$ – kelalaka Jun 10 '20 at 9:23
  • $\begingroup$ @kelalaka I've updated question $\endgroup$ – Haseeb Saeed Jun 10 '20 at 9:25
  • 2
    $\begingroup$ Block ciphers with 256-bit block size are not common. Why do you want to transfer them within one block? Also, for randomized encryption one need IV/nonce and for authenticated encryption, also need an authentication tag. Do you have a limited data structure that prohibits you send multiple blocks? Why one block? $\endgroup$ – kelalaka Jun 10 '20 at 9:28
  • $\begingroup$ I don't think it matters much in this context, but it isn't entirely clear what you mean with "random values". Can the messages contain any value, or do they consist of cryptographically secure random bytes? $\endgroup$ – Maarten Bodewes Jun 12 '20 at 8:58
2
$\begingroup$

For transporting messages you need a transport protocol, not just a block cipher mode of operation. The handshake of a transport protocol is used to authenticate the entities and to establish session keys (and more). Those are essential activities to protect the messages send using the protocol. TLS is most common, where DTLS is explicitly specified for UDP - i.e. separate packets.

Blocks have a specific meaning in cryptography; they are the input of a block cipher. So if you have chunks of 256 bytes then you need a block cipher mode of operation for the messaging part of your protocol. In that case an authenticated mode of operation such as AES-GCM is best. This requires the protocol to specify a unique nonce, and it will generate an authentication tag for the encrypted message.

As you've specified a specific packet size you may also look into modes that were explicitly created for packet based security such as AES-CCM.

$\endgroup$

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.