proper implementation of PKCS#7 padding