Connected: An Internet Encyclopedia
RFC 1321 - 3.1 Step 1. Append Padding Bits

Top: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1321
Up: 3. MD5 Algorithm Description
Prev: 3. MD5 Algorithm Description
Next: 3.2 Step 2. Append Length

### 3.1 Step 1. Append Padding Bits

The message is "padded" (extended) so that its length (in bits) is congruent to 448, modulo 512. That is, the message is extended so that it is just 64 bits shy of being a multiple of 512 bits long. Padding is always performed, even if the length of the message is already congruent to 448, modulo 512.

Padding is performed as follows: a single "1" bit is appended to the message, and then "0" bits are appended so that the length in bits of the padded message becomes congruent to 448, modulo 512. In all, at least one bit and at most 512 bits are appended.

Next: 3.2 Step 2. Append Length

Connected: An Internet Encyclopedia
RFC 1321 - 3.1 Step 1. Append Padding Bits