1

I have designed a specific client and server program, which sends a file from client to server in 32k chunks. I want to encrypt only part of the data. More specifically: in each 32k chunk passing from client to server I want to encrypt only 500 bytes. This, in a non-continuous way (meaning: partial encryptionhere and there in the chunk of 32k, totally forming 500 bytesof encrypted data within the 32k block). Here client is a constrained sensor and server is an Arduino board used for Internet of Things concept, to save of energy of the constrained device(client) i want to encrypt only parts of data.

Are there any lightweight(here refers to C.P.U consumption) cryptographic algorithms or methods which offer the option to set an “offset” and a parameter defining how much partial data we want to encrypt?

For example encrypt (bufptr, random_num, ENCRYPT_LENGTH); where bufptr is a 32k chunk with information, random_num is the random number smaller than the bufptr pointing to the bufptr, ENCRYPT_LENGTH is the length we want to encrypt (like 20 bytes from the number pointed by the random_num).

nandan
  • 19
  • 3
  • 2
    You really need to describe your use case in more detail. For example, it is probable that encryption alone (especially CTR mode, but really any) will not suffice, but you need a MAC too, unless authenticity is verified somehow already. – otus Jan 18 '16 at 20:02
  • 1
    What does lightweight mean for you? What is your target hardware platform at what speeds? Is the memory footprint important or just the pure performance? What does this have to do with TLS? – Artjom B. Jan 19 '16 at 08:21
  • 3
  • Why only encrypt such a small part? If it's for performance reasons, most CPUs can encrypt faster than your network connection. 2) Relative performance of ciphers varies greatly across platforms. A Desktop with AES NI, a mobile phone and an embedded system are quite different.
  • – CodesInChaos Jan 19 '16 at 08:46