1

我使用来自tldp.org/LDP/LG/issue87/vinayak.html的想法加密文件。我下载并编译了这个源代码,用于加密/解密一个简单的文本文件。编译后我会这样做:

./blowfish input_file.txt output_enc.txt output_dec.txt

我使用以下选项:

  1. G用于生成密钥
  2. E用于加密文件,因此output_enc.txt生成
  3. D用于解密output_enc.txt所以output_dec.txt生成

在第三步中,我获得了分段错误。生成了一个解密文件,但它的某些字符与原始文件不同。有任何想法吗?

4

2 回答 2

1

This question is very similar to the one I've answered previously. Did you search before posting the question? Anyway here is the link. The page you are using as source is wrong. Beware that the code I provided is only a corrected version of the original supplied code, and can be optimized.

于 2009-07-07T19:30:30.640 回答
0

在我的机器上尝试过,同样的结果,我只能假设这是写到一个较旧的 Crypto lib 中,新的与之不兼容。如果感兴趣,Segmentation fault 在线

 if (EVP_DecryptFinal (&ctx, outbuf + olen, &tlen) != 1)

进程以信号 11 (SIGSEGV) 的默认操作终止 访问不在地址 0x808080C 的映射区域内

于 2009-06-29T21:41:15.967 回答