Python Forum
TypeError: '>=' not supported between instances of 'int' and 'str'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: '>=' not supported between instances of 'int' and 'str'
#7
You have problem sending the public key from the server. You send a str representation of PublicKey instance. Then on client side after decoding you just take first 2 char from that str and try to use them when encrypt you password message
not tested, but try

in server replace line 56 msg = f'{pkey}' with msg = pkey.hex()
in client replace line 13 serverkey = s.recv(1024).decode() with serverkey = PublicKey.from_hex(s.recv(1024).decode())
note, you need to import PublicKey before use it

and then line 15 will become msg = f'PSWD{RSA.Message.from_hex(new_pass).encrypt(serverkey)}'

Also, not sure you want to use Message.from_hex() to create message for the new password.


ALSO, Same apply when sending client public key to server - try to make same changes on your own, otherwise you will get the same error when server try to use client public key.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: TypeError: '>=' not supported between instances of 'int' and 'str' - by buran - Mar-10-2021, 07:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sort Function: <' not supported between instances of 'float' and 'tuple' quest 2 8,152 Apr-30-2021, 07:37 PM
Last Post: quest
  Type error: '>' not supported between instances of 'NoneType' and 'int' spalisetty06 1 10,527 Apr-29-2020, 06:41 AM
Last Post: buran
  TypeError: '<' not supported between instances of 'str' and 'int' Svensation 5 8,920 Jan-20-2020, 08:12 PM
Last Post: buran
  TypeError: Not supported between instances of 'function' and 'int' palladium 9 19,791 Dec-06-2019, 12:40 AM
Last Post: palladium
  TypeError: '>=' not supported between instances of 'str' and 'int' AsadZ 8 10,676 Aug-20-2019, 11:45 AM
Last Post: ThomasL
  '>' not supported between instances of 'str' and 'int' graham23s 2 4,023 May-11-2019, 07:09 PM
Last Post: micseydel
  Newbie Question re "TypeError: '<' not supported between instances of 'list' and 'int sr12 8 13,160 Apr-11-2019, 08:19 PM
Last Post: sr12
  '<' not supported between instances of 'str' and 'int' jayaherkar 1 7,982 Apr-09-2019, 03:25 PM
Last Post: perfringo
  TypeError: '<' not supported between instances of 'int' and 'builtin_function_or_meth yann2771 1 5,607 Mar-05-2019, 09:51 PM
Last Post: stranac
  '<=' not supported between instances of 'str' and 'int' Loom 1 7,822 Aug-11-2018, 07:34 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020