| 1 |
SHA-384 |
| 2 |
======= |
| 3 |
|
| 4 |
SHA-384 belongs to the SHA-2_ family of cryptographic hashes. |
| 5 |
It produces the 384 bit digest of a message. |
| 6 |
|
| 7 |
SHA-384 is roughly 50% faster than SHA-224 and SHA-256 on 64-bit machines, even if its digest is longer. |
| 8 |
The speed-up is due to the internal computation being performed with 64-bit words, |
| 9 |
whereas the other two hash functions employ 32-bit words. |
| 10 |
|
| 11 |
SHA-512, SHA-512/224, and SHA-512/256 too are faster on 64-bit machines for the same reason. |
| 12 |
|
| 13 |
This is an example showing how to use SHA-384: |
| 14 |
|
| 15 |
>>> from Crypto.Hash import SHA384 |
| 16 |
>>> |
| 17 |
>>> h = SHA384.new() |
| 18 |
>>> h.update(b'Hello') |
| 19 |
>>> print(h.hexdigest()) |
| 20 |
|
| 21 |
*SHA* stands for Secure Hash Algorithm. |
| 22 |
|
| 23 |
SHA-384 is **not** vulnerable to `length-extension attacks <https://crypto.stackexchange.com/questions/3978/understanding-the-length-extension-attack>`_. |
| 24 |
|
| 25 |
.. _SHA-2: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf |
| 26 |
|
| 27 |
.. automodule:: Crypto.Hash.SHA384 |
| 28 |
:members: |