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