Posts

Showing posts from September, 2018

Function encryption

Write a function encrypts plan test according to the code is given Problem Write a function encrypt (plaintext, code_table) that encrypts a given plaintext message using the given code table. For each letter in the plai ntext, we find the corresponding set of symbols. If this is the first appearance of the letter in the message, then we assign the first symbol in the set, otherwise, we assign the next symbol after the most recently used symbol for this letter. When there is more than one symbol available for a letter, then the first appearance of the letter should be encoded using the first symbol, the second appearance by the second symbol, and so on. Once all the symbols for that letter have been used, you should begin again from the first symbol. • plaintext string of lowercase alphabetic letters. • code_table list of list of integers, in which each list contains the symbols corresponding to letter at that position in the alphabet. Returns a list of integers cor...