Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 1 | Message Digests |
| 2 | ==================== |
| 3 | |
Matthew Iversen | 505491b | 2013-10-19 15:56:17 +1100 | [diff] [blame^] | 4 | .. class:: cryptography.primitives.hashes.BaseHash |
| 5 | |
| 6 | Abstract base class that implements a common interface for |
| 7 | all hash algorithms that follow here |
| 8 | |
| 9 | .. method:: update(string) |
| 10 | |
| 11 | :param bytes string: The bytes you wish to hash. |
| 12 | |
| 13 | .. method:: copy() |
| 14 | |
| 15 | :return: a new instance of this object with a |
| 16 | copied internal state. |
| 17 | |
| 18 | .. method:: digest() |
| 19 | |
| 20 | :return bytes: The message digest as bytes. |
| 21 | |
| 22 | .. method:: hexdigest() |
| 23 | |
| 24 | :return str: The message digest as hex. |
| 25 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 26 | SHA-1 |
Matthew Iversen | 505491b | 2013-10-19 15:56:17 +1100 | [diff] [blame^] | 27 | ~~~~~ |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 28 | |
| 29 | .. attention:: |
| 30 | |
| 31 | NIST has deprecated SHA-1 in favor of the SHA-2 variants. New applications |
| 32 | are strongly suggested to use SHA-2 over SHA-1. |
| 33 | |
| 34 | .. class:: cryptography.primitives.hashes.SHA1() |
| 35 | |
| 36 | SHA-1 is a cryptographic hash function standardized by NIST. It has a |
| 37 | 160-bit message digest. |
| 38 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 39 | SHA-2 Family |
Matthew Iversen | 505491b | 2013-10-19 15:56:17 +1100 | [diff] [blame^] | 40 | ~~~~~~~~~~~~ |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 41 | |
| 42 | .. class:: cryptography.primitives.hashes.SHA224() |
| 43 | |
| 44 | SHA-224 is a cryptographic hash function from the SHA-2 family and |
| 45 | standardized by NIST. It has a 224-bit message digest. |
| 46 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 47 | .. class:: cryptography.primitives.hashes.SHA256() |
| 48 | |
| 49 | SHA-256 is a cryptographic hash function from the SHA-2 family and |
| 50 | standardized by NIST. It has a 256-bit message digest. |
| 51 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 52 | .. class:: cryptography.primitives.hashes.SHA384() |
| 53 | |
| 54 | SHA-384 is a cryptographic hash function from the SHA-2 family and |
| 55 | standardized by NIST. It has a 384-bit message digest. |
| 56 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 57 | .. class:: cryptography.primitives.hashes.SHA512() |
| 58 | |
| 59 | SHA-512 is a cryptographic hash function from the SHA-2 family and |
| 60 | standardized by NIST. It has a 512-bit message digest. |
| 61 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 62 | RIPEMD160 |
Matthew Iversen | 505491b | 2013-10-19 15:56:17 +1100 | [diff] [blame^] | 63 | ~~~~~~~~~ |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 64 | |
| 65 | .. class:: cryptography.primitives.hashes.RIPEMD160() |
| 66 | |
| 67 | RIPEMD160 is a cryptographic hash function that is part of ISO/IEC |
| 68 | 10118-3:2004. It has a 160-bit message digest. |
| 69 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 70 | Whirlpool |
Matthew Iversen | 505491b | 2013-10-19 15:56:17 +1100 | [diff] [blame^] | 71 | ~~~~~~~~~ |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 72 | |
| 73 | .. class:: cryptography.primitives.hashes.Whirlpool() |
| 74 | |
| 75 | Whirlpool is a cryptographic hash function that is part of ISO/IEC |
| 76 | 10118-3:2004. It has a 512-bit message digest. |
| 77 | |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 78 | MD5 |
Matthew Iversen | 505491b | 2013-10-19 15:56:17 +1100 | [diff] [blame^] | 79 | ~~~ |
Paul Kehrer | 36e7d0d | 2013-10-18 18:54:40 -0500 | [diff] [blame] | 80 | |
| 81 | .. warning:: |
| 82 | |
| 83 | MD5 is a deprecated hash algorithm that has practical known collision |
| 84 | attacks. You are strongly discouraged from using it. |
| 85 | |
| 86 | .. class:: cryptography.primitives.hashes.MD5() |
| 87 | |
| 88 | MD5 is a deprecated cryptographic hash function. It has a 160-bit message |
| 89 | digest and has practical known collision attacks. |