I am developing smart card based system using C. In my case I have to do 3 pass authentication. My problem is with challenge generation process. I can get the random B and decrypt it and generate random A. Now I want to generate challenge. But I don't know how to make the challenge.
0x0000000000000000 as Initial Vector (8 bytes).
0x12121212121212123434343434343434 as Des Key (16 bytes).
Please tell me what is the process of generating challenge block (for DES).
That's not really enough information to answer your problem. If you don't really know much about cryptography, you're going to make the same mistakes as those in the past.
DES has a 56bit (7byte) key. So it makes no sense providing a 16byte key. Plus DES isn't secure anyway. It's normal to use Triple-DES (sometimes called 3DES). In which case a 16 bit might be used, the first 8 bytes is used in stages 1 and 3, and the second in stage 2.
At any rate, you need to get familiar with the subject before designing a security system, otherwise whatever you come up with won't be secure.