Simple AES encryption decryption with openssl library in C
I want to encrypt a struct containing few String and then decrypt it. I tried following code. The original code is found from the web and it was working perfectly. I change the input of it to a struct. following is the code. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <openssl/aes.h> #include <openssl/rand.h> typedef struct ticket { /* test field */ int ticketId; char username[20]; char date[20]; } USR_TICKET; // a simple hex-print routine. could be modified to print 16 bytes-per-line static void hex_print(const void* pv, size_t len) { const unsigned