code: def removeBitPadding(str, blocksize=AES_blocksize):
      'Remove bit padding with 0x80 followed by zero (null) bytes'
      pad_len = 0    
      for char in str[::-1]: # str[::-1] reverses string
          if char == '\0':
              pad_len += 1
          else:
              break
      pad_len += 1
      str = str[:-pad_len]
     
      return stf removeBitPadding(str, blocksize=AES_blocksize):
      'Remove bit padding with 0x80 followed by zero (null) bytes'
      pad_len = 0    
      for char in str[::-1]: # str[::-1] reverses string
          if char == '\0':
              pad_len += 1
          else:
              break
      pad_len += 1
      str = str[:-pad_len]
     
      return str
docs: Remove bit padding with 0x80 followed by zero (null) bytes