MD2

MD2 is specified in RFC1319 and it produces the 128 bit digest of a message. For example:

>>> from Crypto.Hash import MD2
>>>
>>> h = MD2.new()
>>> h.update(b'Hello')
>>> print h.hexdigest()

MD2 stand for Message Digest version 2, and it was invented by Rivest in 1989.

Warning

This algorithm is not considered secure. Do not use it for new designs.

MD2 cryptographic hash algorithm.

MD2 is specified in RFC1319 and it produces the 128 bit digest of a message.

>>> from Crypto.Hash import MD2
>>>
>>> h = MD2.new()
>>> h.update(b'Hello')
>>> print h.hexdigest()

MD2 stand for Message Digest version 2, and it was invented by Rivest in 1989.

This algorithm is both slow and insecure. Do not use it for new designs.

class Crypto.Hash.MD2.MD2Hash(data=None)

Class that implements an MD2 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\x08*\x86H\x86\xf7\r\x02\x02'

ASN.1 Object identifier (OID):

id-md2 OBJECT IDENTIFIER ::= {
    iso(1) member-body(2) us(840) rsadsi(113549)
     digestAlgorithm(2) 2
}

This value uniquely identifies the MD2 algorithm.

Crypto.Hash.MD2.digest_size = 16

The size of the resulting hash in bytes.

Crypto.Hash.MD2.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 MD2Hash.update(). Optional.

Return:

An MD2Hash object