「OpenSSL」:修訂間差異

出自Gea-Suan Lin's Wiki
跳至導覽 跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
 
行 10: 行 10:
</syntaxhighlight>
</syntaxhighlight>


 值得注意的是,OpenSSL在1.1.0後(差不多是[[Ubuntu]] 16.04到18.04的時期)修改了digest演算法(從<code>md5</code>變成<code>sha-256</code>),所以處理舊的檔案時需要指定<code>md5</code><ref>{{Cite web |url=https://www.openssl.org/docs/faq.html#USER3 |title=Why do I get errors when trying to decrypt 1.0.2 data with 1.1.0? |language=en |accessdate=2023-02-17}}</ref>:
 值得注意的是,OpenSSL在1.1.0後(差不多是[[Ubuntu]] 16.04<ref>{{Cite web |url=https://manpages.ubuntu.com/manpages/xenial/en/man1/enc.1ssl.html |title=xenial (1) enc.1ssl.gz |language=en |accessdate=2023-02-17}}</ref> 到18.04<ref>{{Cite web |url=https://manpages.ubuntu.com/manpages/bionic/en/man1/enc.1ssl.html | title=bionic (1) enc.1ssl.gz |language=en |accessdate=2023-02-17}}</ref> 的時期)修改了digest演算法(從<code>md5</code>變成<code>sha-256</code>),所以處理舊的檔案時需要指定<code>md5</code><ref>{{Cite web |url=https://www.openssl.org/docs/faq.html#USER3 |title=Why do I get errors when trying to decrypt 1.0.2 data with 1.1.0? |language=en |accessdate=2023-02-17}}</ref>:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">

於 2023年2月17日 (五) 04:39 的最新修訂

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). 

外部連結