Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rsa Cipher
#4
The method text_to_numeric_binary_blocks,this padding might not be correctly handled during decryption.
The ljust method pads with zeros,which can alter the actual value of the data when converted back.
Try this.
def text_to_numeric_binary_blocks(self, text, block_size=10):
    text = text.encode()
    binary_blocks = [
        ''.join(format(byte, '08b') for byte in text[i:i + block_size])
        for i in range(0, len(text), block_size)
    ]
    return binary_blocks
Reply


Messages In This Thread
Rsa Cipher - by Paragoon2 - Nov-26-2023, 12:16 PM
RE: Rsa Cipher - by snippsat - Nov-26-2023, 03:48 PM
RE: Rsa Cipher - by Paragoon2 - Nov-26-2023, 04:33 PM
RE: Rsa Cipher - by snippsat - Nov-27-2023, 12:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Cesar Cipher ForsakenDusk 5 642 Apr-07-2024, 04:30 PM
Last Post: Pedroski55
  RSA Cipher with blocks Paragoon2 0 575 Nov-26-2023, 04:35 PM
Last Post: Paragoon2
  Caesar Cipher Help pbrowne 2 2,261 Jun-30-2021, 02:36 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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