def encrypt(plain, cipher, text):
plain += plain.upper()
cipher += cipher.upper()
newText = ''
for c in text:
index = plain.find(c)
if(index >= 0 and index < len(cipher)):
newText += cipher[index]
else:
newText += c
return newText;
plainAlphabet = "abcdefghijklmnopqrstuvwxyz"
cipherAlphabet = "zyxwvutsrqponmlkjihgfedcba"
text = "Some sensitive text that only humans must be able to read"
encodedText = encrypt(plainAlphabet, cipherAlphabet, text);
print encodedText
ZGVmIGVuY3J5cHQocGxhaW4sIGNpcGhlciwgdGV4dCk6CglwbGFpbiArPSBwbGFpbi51cHBlcigpCgljaXBoZXIgKz0gY2lwaGVyLnVwcGVyKCkKIAoJbmV3VGV4dCA9ICcnCglmb3IgYyBpbiB0ZXh0OgoJCWluZGV4ID0gcGxhaW4uZmluZChjKQoJCWlmKGluZGV4ID49IDAgYW5kIGluZGV4IDwgbGVuKGNpcGhlcikpOgoJCQluZXdUZXh0ICs9IGNpcGhlcltpbmRleF0KCQllbHNlOgoJCQluZXdUZXh0ICs9IGMKCQkKCXJldHVybiBuZXdUZXh0OwoKcGxhaW5BbHBoYWJldCA9ICJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eiIKY2lwaGVyQWxwaGFiZXQgPSAienl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmEiCnRleHQgPSAiU29tZSBzZW5zaXRpdmUgdGV4dCB0aGF0IG9ubHkgaHVtYW5zIG11c3QgYmUgYWJsZSB0byByZWFkIgogCmVuY29kZWRUZXh0ID0gZW5jcnlwdChwbGFpbkFscGhhYmV0LCBjaXBoZXJBbHBoYWJldCwgdGV4dCk7CnByaW50IGVuY29kZWRUZXh0