加密服務
********

The modules described in this chapter implement various algorithms of
a cryptographic nature.  They are available at the discretion of the
installation. Here's an overview:

* "hashlib" --- 安全雜湊與訊息摘要

  * 雜湊演算法

  * 用法

  * 建構函式

    * "new()"

    * "md5()"

    * "sha1()"

    * "sha224()"

    * "sha256()"

    * "sha384()"

    * "sha512()"

    * "sha3_224()"

    * "sha3_256()"

    * "sha3_384()"

    * "sha3_512()"

  * 屬性

    * "algorithms_guaranteed"

    * "algorithms_available"

  * 雜湊物件

    * "digest_size"

    * "block_size"

    * "name"

    * "update()"

    * "digest()"

    * "hexdigest()"

    * "copy()"

  * SHAKE 可變長度摘要

    * "shake_128()"

    * "shake_256()"

    * "digest()"

    * "hexdigest()"

  * 檔案雜湊

    * "file_digest()"

  * 密鑰的生成

    * "pbkdf2_hmac()"

    * "scrypt()"

  * BLAKE2

    * 建立雜湊物件

      * "blake2b()"

      * "blake2s()"

    * 常數

      * "SALT_SIZE"

      * "SALT_SIZE"

      * "PERSON_SIZE"

      * "PERSON_SIZE"

      * "MAX_KEY_SIZE"

      * "MAX_KEY_SIZE"

      * "MAX_DIGEST_SIZE"

      * "MAX_DIGEST_SIZE"

    * 範例

      * 簡單雜湊

      * 使用不同的摘要大小

      * 密鑰雜湊 (Keyed hashing)

      * 隨機雜湊 (Randomized hashing)

      * 個人化

      * 樹狀模式

    * 製作人員

* "hmac" --- 基於金鑰雜湊的訊息驗證

  * "new()"

  * "digest()"

  * "update()"

  * "digest()"

  * "hexdigest()"

  * "copy()"

  * "digest_size"

  * "block_size"

  * "name"

  * "compare_digest()"

* "secrets" --- 產生用於管理機密的安全亂數

  * 亂數

    * "SystemRandom"

    * "choice()"

    * "randbelow()"

    * "randbits()"

  * 產生權杖（token）

    * "token_bytes()"

    * "token_hex()"

    * "token_urlsafe()"

    * 權杖應當使用多少個位元組？

  * 其他函式

    * "compare_digest()"

  * 應用技巧和典範實務（best practices）
