Last active
January 5, 2021 15:28
-
-
Save fuwiak/c4612ef1e6476055bd1a24a0e95d2577 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def encryptDecrypt(inpString): | |
xorKey = 'P'; | |
# calculate length of input string | |
length = len(inpString); | |
# perform XOR operation of key | |
# with every caracter in string | |
for i in range(length): | |
inpString = (inpString[:i] + | |
chr(ord(inpString[i]) ^ ord(xorKey)) + | |
inpString[i + 1:]); | |
print(inpString[i], end = ""); | |
return inpString; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment