From 2dfd20c95a13a2468ea3bf695bf91bc37fe1bb9d Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Sat, 29 Jul 2023 19:20:56 +0800 Subject: [PATCH 1/3] feat: translate `library/hashlib.po` --- library/hashlib.po | 339 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 265 insertions(+), 74 deletions(-) diff --git a/library/hashlib.po b/library/hashlib.po index e7aed89235..f8dfd0c3a7 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Matt Wang , 2024 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-05-23 00:03+0000\n" -"PO-Revision-Date: 2018-05-23 16:03+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2024-05-11 16:03+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/hashlib.rst:2 msgid ":mod:`!hashlib` --- Secure hashes and message digests" @@ -36,12 +37,19 @@ msgid "" "\"secure hash\" and \"message digest\" are interchangeable. Older " "algorithms were called message digests. The modern term is secure hash." msgstr "" +"該模組實作了許多不同安全雜湊和訊息摘要演算法的通用介面,其中包括 FIPS 安全雜" +"湊演算法 SHA1、SHA224、SHA256、SHA384、SHA512(定義於 `FIPS 180-4 標準 `_)、SHA-3 系列(定義於 `FIPS 202 標準 `_)以及 RSA 的 MD5 演算法(定義於網際網路 :rfc:`1321`)。「安全雜" +"湊 (secure hash)」和「訊息摘要 (message digest)」這兩個術語是可以互換的。較舊" +"的演算法稱為訊息摘要、現代則較常稱之安全雜湊。" #: ../../library/hashlib.rst:33 msgid "" "If you want the adler32 or crc32 hash functions, they are available in the :" "mod:`zlib` module." msgstr "" +"如果你需要 adler32 或 crc32 雜湊函式,可以在 :mod:`zlib` 模組中找到它們。" #: ../../library/hashlib.rst:40 msgid "Hash algorithms" @@ -58,6 +66,13 @@ msgid "" "using the :meth:`digest()` or :meth:`hexdigest()` methods." msgstr "" +"每種種類的 :dfn:`hash` 都有一個以其命名的建構函式方法。全部都會回傳具有相同簡" +"單介面的雜湊物件。例如:可使用 :func:`sha256` 來建立 SHA-256 雜湊物件。現在你" +"可以使用 :meth:`update ` 方法向此物件提供\\ :term:`類位元組物件 " +"(bytes-like objects) `\\ (通常是 :class:`bytes`)。在任何" +"時候,你都可以使用 :meth:`digest() ` 或 :meth:`hexdigest() " +"` 方法來要求它提供迄今為止傳遞給它的資料串聯的\\ :dfn:`摘要 " +"(digest)`。" #: ../../library/hashlib.rst:50 msgid "" @@ -65,6 +80,9 @@ msgid "" "a hash supplied more than 2047 bytes of data at once in its constructor or :" "meth:`.update` method." msgstr "" +"為了允許多執行緒 (multithreading),Python :term:`GIL` 被釋放,同時在其建構函" +"式或 :meth:`.update` 方法中計算一次提供超過 2047 位元組資料的雜" +"湊值。" #: ../../library/hashlib.rst:57 msgid "" @@ -76,6 +94,12 @@ msgid "" "missing or blocked if you are using a rare \"FIPS compliant\" build of " "Python. These correspond to :data:`algorithms_guaranteed`." msgstr "" +"此模組中始終存在的雜湊演算法之建構函式有 :func:`sha1`、:func:`sha224`、:func:" +"`sha256`、:func:`sha384`、:func:`sha512`、:func:`sha3_224`、:func:" +"`sha3_256`、:func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:" +"`shake_256`、:func:`blake2b` 和 :func:`blake2s`。:func:`md5` 通常也可用,但如" +"果你使用罕見的「符合 FIPS (FIPS compliant)」的 Python 建置版本,它可能不存在" +"或這不被允許使用。以上會對應到 :data:`algorithms_guaranteed`。" #: ../../library/hashlib.rst:65 msgid "" @@ -84,6 +108,9 @@ msgid "" "Others *are not guaranteed available* on all installations and will only be " "accessible by name via :func:`new`. See :data:`algorithms_available`." msgstr "" +"如果你的 Python 發行版的 :mod:`hashlib` 與提供其他演算法的 OpenSSL 版本鏈結," +"也可能有其他演算法可用。其他則\\ *不保證可用*\\ 於在所有安裝上,並且只能以名" +"稱來透過 :func:`new` 存取。請參閱 :data:`algorithms_available`。" #: ../../library/hashlib.rst:72 msgid "" @@ -91,6 +118,9 @@ msgid "" "SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-" "seealso`_ section at the end of this document." msgstr "" +"某些演算法具有已知的雜湊碰撞 (hash collision) 弱點(包括 MD5 和 SHA1)。請參" +"閱 `Attacks on cryptographic hash algorithms`_ 和本文件後面的\\ `也參考 " +"`_\\ 部分。" #: ../../library/hashlib.rst:76 msgid "" @@ -98,6 +128,9 @@ msgid "" "func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " "added. :func:`blake2b` and :func:`blake2s` were added." msgstr "" +"新增了 SHA3 (Keccak) 和 SHAKE 建構函式 :func:`sha3_224`、:func:`sha3_256`、:" +"func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:`shake_256`。也新" +"增了 :func:`blake2b` 和 :func:`blake2s`。" #: ../../library/hashlib.rst:84 msgid "" @@ -107,10 +140,14 @@ msgid "" "hashing algorithm is not used in a security context, e.g. as a non-" "cryptographic one-way compression function." msgstr "" +"所有 hashlib 建構函式都採用一個僅限關鍵字引數 (keyword-only argument) " +"*usedforsecurity*,其預設值為 ``True``。false 值則會允許在受限環境中使用不安" +"全 (insecure) 和阻塞的 (blocked) 雜湊演算法。``False`` 表示雜湊演算法未在安全" +"情境中使用,例如作為一種非加密用途的單向壓縮函式。" #: ../../library/hashlib.rst:91 msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." -msgstr "" +msgstr "Hashlib 現在使用 OpenSSL 中的 SHA3 和 SHAKE(如果有提供的話)。" #: ../../library/hashlib.rst:94 msgid "" @@ -118,6 +155,8 @@ msgid "" "does not provide we fall back to a verified implementation from the `HACL\\* " "project`_." msgstr "" +"對於鏈結之 OpenSSL 未提供的任何 MD5、SHA1、SHA2 或 SHA3 演算法,我們會回退使" +"用 `HACL\\* 專案 `_\\ 中經過驗證的實作。" #: ../../library/hashlib.rst:100 msgid "Usage" @@ -128,10 +167,11 @@ msgid "" "To obtain the digest of the byte string ``b\"Nobody inspects the spammish " "repetition\"``::" msgstr "" +"獲取位元組字串 ``b\"Nobody inspects the spammish repetition\"`` 的摘要: ::" #: ../../library/hashlib.rst:114 msgid "More condensed:" -msgstr "" +msgstr "更濃縮:" #: ../../library/hashlib.rst:120 msgid "Constructors" @@ -144,24 +184,26 @@ msgid "" "above listed hashes as well as any other algorithms that your OpenSSL " "library may offer." msgstr "" +"是一個通用建構函式,它將目標演算法的字串 *name* 作為其第一個參數。它還允許使" +"用者取得上面列出的雜湊值以及 OpenSSL 函式庫可能提供的任何其他演算法。" #: ../../library/hashlib.rst:129 msgid "Using :func:`new` with an algorithm name:" -msgstr "" +msgstr "使用 :func:`new` 和演算法名稱:" #: ../../library/hashlib.rst:148 msgid "" "Named constructors such as these are faster than passing an algorithm name " "to :func:`new`." -msgstr "" +msgstr "諸如此類的附名建構函式比將演算法名稱傳遞給 :func:`new` 更快。" #: ../../library/hashlib.rst:152 msgid "Attributes" -msgstr "" +msgstr "屬性" #: ../../library/hashlib.rst:154 msgid "Hashlib provides the following constant module attributes:" -msgstr "" +msgstr "Hashlib 提供以下常數模組屬性:" #: ../../library/hashlib.rst:158 msgid "" @@ -170,6 +212,9 @@ msgid "" "some upstream vendors offering an odd \"FIPS compliant\" Python build that " "excludes it." msgstr "" +"包含所有平台上該模組保證支援的雜湊演算法名稱的集合。請注意,'md5' 有出現在此" +"列表中,儘管有一些上游供應商提供了奇怪的「符合 FIPS (FIPS compliant)」的 " +"Python 建置,並將其排除在外。" #: ../../library/hashlib.rst:167 msgid "" @@ -179,34 +224,39 @@ msgid "" "same algorithm may appear multiple times in this set under different names " "(thanks to OpenSSL)." msgstr "" +"包含正在運行的 Python 直譯器中可用的雜湊演算法名稱的集合。這些名稱在傳遞給 :" +"func:`new` 時將被識別。:attr:`algorithms_guaranteed` 都會是它的一個子集。相同" +"的演算法可能會以不同的名稱多次出現在該集合中(多虧了 OpenSSL)。" #: ../../library/hashlib.rst:176 msgid "Hash Objects" -msgstr "" +msgstr "雜湊物件" #: ../../library/hashlib.rst:178 msgid "" "The following values are provided as constant attributes of the hash objects " "returned by the constructors:" -msgstr "" +msgstr "以下的值皆為建構函式回傳之雜湊物件的常數屬性:" #: ../../library/hashlib.rst:183 msgid "The size of the resulting hash in bytes." -msgstr "" +msgstr "生成雜湊的大小(以位元組為單位)。" #: ../../library/hashlib.rst:187 msgid "The internal block size of the hash algorithm in bytes." -msgstr "" +msgstr "雜湊演算法的內部區塊大小(以位元組為單位)。" #: ../../library/hashlib.rst:189 msgid "A hash object has the following attributes:" -msgstr "" +msgstr "雜湊物件具有以下屬性:" #: ../../library/hashlib.rst:193 msgid "" "The canonical name of this hash, always lowercase and always suitable as a " "parameter to :func:`new` to create another hash of this type." msgstr "" +"該雜湊的規範名稱,都會是小寫,且都會適合作為 :func:`new` 的參數以建立此型別的" +"另一個雜湊。" #: ../../library/hashlib.rst:196 msgid "" @@ -214,10 +264,12 @@ msgid "" "until Python 3.4 was not formally specified, so may not exist on some " "platforms." msgstr "" +"name 屬性自 CPython 誕生以來就存在於其中,但直到 Python 3.4 才正式確立,因此" +"在某些平台上可能不存在。" #: ../../library/hashlib.rst:201 msgid "A hash object has the following methods:" -msgstr "" +msgstr "雜湊物件具有以下方法:" #: ../../library/hashlib.rst:206 msgid "" @@ -225,6 +277,9 @@ msgid "" "are equivalent to a single call with the concatenation of all the arguments: " "``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" +"使用\\ :term:`類位元組物件 `\\ 來更新雜湊物件。重複呼叫相" +"當於連接所有引數的單一呼叫:``m.update(a); m.update(b)`` 等價於 ``m." +"update(a+b)``。" #: ../../library/hashlib.rst:214 msgid "" @@ -232,6 +287,8 @@ msgid "" "This is a bytes object of size :attr:`digest_size` which may contain bytes " "in the whole range from 0 to 255." msgstr "" +"回傳目前有傳遞給 :meth:`update` 方法的資料之摘要。這是一個大小為 :attr:" +"`digest_size` 的位元組物件,它可能包含從 0 到 255 的整個範圍內的位元組。" #: ../../library/hashlib.rst:221 msgid "" @@ -239,16 +296,20 @@ msgid "" "double length, containing only hexadecimal digits. This may be used to " "exchange the value safely in email or other non-binary environments." msgstr "" +"與 :meth:`digest` 類似,只不過摘要會是作為雙倍長度的字串物件回傳,僅包含十六" +"進位數字。這可用於在電子郵件或其他非二進位環境中安全地交換值。" #: ../../library/hashlib.rst:228 msgid "" "Return a copy (\"clone\") of the hash object. This can be used to " "efficiently compute the digests of data sharing a common initial substring." msgstr "" +"回傳雜湊物件的副本(「複製 (clone)」),這可用於高效率地計算出共享同一初始子" +"字串的資料之摘要。" #: ../../library/hashlib.rst:233 msgid "SHAKE variable length digests" -msgstr "" +msgstr "SHAKE 可變長度摘要" #: ../../library/hashlib.rst:238 msgid "" @@ -257,6 +318,9 @@ msgid "" "such, their digest methods require a length. Maximum length is not limited " "by the SHAKE algorithm." msgstr "" +":func:`shake_128` 和 :func:`shake_256` 演算法提供了可變長度摘要,其 " +"length_in_bits//2 最高為 128 或 256 位元安全性。因此,他們的摘要方法會需要長" +"度。最大長度不受 SHAKE 演算法限制。" #: ../../library/hashlib.rst:245 msgid "" @@ -264,6 +328,8 @@ msgid "" "far. This is a bytes object of size *length* which may contain bytes in the " "whole range from 0 to 255." msgstr "" +"回傳目前有傳遞給 :meth:`~hash.update` 方法的資料之摘要。這是一個大小為 " +"*length* 的位元組物件,可能包含從 0 到 255 的整個範圍內的位元組。" #: ../../library/hashlib.rst:252 msgid "" @@ -271,6 +337,8 @@ msgid "" "double length, containing only hexadecimal digits. This may be used to " "exchange the value in email or other non-binary environments." msgstr "" +"與 :meth:`digest` 類似,只不過摘要作為雙倍長度的字串物件回傳,僅包含十六進位" +"數字。這可用於交換電子郵件或其他非二進位環境中的值。" #: ../../library/hashlib.rst:256 msgid "Example use:" @@ -278,18 +346,20 @@ msgstr "範例:" #: ../../library/hashlib.rst:263 msgid "File hashing" -msgstr "" +msgstr "檔案雜湊" #: ../../library/hashlib.rst:265 msgid "" "The hashlib module provides a helper function for efficient hashing of a " "file or file-like object." msgstr "" +"hashlib 模組提供了一個輔助函式,用於對檔案或類檔案物件 (file-like object) 進" +"行有效率的雜湊。" #: ../../library/hashlib.rst:270 msgid "" "Return a digest object that has been updated with contents of file object." -msgstr "" +msgstr "回傳已用檔案物件內容更新的摘要物件。" #: ../../library/hashlib.rst:272 msgid "" @@ -301,12 +371,19 @@ msgid "" "an unknown state after this function returns or raises. It is up to the " "caller to close *fileobj*." msgstr "" +"*fileobj* 必須是以二進位模式讀取的類檔案物件。它接受來自內建 :func:`open` 的" +"檔案物件、:class:`~io.BytesIO` 實例、來自 :meth:`socket.socket.makefile` 的 " +"SocketIO 物件等。該函式可以繞過 Python 的 I/O 並直接使用 :meth:`~io.IOBase." +"fileno` 中的檔案描述器 (file descriptor)。在此函式回傳或引發後,必須假定 " +"*fileobj* 處於未知狀態 (unknown state)。由呼叫者決定是否關閉 *fileobj*。" #: ../../library/hashlib.rst:280 msgid "" "*digest* must either be a hash algorithm name as a *str*, a hash " "constructor, or a callable that returns a hash object." msgstr "" +"*digest* 必須是名稱作為 *str* 的雜湊演算法、雜湊建構函式或會回傳雜湊物件的可" +"呼叫函式。" #: ../../library/hashlib.rst:283 msgid "Example:" @@ -314,7 +391,7 @@ msgstr "範例:" #: ../../library/hashlib.rst:306 msgid "Key derivation" -msgstr "" +msgstr "密鑰的生成" #: ../../library/hashlib.rst:308 msgid "" @@ -324,12 +401,18 @@ msgid "" "be tunable, slow, and include a `salt `_." msgstr "" +"密鑰生成 (key derivation) 和密鑰延伸 (key stretching) 演算法專為安全密碼雜湊" +"而設計。像是 ``sha1(password)`` 這樣過於單純的演算法無法抵抗暴力攻擊。一個好" +"的密碼雜湊函式必須是可調校的 (tunable)、緩慢的,並且有包含 `salt(加鹽) " +"`_。" #: ../../library/hashlib.rst:316 msgid "" "The function provides PKCS#5 password-based key derivation function 2. It " "uses HMAC as pseudorandom function." msgstr "" +"該函式提供基於密碼的 PKCS#5 密鑰生成函式 2。它使用 HMAC 作為偽隨機函式 " +"(pseudorandom function)。" #: ../../library/hashlib.rst:319 msgid "" @@ -339,6 +422,10 @@ msgid "" "sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a " "proper source, e.g. :func:`os.urandom`." msgstr "" +"字串 *hash_name* 是 HMAC 的雜湊摘要演算法所需的名稱,例如 ``sha1`` 或" +"``sha256``。*password* 和 *salt* 被直譯為位元組緩衝區。應用程式和函式庫應為 " +"*password* 設下合理的長度限制(例如 1024)。*salt* 應該是來自適當來源(例如 :" +"func:`os.urandom`)且大約 16 或更多位元組。" #: ../../library/hashlib.rst:325 msgid "" @@ -348,6 +435,10 @@ msgid "" "your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on " "the `stackexchange pbkdf2 iterations question`_ explain in detail." msgstr "" +"應根據雜湊演算法和計算能力選擇 *iterations* 次數。截至 2022 年,建議進行數十" +"萬次 SHA-256 疊代。有關為什麼以及如何選擇最適合你的應用程式的基本原理,請閱" +"讀 NIST-SP-800-132_ 的 *Appendix A.2.2*。`stackexchange pbkdf2 疊代問題`_\\ " +"上的答案有詳細解釋。" #: ../../library/hashlib.rst:331 msgid "" @@ -355,22 +446,26 @@ msgid "" "then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for " "SHA-512." msgstr "" +"*dklen* 是生成的密鑰長度。如果 *dklen* 為 ``None``,則會使用雜湊演算法 " +"*hash_name* 的摘要大小,例如 SHA-512 為 64。" #: ../../library/hashlib.rst:340 msgid "Function only available when Python is compiled with OpenSSL." -msgstr "" +msgstr "僅當有使用 OpenSSL 編譯 Python 時該函式才可用。" #: ../../library/hashlib.rst:344 msgid "" "Function now only available when Python is built with OpenSSL. The slow pure " "Python implementation has been removed." msgstr "" +"該函式現在僅在有使用 OpenSSL 建置 Python 時可用。緩慢的純 Python 實作已被刪" +"除。" #: ../../library/hashlib.rst:350 msgid "" "The function provides scrypt password-based key derivation function as " "defined in :rfc:`7914`." -msgstr "" +msgstr "該函式提供(如 :rfc:`7914` 中所定義的)scrypt 基於密碼的密鑰衍生函式。" #: ../../library/hashlib.rst:353 msgid "" @@ -379,6 +474,9 @@ msgid "" "length (e.g. 1024). *salt* should be about 16 or more bytes from a proper " "source, e.g. :func:`os.urandom`." msgstr "" +"*password* 和 *salt* 必須是\\ :term:`類位元組物件 `。應用" +"程式和函式庫應為 *password* 設下合理的長度限制(例如 1024)。*salt* 應該是來" +"自適當來源(例如 :func:`os.urandom`)且大約 16 或更多位元組。" #: ../../library/hashlib.rst:358 msgid "" @@ -386,6 +484,8 @@ msgid "" "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " "*dklen* is the length of the derived key in bytes." msgstr "" +"*n* 是 CPU/記憶體開銷係數、*r* 是區塊大小、*p* 為平行化係數、*maxmem* 為記憶" +"體限制(OpenSSL 1.1.0 預設為 32 MiB)。*dklen* 是生成密鑰的長度。" #: ../../library/hashlib.rst:366 msgid "BLAKE2" @@ -395,81 +495,95 @@ msgstr "BLAKE2" msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" -msgstr "" +msgstr "BLAKE2_ 是在 :rfc:`7693` 中定義的加密雜湊函式,有兩種類型:" #: ../../library/hashlib.rst:376 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" +"**BLAKE2b**,針對 64 位元平台進行了最佳化,可生成 1 到 64 位元組之間任意大小" +"的摘要," #: ../../library/hashlib.rst:379 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" +"**BLAKE2s**,針對 8 至 32 位元平台進行了最佳化,可生成 1 至 32 位元組之間任意" +"大小的摘要。" #: ../../library/hashlib.rst:382 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" +"BLAKE2 支援\\ **密鑰模式 (keyed mode)** (更快、更簡單的 HMAC_ 替代品)、**加" +"鹽雜湊 (salted hashing)**、**個人化**\\ 和\\ **樹狀雜湊**。" #: ../../library/hashlib.rst:385 msgid "" "Hash objects from this module follow the API of standard library's :mod:" "`hashlib` objects." -msgstr "" +msgstr "該模組中的雜湊物件遵循標準函式庫的 :mod:`hashlib` 物件 API。" #: ../../library/hashlib.rst:390 msgid "Creating hash objects" -msgstr "" +msgstr "建立雜湊物件" #: ../../library/hashlib.rst:392 msgid "New hash objects are created by calling constructor functions:" -msgstr "" +msgstr "新的雜湊物件是透過呼叫建構函式建立的:" #: ../../library/hashlib.rst:406 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" +"這些函式回傳相應的雜湊物件以計算 BLAKE2b 或 BLAKE2s。他們可以選擇採用這些通用" +"參數:" #: ../../library/hashlib.rst:409 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" +"*data*:要雜湊的初始資料塊 (data chunk),它必須是\\ :term:`類位元組物件 " +"`。它只能作為位置引數傳遞。" #: ../../library/hashlib.rst:412 msgid "*digest_size*: size of output digest in bytes." -msgstr "" +msgstr "*digest_size*:輸出摘要的大小(以位元組為單位)。" #: ../../library/hashlib.rst:414 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" +"*key*:用於密鑰雜湊的密鑰(BLAKE2b 最多 64 位元組、BLAKE2s 最多 32 位元組)。" #: ../../library/hashlib.rst:417 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" +"*salt*:用於隨機雜湊的加鹽(BLAKE2b 最多 16 個位元組、BLAKE2s 最多 8 個位元" +"組)。" #: ../../library/hashlib.rst:420 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" +"*person*:個人化字串(BLAKE2b 最多 16 個位元組、BLAKE2s 最多 8 個位元組)。" #: ../../library/hashlib.rst:423 msgid "The following table shows limits for general parameters (in bytes):" -msgstr "" +msgstr "下表顯示了一般參數的限制(以位元組為單位):" #: ../../library/hashlib.rst:426 msgid "Hash" -msgstr "" +msgstr "雜湊" #: ../../library/hashlib.rst:426 msgid "digest_size" @@ -520,64 +634,77 @@ msgid "" "example, ``b'salt'`` and ``b'salt\\x00'`` is the same value. (This is not " "the case for *key*.)" msgstr "" +"BLAKE2 規範定義了加鹽和個人化參數的恆定長度,但為了方便起見,此實作接受任意大" +"小的位元組字串,最多可達指定長度。如果參數的長度小於指定的長度,則用零補滿," +"所以像是 ``b'salt`` 和 ``b'salt\\x00`` 是相同的值。(但 *key* 的情況並非如" +"此。)" #: ../../library/hashlib.rst:441 msgid "These sizes are available as module `constants`_ described below." -msgstr "" +msgstr "這些大小可作為模組\\ `常數 `_\\ 使用,如下所述。" #: ../../library/hashlib.rst:443 msgid "" "Constructor functions also accept the following tree hashing parameters:" -msgstr "" +msgstr "建構函式還接受以下樹狀雜湊參數:" #: ../../library/hashlib.rst:445 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." -msgstr "" +msgstr "*fanout*:扇出(0 到 255,如果無限制則為 0、順序模式為 1)。" #: ../../library/hashlib.rst:447 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." -msgstr "" +msgstr "*depth*:樹的最大深度(1 到 255,如果無限制則為 255、順序模式為 1)。" #: ../../library/hashlib.rst:450 msgid "" "*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " "or in sequential mode)." msgstr "" +"*leaf_size*:葉的最大位元組長度(0 到 ``2**32-1``,如果無限制或處於順序模式則" +"為 0)。" #: ../../library/hashlib.rst:453 msgid "" "*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " "for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" +"*node_offset*:節點偏移量(BLAKE2b 為 0 到 ``2**64-1``,BLAKE2s 為 0 到 " +"``2**48-1``,0 表示第一個、最左邊、葉子或在順序模式下)。" #: ../../library/hashlib.rst:456 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." -msgstr "" +msgstr "*node_depth*:節點深度(0 到 255,葉為 0,或在順序模式下)。" #: ../../library/hashlib.rst:458 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" +"*inner_size*:內部摘要大小(BLAKE2b 為 0 到 64,BLAKE2s 為 0 到 32,順序模式" +"為 0)。" #: ../../library/hashlib.rst:461 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " "(``False`` for sequential mode)." msgstr "" +"*last_node*:布林值,代表處理的節點是否為最後一個(``False`` 代表順序模式)。" -#: ../../library/hashlib.rst:464 +#: ../../library/hashlib.rst:-1 msgid "Explanation of tree mode parameters." -msgstr "" +msgstr "樹狀模式參數說明。" #: ../../library/hashlib.rst:468 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" +"關於樹狀雜湊的綜合回顧,請參閱 `BLAKE2 規範 `_\\ 中的第 2.10 節。" #: ../../library/hashlib.rst:474 msgid "Constants" @@ -585,20 +712,20 @@ msgstr "常數" #: ../../library/hashlib.rst:479 msgid "Salt length (maximum length accepted by constructors)." -msgstr "" +msgstr "加鹽長度(建構函式接受的最大長度)。" #: ../../library/hashlib.rst:485 msgid "" "Personalization string length (maximum length accepted by constructors)." -msgstr "" +msgstr "個人化字串長度(建構函式接受的最大長度)。" #: ../../library/hashlib.rst:491 msgid "Maximum key size." -msgstr "" +msgstr "最大密鑰大小。" #: ../../library/hashlib.rst:497 msgid "Maximum digest size that the hash function can output." -msgstr "" +msgstr "雜湊函式可以輸出的最大摘要大小。" #: ../../library/hashlib.rst:501 msgid "Examples" @@ -606,7 +733,7 @@ msgstr "範例" #: ../../library/hashlib.rst:504 msgid "Simple hashing" -msgstr "" +msgstr "簡單雜湊" #: ../../library/hashlib.rst:506 msgid "" @@ -616,22 +743,28 @@ msgid "" "the object, and, finally, get the digest out of the object by calling :meth:" "`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." msgstr "" +"要計算某些資料的雜湊值,你應該首先透過呼叫適當的建構函式(:func:`blake2b` " +"或 :func:`blake2s`)以建構一個雜湊物件,然後透過於物件呼叫 :meth:`~hash." +"update` 來以資料對它更新,最後透過呼叫 :meth:`~hash.digest`\\ (或對於十六進" +"位編碼字串則為 :meth:`~hash.hexdigest`)從物件中獲得摘要。" #: ../../library/hashlib.rst:519 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" +"作為一個快捷方式,你可以將要更新的第一個資料塊作為位置引數直接傳遞給建構函" +"式:" #: ../../library/hashlib.rst:526 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" -msgstr "" +msgstr "你可以根據需求來多次呼叫 :meth:`hash.update` 以疊代更新雜湊:" #: ../../library/hashlib.rst:540 msgid "Using different digest sizes" -msgstr "" +msgstr "使用不同的摘要大小" #: ../../library/hashlib.rst:542 msgid "" @@ -639,6 +772,9 @@ msgid "" "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " "changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" +"BLAKE2 有可調整的摘要大小,BLAKE2b 最多為 64 位元組,BLAKE2s 最多為 32 位元" +"組。例如,要在不改變輸出大小的情況下用 BLAKE2b 替換 SHA-1,我們可以指定 " +"BLAKE2b 生成 20 位元組的摘要:" #: ../../library/hashlib.rst:556 msgid "" @@ -646,10 +782,12 @@ msgid "" "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" +"具有不同摘要大小的雜湊物件具有完全不同的輸出(較短的雜湊值\\ *不是*\\ 較長雜" +"湊值的前綴);即使輸出長度相同,BLAKE2b 和 BLAKE2s 也會產生不同的輸出:" #: ../../library/hashlib.rst:572 msgid "Keyed hashing" -msgstr "" +msgstr "密鑰雜湊 (Keyed hashing)" #: ../../library/hashlib.rst:574 msgid "" @@ -658,28 +796,38 @@ msgid "" "wikipedia.org/wiki/HMAC>`_ (HMAC). BLAKE2 can be securely used in prefix-MAC " "mode thanks to the indifferentiability property inherited from BLAKE." msgstr "" +"密鑰雜湊可用於身份驗證,作為\\ `基於雜湊的訊息驗證碼 (Hash-based message " +"authentication code) `_ (HMAC) 的更快、更" +"簡單的替代方案。由於繼承自 BLAKE 的不可微特性 (indifferentiability " +"property),BLAKE2 可以安全地用於 prefix-MAC 模式。" #: ../../library/hashlib.rst:580 msgid "" "This example shows how to get a (hex-encoded) 128-bit authentication code " "for message ``b'message data'`` with key ``b'pseudorandom key'``::" msgstr "" +"此範例示範了如何使用密鑰 ``b'pseudorandom key'`` 獲取訊息 ``b'message " +"data'`` 的(十六進位編碼)128 位元驗證碼: ::" #: ../../library/hashlib.rst:590 msgid "" "As a practical example, a web application can symmetrically sign cookies " "sent to users and later verify them to make sure they weren't tampered with::" msgstr "" +"舉一個實際的例子,網頁應用程式可以對發送給使用者的 cookie 進行對稱簽名 " +"(symmetrically sign),然後驗證它們以確保它們沒有被篡改: ::" #: ../../library/hashlib.rst:619 msgid "" "Even though there's a native keyed hashing mode, BLAKE2 can, of course, be " "used in HMAC construction with :mod:`hmac` module::" msgstr "" +"儘管有原生密鑰雜湊模式,BLAKE2 還是可以透過 :mod:`hmac` 模組用於建構 " +"HMAC: ::" #: ../../library/hashlib.rst:630 msgid "Randomized hashing" -msgstr "" +msgstr "隨機雜湊 (Randomized hashing)" #: ../../library/hashlib.rst:632 msgid "" @@ -687,6 +835,8 @@ msgid "" "function. Randomized hashing is useful for protecting against collision " "attacks on the hash function used in digital signatures." msgstr "" +"透過設定 *salt* 參數,使用者可以向雜湊函式引入隨機化。隨機雜湊在防止針對數位" +"簽章中雜湊函式的碰撞攻擊 (collision attacks) 非常有用。" #: ../../library/hashlib.rst:636 msgid "" @@ -708,18 +858,33 @@ msgid "" "hashing may reduce the amount of security provided by a digital signature " "when all portions of the message are prepared by the signer." msgstr "" +"隨機雜湊是為這樣的情況而設計的:一方(訊息準備者)生成全部或部分訊息並由另一" +"方(訊息簽名者)簽名。如果訊息準備者能夠發現加密雜湊函式發生碰撞(collision," +"即兩條訊息產生相同的雜湊值),那麼他們可能會準備有意義的訊息版本,該版本將產" +"生相同的雜湊值和數位簽章,但結果不同(例如,將 $1,000,000 轉入賬戶,而不是 " +"$10)。加密雜湊函式的設計以抗碰撞性為主要目標,但當前對加密雜湊函式攻擊的關注" +"可能會導致給定的加密雜湊函式所提供的抗碰撞性低於預期。隨機雜湊透過降低準備者" +"在數位簽章生成過程中生成最終產生相同雜湊值的兩個或多個訊息的可能性,為簽名者" +"提供額外的保護 —— 即便嘗試去找到雜湊函式碰撞的發生是實際可行的。然而,若訊息" +"的所有部分都是由簽名者所準備好的,使用隨機雜湊可能會降低數位簽章提供的安全" +"性。" #: ../../library/hashlib.rst:655 msgid "" "(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" msgstr "" +"(`NIST SP-800-106 「數位簽章的隨機雜湊 (Randomized Hashing for Digital " +"Signatures)」 `_)" #: ../../library/hashlib.rst:658 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" +"在 BLAKE2 中,加鹽在初始化期間作為雜湊函式的一次性輸入被處理,而不是作為每個" +"壓縮函式的輸入。" #: ../../library/hashlib.rst:663 msgid "" @@ -728,10 +893,13 @@ msgid "" "passwords. See `BLAKE2 FAQ `_ for more " "information." msgstr "" +"使用 BLAKE2 或任何其他通用加密雜湊函式(例如 SHA-256)的\\ *加鹽雜湊* (或單" +"純雜湊)不適合對密碼進行雜湊處理。有關更多資訊,請參閱 `BLAKE2 FAQ `_ 。" #: ../../library/hashlib.rst:686 msgid "Personalization" -msgstr "" +msgstr "個人化" #: ../../library/hashlib.rst:688 msgid "" @@ -739,6 +907,8 @@ msgid "" "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" +"有時候強制雜湊函式為不同目的的相同輸入生成不同的摘要是很有用的。引用 Skein 雜" +"湊函式的作者的話:" #: ../../library/hashlib.rst:692 msgid "" @@ -749,40 +919,46 @@ msgid "" "force the application to make the hash inputs the same. Personalizing each " "hash function used in the protocol summarily stops this type of attack." msgstr "" +"我們建議所有應用程式設計者認真考慮這樣做;我們已經看到許多協議,其中在協議的" +"一個部分中計算的雜湊可以在完全不同的部分中使用,因為兩次雜湊計算是在相似或相" +"關的資料上完成的,並且攻擊者可以強制應用程式將雜湊輸入設為相同的。對協議中使" +"用的每個雜湊函式進行個人化可以立即阻止此類攻擊。" #: ../../library/hashlib.rst:699 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" +"(`Skein 雜湊函式系列 `_,第 21 頁)" #: ../../library/hashlib.rst:703 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" -msgstr "" +msgstr "BLAKE2 可以透過將位元組傳遞給 *person* 引數來做個人化: ::" #: ../../library/hashlib.rst:717 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." -msgstr "" +msgstr "個人化與密鑰模式一起還可以用於從單個密鑰得出不同的密鑰。" #: ../../library/hashlib.rst:731 msgid "Tree mode" -msgstr "" +msgstr "樹狀模式" #: ../../library/hashlib.rst:733 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" -msgstr "" +msgstr "下面是對具有兩個葉節點的最小樹進行雜湊處理的範例: ::" #: ../../library/hashlib.rst:739 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" -msgstr "" +msgstr "此範例使用 64-byte 內部摘要,並回傳 32-byte 最終摘要: ::" #: ../../library/hashlib.rst:769 msgid "Credits" -msgstr "" +msgstr "製作人員" #: ../../library/hashlib.rst:771 msgid "" @@ -791,12 +967,16 @@ msgid "" "created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and " "*Raphael C.-W. Phan*." msgstr "" +"BLAKE2_ 由 *Jean-Philippe Aumasson*、*Samuel Neves*、*Zooko Wilcox-O'Hearn* " +"和 *Christian Winnerlein* 設計,基於由 *Jean-Philippe Aumasson*、*Luca " +"Henzen*、*Willi Meier* 和 *Raphael C.-W. Phan* 所建立的 SHA-3_ 最終版本 " +"BLAKE_。" #: ../../library/hashlib.rst:776 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." -msgstr "" +msgstr "它使用 *Daniel J. Bernstein* 設計的 ChaCha_ 密碼的核心演算法。" #: ../../library/hashlib.rst:778 msgid "" @@ -804,16 +984,19 @@ msgid "" "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " "documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" +"標準函式庫實作是基於 pyblake2_ 模組。它是由 *Dmitry Chestnykh* 在 *Samuel " +"Neves* 的 C 版本實作為基礎所編寫的。該文件是由 *Dmitry Chestnykh* 編寫並從 " +"pyblake2_ 複製過來的。" #: ../../library/hashlib.rst:782 msgid "The C code was partly rewritten for Python by *Christian Heimes*." -msgstr "" +msgstr "*Christian Heimes* 為 Python 重寫了部分 C 程式碼。" #: ../../library/hashlib.rst:784 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" -msgstr "" +msgstr "以下公開領域貢獻適用於 C 雜湊函式實作、擴充程式碼和此文件:" #: ../../library/hashlib.rst:787 msgid "" @@ -821,6 +1004,8 @@ msgid "" "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" +"在法律允許的範圍內,作者已將該軟體的所有版權以及相關和鄰接權利奉獻給全球的公" +"開領域。該軟體的發布沒有任何授權 (warranty)。" #: ../../library/hashlib.rst:791 msgid "" @@ -828,6 +1013,9 @@ msgid "" "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" +"你應會隨本軟體一起收到一份 CC0 公眾領域貢獻宣告 (CC0 Public Domain " +"Dedication) 的副本。如果沒有,請參閱 https://creativecommons.org/" +"publicdomain/zero/1.0/ 。" #: ../../library/hashlib.rst:795 msgid "" @@ -835,44 +1023,46 @@ msgid "" "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" +"以下人員根據創用 CC 通用公眾領域貢獻宣告 1.0 (Creative Commons Public Domain " +"Dedication 1.0 Universal) 於專案和公開領域做出了開發或貢獻:" #: ../../library/hashlib.rst:799 msgid "*Alexandr Sokolovskiy*" msgstr "*Alexandr Sokolovskiy*" -#: ../../library/hashlib.rst:819 +#: ../../library/hashlib.rst:820 msgid "Module :mod:`hmac`" msgstr ":mod:`hmac` 模組" #: ../../library/hashlib.rst:820 msgid "A module to generate message authentication codes using hashes." -msgstr "" +msgstr "使用雜湊生成訊息驗證程式碼的模組。" -#: ../../library/hashlib.rst:822 +#: ../../library/hashlib.rst:823 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" #: ../../library/hashlib.rst:823 msgid "Another way to encode binary hashes for non-binary environments." -msgstr "" +msgstr "另一種在非二進位環境中編碼二進位雜湊的方法。" -#: ../../library/hashlib.rst:825 +#: ../../library/hashlib.rst:826 msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" -msgstr "" +msgstr "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" #: ../../library/hashlib.rst:826 msgid "The FIPS 180-4 publication on Secure Hash Algorithms." -msgstr "" +msgstr "有關安全雜湊演算法的 FIPS 180-4 出版物。" -#: ../../library/hashlib.rst:828 +#: ../../library/hashlib.rst:829 msgid "https://csrc.nist.gov/publications/detail/fips/202/final" -msgstr "" +msgstr "https://csrc.nist.gov/publications/detail/fips/202/final" #: ../../library/hashlib.rst:829 msgid "The FIPS 202 publication on the SHA-3 Standard." -msgstr "" +msgstr "有關 SHA-3 標準的 FIPS 202 出版物。" -#: ../../library/hashlib.rst:831 +#: ../../library/hashlib.rst:832 msgid "https://www.blake2.net/" msgstr "https://www.blake2.net/" @@ -880,7 +1070,7 @@ msgstr "https://www.blake2.net/" msgid "Official BLAKE2 website." msgstr "BLAKE2 官方網站。" -#: ../../library/hashlib.rst:834 +#: ../../library/hashlib.rst:836 msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" msgstr "https://en.wikipedia.org/wiki/Cryptographic_hash_function" @@ -889,14 +1079,16 @@ msgid "" "Wikipedia article with information on which algorithms have known issues and " "what that means regarding their use." msgstr "" +"包含有關哪些演算法存在已知問題以及這些問題對其使用意味著什麼資訊的維基百科文" +"章。" -#: ../../library/hashlib.rst:838 +#: ../../library/hashlib.rst:839 msgid "https://www.ietf.org/rfc/rfc8018.txt" msgstr "https://www.ietf.org/rfc/rfc8018.txt" #: ../../library/hashlib.rst:839 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" -msgstr "" +msgstr "PKCS #5:基於密碼的加密規範版本 2.1" #: ../../library/hashlib.rst:841 msgid "" @@ -906,17 +1098,19 @@ msgstr "" #: ../../library/hashlib.rst:842 msgid "NIST Recommendation for Password-Based Key Derivation." -msgstr "" +msgstr "NIST(美國國家標準技術研究院)針對基於密碼的密鑰衍生的建議。" #: ../../library/hashlib.rst:12 msgid "message digest, MD5" -msgstr "" +msgstr "message digest(訊息摘要)、MD5" #: ../../library/hashlib.rst:12 msgid "" "secure hash algorithm, SHA1, SHA2, SHA224, SHA256, SHA384, SHA512, SHA3, " "Shake, Blake2" msgstr "" +"安全雜湊演算法、SHA1、SHA2、SHA224、SHA256、SHA384、SHA512、SHA3、Shake、" +"Blake2" #: ../../library/hashlib.rst:55 msgid "OpenSSL" @@ -929,6 +1123,3 @@ msgstr "(使用於 hashlib 模組中)" #: ../../library/hashlib.rst:370 msgid "blake2b, blake2s" msgstr "blake2b, blake2s" - -#~ msgid ":func:`blake2b` and :func:`blake2s` were added." -#~ msgstr "加入 :func:`blake2b` 和 :func:`blake2s`。" From 9d7e25c84bef2ca241dc299b6d1a8bc38e5787a8 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Sun, 25 Aug 2024 21:55:03 +0800 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Becca <61359625+beccalzh@users.noreply.github.com> --- library/hashlib.po | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/library/hashlib.po b/library/hashlib.po index f8dfd0c3a7..a0f38aa621 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -99,7 +99,7 @@ msgstr "" "`sha3_256`、:func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:" "`shake_256`、:func:`blake2b` 和 :func:`blake2s`。:func:`md5` 通常也可用,但如" "果你使用罕見的「符合 FIPS (FIPS compliant)」的 Python 建置版本,它可能不存在" -"或這不被允許使用。以上會對應到 :data:`algorithms_guaranteed`。" +"或者不被允許使用。以上會對應到 :data:`algorithms_guaranteed`。" #: ../../library/hashlib.rst:65 msgid "" @@ -141,7 +141,7 @@ msgid "" "cryptographic one-way compression function." msgstr "" "所有 hashlib 建構函式都採用一個僅限關鍵字引數 (keyword-only argument) " -"*usedforsecurity*,其預設值為 ``True``。false 值則會允許在受限環境中使用不安" +"*usedforsecurity*,其預設值為 ``True``。False 值則會允許在受限環境中使用不安" "全 (insecure) 和阻塞的 (blocked) 雜湊演算法。``False`` 表示雜湊演算法未在安全" "情境中使用,例如作為一種非加密用途的單向壓縮函式。" @@ -403,8 +403,8 @@ msgid "" msgstr "" "密鑰生成 (key derivation) 和密鑰延伸 (key stretching) 演算法專為安全密碼雜湊" "而設計。像是 ``sha1(password)`` 這樣過於單純的演算法無法抵抗暴力攻擊。一個好" -"的密碼雜湊函式必須是可調校的 (tunable)、緩慢的,並且有包含 `salt(加鹽) " -"`_。" +"的密碼雜湊函式必須是可調校的 (tunable)、緩慢的,並且有包含 `salt(鹽) " +"`_。" #: ../../library/hashlib.rst:316 msgid "" @@ -422,7 +422,7 @@ msgid "" "sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a " "proper source, e.g. :func:`os.urandom`." msgstr "" -"字串 *hash_name* 是 HMAC 的雜湊摘要演算法所需的名稱,例如 ``sha1`` 或" +"字串 *hash_name* 是 HMAC 的雜湊摘要演算法所需的名稱,例如 ``sha1`` 或 " "``sha256``。*password* 和 *salt* 被直譯為位元組緩衝區。應用程式和函式庫應為 " "*password* 設下合理的長度限制(例如 1024)。*salt* 應該是來自適當來源(例如 :" "func:`os.urandom`)且大約 16 或更多位元組。" @@ -567,7 +567,7 @@ msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" -"*salt*:用於隨機雜湊的加鹽(BLAKE2b 最多 16 個位元組、BLAKE2s 最多 8 個位元" +"*salt*:用於隨機雜湊的鹽(BLAKE2b 最多 16 個位元組、BLAKE2s 最多 8 個位元" "組)。" #: ../../library/hashlib.rst:420 @@ -634,9 +634,9 @@ msgid "" "example, ``b'salt'`` and ``b'salt\\x00'`` is the same value. (This is not " "the case for *key*.)" msgstr "" -"BLAKE2 規範定義了加鹽和個人化參數的恆定長度,但為了方便起見,此實作接受任意大" -"小的位元組字串,最多可達指定長度。如果參數的長度小於指定的長度,則用零補滿," -"所以像是 ``b'salt`` 和 ``b'salt\\x00`` 是相同的值。(但 *key* 的情況並非如" +"BLAKE2 規範定義了鹽和個人化參數的恆定長度,但為了方便起見,此實作接受任意大小" +"的位元組字串,最多可達指定長度。如果參數的長度小於指定的長度,則用零補滿,所" +"以像是 ``b'salt`` 和 ``b'salt\\x00`` 是相同的值。(但 *key* 的情況並非如" "此。)" #: ../../library/hashlib.rst:441 @@ -712,7 +712,7 @@ msgstr "常數" #: ../../library/hashlib.rst:479 msgid "Salt length (maximum length accepted by constructors)." -msgstr "加鹽長度(建構函式接受的最大長度)。" +msgstr "鹽長度(建構函式接受的最大長度)。" #: ../../library/hashlib.rst:485 msgid "" @@ -883,8 +883,8 @@ msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -"在 BLAKE2 中,加鹽在初始化期間作為雜湊函式的一次性輸入被處理,而不是作為每個" -"壓縮函式的輸入。" +"在 BLAKE2 中,鹽在初始化期間作為雜湊函式的一次性輸入被處理,而不是作為每個壓" +"縮函式的輸入。" #: ../../library/hashlib.rst:663 msgid "" @@ -940,7 +940,7 @@ msgstr "BLAKE2 可以透過將位元組傳遞給 *person* 引數來做個人化 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." -msgstr "個人化與密鑰模式一起還可以用於從單個密鑰得出不同的密鑰。" +msgstr "個人化與密鑰模式還可以一起用於從單個密鑰得出不同的密鑰。" #: ../../library/hashlib.rst:731 msgid "Tree mode" From 43c9b027a4854b11b759654248d008110776f8a3 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Tue, 27 Aug 2024 00:32:59 +0800 Subject: [PATCH 3/3] Update library/hashlib.po --- library/hashlib.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/hashlib.po b/library/hashlib.po index a0f38aa621..2699ecba6f 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -797,7 +797,7 @@ msgid "" "mode thanks to the indifferentiability property inherited from BLAKE." msgstr "" "密鑰雜湊可用於身份驗證,作為\\ `基於雜湊的訊息驗證碼 (Hash-based message " -"authentication code) `_ (HMAC) 的更快、更" +"authentication code) `_ (HMAC) 的更快、更" "簡單的替代方案。由於繼承自 BLAKE 的不可微特性 (indifferentiability " "property),BLAKE2 可以安全地用於 prefix-MAC 模式。" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy