def crypt(source,key):
from itertools import cycle
result=''
temp=cycle(key)
for ch in source:
result=result+chr(ord(ch)^ord(next(temp)))
return result source='Jiangxi Insstitute of Busiess and Technology'
key='zWrite' print('Before Encrypted:'+source)
encrypted=crypt(source,key)
print('After Encrypted:'+encrypted)
decrypted=crypt(encrypted,key)
print('After Decrypted:'+decrypted)
# Before Encrypted:Jiangxi Insstitute of Busiess and Technology
# After Encrypted:0>w;>Z8I6 >E9I ?
# .
# After Decrypted:Jiangxi Insstitute of Busiess and Technology