MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / main

Function main

ciphers/transposition_cipher.py:4–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import math
3
4def main():
5 message = input('Enter message: ')
6 key = int(input('Enter key [2-%s]: ' % (len(message) - 1)))
7 mode = input('Encryption/Decryption [e/d]: ')
8
9 if mode.lower().startswith('e'):
10 text = encryptMessage(key, message)
11 elif mode.lower().startswith('d'):
12 text = decryptMessage(key, message)
13
14 # Append pipe symbol (vertical bar) to identify spaces at the end.
15 print('Output:\n%s' %(text + '|'))
16
17def encryptMessage(key, message):
18 """

Callers 1

Calls 2

encryptMessageFunction · 0.70
decryptMessageFunction · 0.70

Tested by

no test coverage detected