与您自己的randfunc一起使用crypto.rsa.generate()
我已经创建了自己的随机数生成器,并且正在尝试在rsa.generate()
函数randfunc
参数中使用它。我的生成器返回txt文件,我想将其读为randfunc,with rade ,但是我得到index
error。我知道,当您放置图像时,它可以正常工作,但我不知道如何使TXT文件工作或任何其他数据结构(例如列表或数组工作)。
错误代码:
msb = bord(randfunc(1)[0])
IndexError: index out of range
文件:
filePath = "data.txt"
file = open(file,'rb')
生成位:
outputFile = open(outputFile_path, 'a')
bufor += str(int(math operations))
if(bitCounter > 7):
outputFile.write(bufor)
bufor = ''
byteCounter += 1
I have created my own random number generator and I am trying to use it in RSA.generate()
functions as randfunc
parameter. My generator returns txt file of bits and I would like to read it as randfunc with file.read
however I get a Index out of range
error. I know that when you put an image it works but I don't know how to make txt file work or any other data structure like list or array work.
Error code:
msb = bord(randfunc(1)[0])
IndexError: index out of range
File:
filePath = "data.txt"
file = open(file,'rb')
Generating bits:
outputFile = open(outputFile_path, 'a')
bufor += str(int(math operations))
if(bitCounter > 7):
outputFile.write(bufor)
bufor = ''
byteCounter += 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论