def removePadding(str, blocksize=AES_blocksize, mode='CMS'):
  ''' Remove padding from string 
  Input: (str) str - String to be padded
         (int) blocksize - block size of the algorithm
         (string) mode - padding scheme one in (CMS, Bit, ZeroLen, Null, Space, Random)
  Return:(string) Decrypted string without padding 
    '''    
  if mode not in (0,'CMS'):     
    for k in MODES.keys():
        if mode in k:
            return globals()['append'+k[1]+'Padding'](str, blocksize)
        else:
            return removeCMSPadding(str, blocksize)
  else:
      return removeCMSPadding(str, blocksize)
Remove padding from string 
  Input: (str) str - String to be padded
         (int) blocksize - block size of the algorithm
         (string) mode - padding scheme one in (CMS, Bit, ZeroLen, Null, Space, Random)
  Return:(string) Decrypted string without padding