0
nam=input('enter file name and extention:   ',)

inf=open(nam,'rb')
data = inf.read()
J=int.from_bytes(data, byteorder='big')

E=(J**int(e))%n
E=int(E)
np.savetxt(nam + '.enc', E)

I am getting a 'IndexError: tuple index out of range' error, and to be quite frank I have no clue why. Any help would be appreciated. Thanks in advance.

niraj
  • 17,498
  • 4
  • 33
  • 48
  • Don't know if this is the problem, but you never closed the file before trying to write to it. You need `inf.close()` or use a [`with`](https://stackoverflow.com/questions/1369526/what-is-the-python-keyword-with-used-for) statement. – pault Mar 13 '18 at 17:52
  • I'm writing to a completely different file, so i don't think that's the issue, but i might be wrong. Ill try it and see what happens (Yep still get the error). – Femi Mark Mar 13 '18 at 17:57

0 Answers0