encryption - Bitshift Encrypt and Decrypt with Circular shift in Python -
Edit: I understood it. Here's the code I used.
def bitshiftEncrypt (word): newWord = "" for the word: shift = '{: 07b}'. Format (ord (i) +1) NewShift = shift [0] newShift + = shift [0] newWord + = chr (int (newshift, 2)) print (newworld) def bitsoft decrypt (word): newWord = "i" In the word: shift = ': 07b}' Format (ord (i)) newShift = shift [len (str (shift) - 1] newShift + = shift [: - 1: 1] New word + = str (chr (int (newshift, 2) -
P> bin () Possible representation will give you screw in different ways. 3> gt;> Bin (3) '0b11' 3> '{: 07b}' Format (3) '0000011'
Comments
Post a Comment