问题是关于填充。Python的rsa模块使用
PKCS1填充解密结果,但不会删除填充。使用下面我从此处采取的功能解决了问题:
def pkcs1_unpad(text):if len(text) > 0 and text[0] == 'x02': # Find end of padding marked by nul pos = text.find('x00') if pos > 0: return text[pos+1:]return None
欢迎分享,转载请注明来源:内存溢出
问题是关于填充。Python的rsa模块使用
PKCS1填充解密结果,但不会删除填充。使用下面我从此处采取的功能解决了问题:
def pkcs1_unpad(text):if len(text) > 0 and text[0] == 'x02': # Find end of padding marked by nul pos = text.find('x00') if pos > 0: return text[pos+1:]return None
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)