SHA-384¶
SHA-384 belongs to the SHA-2_ family of cryptographic hashes. It produces the 384 bit digest of a message.
SHA-384 is roughly 50% faster than SHA-224 and SHA-256 on 64-bit machines, even if its digest is longer. The speed-up is due to the internal computation being performed with 64-bit words, whereas the other two hash functions employ 32-bit words.
SHA-512, SHA-512/224, and SHA-512/256 too are faster on 64-bit machines for the same reason.
This is an example showing how to use SHA-384:
>>> from Crypto.Hash import SHA384
>>>
>>> h = SHA384.new()
>>> h.update(b'Hello')
>>> print(h.hexdigest())
SHA stands for Secure Hash Algorithm.
SHA-384 is not vulnerable to length-extension attacks.
SHA-384 cryptographic hash algorithm.
SHA-384 belongs to the SHA-2_ family of cryptographic hashes. It produces the 384 bit digest of a message.
>>> from Crypto.Hash import SHA384
>>>
>>> h = SHA384.new()
>>> h.update(b'Hello')
>>> print h.hexdigest()
SHA stands for Secure Hash Algorithm.
- class Crypto.Hash.SHA384.SHA384Hash(data=None)¶
Class that implements a SHA-384 hash
- Undocumented:
block_size
- new(data=None)¶
Return a fresh instance of the hash object.
Unlike the copy method, the internal state of the object is empty.
- Parameters:
- databyte string
The next chunk of the message being hashed.
- Return:
A hash object of the same type
- oid = b'\x06\t`\x86H\x01e\x03\x04\x02\x02'¶
ASN.1 Object identifier (OID):
id-sha384 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 2 }
This value uniquely identifies the SHA-384 algorithm.
- Crypto.Hash.SHA384.digest_size = 48¶
The size of the resulting hash in bytes.
- Crypto.Hash.SHA384.new(data=None)¶
Return a fresh instance of the hash object.
- Parameters:
- databyte string
The very first chunk of the message to hash. It is equivalent to an early call to SHA384Hash.update(). Optional.
- Return:
A SHA384Hash object