小编jes*_*ica的帖子

致命错误:openssl/aes.h:没有这样的文件或目录

我已将文件aes.h包含在程序所在的文件夹中,但仍然不知道还有什么需要做什么,任何建议.提前致谢

  root@ubuntu:/home/giri/openssl-1.0.1g1/crypto/aes# gcc -Wall aes1.c -lcrypto
  aes1.c:4:25: fatal error: openssl/aes.h: No such file or directory
  compilation terminated.

  here is the code and ls 
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <openssl/aes.h>

  int main(int argc, char **argv)
  {
   int i;
   int keylength;
   printf("Give a key length [only 128 or 192 or 256!]:\n");
   scanf("%d", &keylength);

   /* generate a key with a given length */
   unsigned char aes_key[keylength];
   memset(aes_key, 0, sizeof(aes_key));
   if (!RAND_bytes(aes_key, keylength))
  {
    exit(-1);
   }
   aes_key[keylength-1] = '\0';

   int inputslength;
   printf("Give …
Run Code Online (Sandbox Code Playgroud)

c encryption

5
推荐指数
1
解决办法
6937
查看次数

标签 统计

c ×1

encryption ×1