I am doing some AES encryption using C. But the errors ocurred.
The code is following by the error displayed.
1 Code
#include <stdlib.h>
#include <openssl/evp.h>
#include <string.h>
int main(){
//declaring the variables
char source[6]="Shahab";
char target[6];
char mykey[EVP_MAX_KEY_LENGTH]="hardtobreak";
char iv[EVP_MAX_IV_LENGTH] = "an_iv";
int in_len, out_len=0;
int check;
EVP_CIPHER_CTX ctx;
in_len=strlen(source);
printf("This is the text before ciphering %s\n",source);
printf("The length of the string is %d\n",in_len);
//starting the encryption process
EVP_CIPHER_CTX_init(&ctx);
EVP_EncrpytInit_ex(&ctx,EVP_aes_128_cbc(),NULL,mykey,iv);
EVP_EncryptUpdate(&ctx,target,&out_len,source,in_len);
EVP_EncryptFinal_ex(&ctx,target,&out_len);
printf("Program is working");
return 0;
}
2. Errors
gcc aesimpl.c -o impl -lcrypto
aesimpl.c:(.text+0x12b): undefined reference to `EVP_EncrpytInit_ex'
collect2: ld returned 1 exit status
Please help me solve this problem