# Padding schemes reversal and space efficiency

My crypto course proposes the following padding schemes:

1. $$\operatorname{pad}(m) = m \mathbin\| 0^i$$

2. $$\operatorname{pad}(m) = m \mathbin\| 10^i$$

3. $$\operatorname{pad}(m) = m \mathbin\| 0^i \mathbin\| E(\left|m\right|)_l$$

4. $$\operatorname{pad}(m) = E(\left|m\right|)_l \mathbin\| m \mathbin\| 0^i$$

where $$E(\left|m\right|)_l$$ is the $$l$$-bit encoding of the length of $$m$$ and $$l$$ is the size of the block in the scheme. The question is:

1. How can one reverse each padding?

2. Which padding is more space efficient?

I'm at risk of overthinking these questions. Thus, I ask for your experience. To me, the first the more space efficient but not always applicable. It can only be reverted under certain assumptions. But these assumptions hold for 3 and 4 also, if I'm not mistaken. For 2, I don't see very well the advantage. It may help sometimes but others (say 1 has to be written in the next block) it may force to introduce another block. So, overcomplicating matters one could do an average analysis of cases.

1. The more space efficient but cannot always be reverted, for instance if one inputs $$m = 1$$.