Hack Forums
[Python] Reversing small encryption function - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Reversing small encryption function (/showthread.php?tid=6123179)



Reversing small encryption function - Whocares12345 - Nov 24, 2020

Hello, guys I'm having a small challenge at school,
Where I need to reverse an encryption function to find the decryption function..

Im originally a javascript developer so i find it a bit hard to understand whats going on here:

Code
def GGGGotate(lol):
    bit = lol << 1
    movebit = bit & 255
    if (lol > 127):
    movebit = movebit | 1
    return (movebit)

If anyone can help me reverse this or simply understand what's going on it will be greatly appreciated.

PS: this is only a small part of the encryption function where I'm stuck it's not the full function!


RE: Reversing small encryption function - G.P.D. - Nov 24, 2020

Hey man,
this is called Bitwise Opeators, you can learn of it from https://wiki.python.org/moin/BitwiseOperators
If you need help, send me a convo I'll answer you right away


RE: Reversing small encryption function - Whocares12345 - Nov 24, 2020

(Nov 24, 2020 05:36 AM)Whait Wrote:  Hey man,
this is called Bitwise Opeators, you can learn of it from https://wiki.python.org/moin/BitwiseOperators
If you need help, send me a convo I'll answer you right away

Thank you for answering I sent you a convo!


Still Need Help guys If someone can help!


RE: Reversing small encryption function - sisidor69 - Dec 15, 2021

Code
def deGGGotate(value):
    xbit = (value & 1)  << 7
    return(value >> 1) | xbit