OpenSSL

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索

OpenSSL是一套综合各种密码学算法的软件。

范例

加密与解密,这边使用了算法使用了BlowfishPDKDF2

openssl enc -bf-cbc -pbkdf2 -in a.tgz -out a.tgz.pbkdf2.bf-cbc
openssl enc -d -bf-cbc -pbkdf2 -in a.tgz.pbkdf2.bf-cbc -out a.tgz

值得注意的是,OpenSSL在1.1.0后(差不多是Ubuntu 16.04[1]到18.04[2]的时期)修改了digest算法(从md5变成sha-256),所以处理旧的档案时需要指定md5[3]

openssl enc -d -bf-cbc -md md5 -in a.tgz.bf-cbc -out a.tgz

参考文献

  1. xenial (1) enc.1ssl.gz. [2023-02-17] (English). 
  2. bionic (1) enc.1ssl.gz. [2023-02-17] (English). 
  3. Why do I get errors when trying to decrypt 1.0.2 data with 1.1.0?. [2023-02-17] (English). 

外部链接