Skip to content

Instantly share code, notes, and snippets.

@lingmujianshi
Created October 28, 2018 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lingmujianshi/c8a5d8d83a3c436a85252ea2c5c2a2e0 to your computer and use it in GitHub Desktop.
Save lingmujianshi/c8a5d8d83a3c436a85252ea2c5c2a2e0 to your computer and use it in GitHub Desktop.
encrypt for HS105
def encrypt(string):
key = 171
result = pack('>I', len(string))
for i in string:
a = key ^ ord(i)
key = a
result += a.to_bytes(1,'big') #python2 : result += chr(a)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment