>>> encrypt('marvin', 'jessica') 'QRACRWU'
(key: str, words: str)
| 39 | |
| 40 | |
| 41 | def encrypt(key: str, words: str) -> str: |
| 42 | """ |
| 43 | >>> encrypt('marvin', 'jessica') |
| 44 | 'QRACRWU' |
| 45 | """ |
| 46 | cipher = "" |
| 47 | count = 0 |
| 48 | table = generate_table(key) |
| 49 | for char in words.upper(): |
| 50 | cipher += get_opponent(table[count], char) |
| 51 | count = (count + 1) % len(table) |
| 52 | return cipher |
| 53 | |
| 54 | |
| 55 | def decrypt(key: str, words: str) -> str: |
no test coverage detected