OK this code will get a 64-bit number from /dev/urandom and a 3des key from the same place. Then it will set the secret key on the smart card to the new key read. The 64-bit number will then be encrypted using the new key and sent to the smart-card to perform the known operation. The smart card will decrypt perform a known operation and encrypt the result and send this back to the program for testing. The results will be displaied and tested.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <zccri.h>
#include <zcbci.h>
#include "sec-game.h"
#include "sec-admin.h"
#include "key-game.h"
#include "key-admin.h"
#include "d3des.h"
Include dependency graph for fpga-auth-test.c:

Functions | |
| void | sec_DumpBuff (unsigned char *pabBuf, int lLen) |
| Display the hex and ascii of a buffer. | |
| void | d3des_encrypt (unsigned char *pab8Data, unsigned char *pab24key) |
| void | d3des_decrypt (unsigned char *pab8Data, unsigned char *pab24key) |
| int | main (void) |
| This is the program entry point. | |
|
||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||
|
|
Here is the call graph for this function:

|
|
This is the program entry point. This is a test application to test out the basic card
History |
Here is the call graph for this function:

|
||||||||||||
|
Display the hex and ascii of a buffer. Given a pointer to a buffer and a length print the hex and ascii for that buffer.
|
1.3.6