2

I came across a peculiar system for generating "signatures" ("signatures" is within quotes because this is a bad use of 3DES) in the wild.

It works as follows: a symmetric key is generated and used to encrypt the current time using 3DES, in CBC mode with 8 zero valued bytes as an IV. The resulting signature is used like a session token - the server will decrypt the signature and check if the time is within some bound.

Is it possible to forge a signature?

Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323
Kyb3r
  • 33
  • 3

2 Answers2

1

Probably Not

Simplifying the discussion, one-block CBC with a null initialization vector reduces the mode to ECB.

Seeing that most time stamps are less than or equal to 8 bytes, only one block should be used (maybe two if there is a padding scheme).

There currently aren't any known algorithms for ECB forgery (as far as I'm aware), so I'd say it's unlikely.


However, this scheme could theoretically be susceptible to a brute-force attack.

If the time window were one day, the search space would only be about 48 bits (2^16 seconds being roughly one day).

Practically, this is an unrealistic attack, (and requires the server to ingest approximately 2.25 Petabytes of data), but it's feasible within an order of magnitude, which is not usually desirable.

1

This sounds like a very standard application of CBC-MAC with (known) fixed length messages. This is considered to be secure. I would not call the use of 3DES for CBC-MAC "bad use of 3DES" - to use quotation marks myself.

Time stamps by themselves are tricky to be used for authentication; they don't include an ID of the sender and may be susceptible to replay attacks. They require the verifier to maintain state and - if there are multiple verifiers - to synchronize. If anything is insecure it is likely the protocol or implementation rather than the CBC-MAC.

Using AES-CMAC or HMAC would certainly increase the security strength, if just because of the larger output size (authentication tag) that can be produced.

Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323