How to get the last 32 bits in ANSI X9.19 MAC generation ( very urgent )

I am trying to generate the MAC of 256bits of data according to ANSI X9.19 standard.

I am trying to do this in the following way

1) Encrypt the whole 256 bits using DES in CBC mode ( blocksize=64bits and hence 4 blocks)

2) Taking the last 8 bytes (i.e., last 64bits) I am decrypting it with DES in ECB mode using another key

3)Taking the ciphertext from above step, i am encrypting the ciphertext using DES ECB mode with key used in step1

Is the above steps are correct according to ANSI X9.19 MAC standard.

If so how to generate the final 32 bits from the 64 bits of the final block according to the X9.19 standard.

[662 byte] By [buddy_boya] at [2007-11-27 8:31:29]
# 1

> 2) Taking the last 8 bytes (i.e., last 64bits) I

> am decrypting it with DES in ECB mode using another

> key

Really? Decrypt something that wasn't encrypted?

> 3)Taking the ciphertext from above step

What ciphertext? Do you mean plaintext? Or do you mean you encrypted in the previous step?

, i am

> encrypting the ciphertext using DES ECB mode with

> key used in step1

Encrypting ciphertext? why? it's already encrypted.

> Is the above steps are correct according to ANSI

> X9.19 MAC standard.

Almost certainly not, it reads like sheer nonsense to me.

> If so how to generate the final 32 bits from the 64

> bits of the final block according to the X9.19

> standard.

You carry out the steps in the standard. I haven't read it. Have you?

ejpa at 2007-7-12 20:26:59 > top of Java-index,Security,Cryptography...
# 2

Please see the paper at the following location

http://citeseer.ist.psu.edu/cache/papers/cs2/112/http:zSzzSzwww.scs.carleton.cazSz~paulvzSzpaperszSzElecLetters.pdf/a-key-recovery-attack.pdf

The above pdf file describes the X9.19 MAC generation and at the end of the file there is the diagram that describes the process.

> > 2) Taking the last 8 bytes (i.e., last 64bits) I

> > am decrypting it with DES in ECB mode using

> another

> > key

>

>

> Really? Decrypt something that wasn't encrypted?

>

> aking the ciphertext from above step

>

> What ciphertext? Do you mean plaintext? Or do you

> mean you encrypted in the previous step?

>

> , i am

> > encrypting the ciphertext using DES ECB mode with

> > key used in step1

>

> Encrypting ciphertext? why? it's already encrypted.

>

> Is the above steps are correct according to ANSI

> X9.19 MAC standard.

>

> Almost certainly not, it reads like sheer nonsense to

> me.

>

> If so how to generate the final 32 bits from the 64

> bits of the final block according to the X9.19

> standard.

>

> You carry out the steps in the standard. I haven't

> read it. Have you?

buddy_boya at 2007-7-12 20:26:59 > top of Java-index,Security,Cryptography...
# 3
OK, I read it. Your terms are still self-contradictory. There is no ciphertext resulting from a decryption operation, and you don't encrypt ciphertext. And that's not what the paper says to do. You need to straighten that out conceptually.
ejpa at 2007-7-12 20:26:59 > top of Java-index,Security,Cryptography...
# 4

Please help me what the paper says and a typical procedure to follow to generate the MAC according to X9.19 standard.

> OK, I read it. Your terms are still

> self-contradictory. There is no ciphertext resulting

> from a decryption operation, and you don't encrypt

> ciphertext. And that's not what the paper says to do.

> You need to straighten that out conceptually.

buddy_boya at 2007-7-12 20:26:59 > top of Java-index,Security,Cryptography...
# 5
Frankly, judging by the above, I don't think you have enough background in cryptography to do it. I suggest you engage an expert.
ejpa at 2007-7-12 20:26:59 > top of Java-index,Security,Cryptography...