Write a C++ Program using constructor, friend and const functions to decrypt the ciphertext into plain text. This scheme
Posted: Fri May 20, 2022 1:00 pm
Write a C++ Program using constructor, friend and const functions to decrypt the ciphertext into plain text. This scheme of cipher uses a text string (say, a word) as a key, which is then used for doing a number of shifts on the plaintext. For example, let's assume the key is 'point'. Each alphabet of the key is converted to its respective numeric value: In this case, p→ 16, 0 → 15, i → 9, n→ 14, and t → 20. Thus, the key is: 16 15 9 14 20. The sender and the receiver decide on a key. Say 'point' is the key. Numeric representation of this key is [16, 15, 9, 14, 20] The sender wants to decrypt the message, say 'PHBNVz'. He will arrange cipher test and numeric key to get the plain text as "Attack" (Toggle Case of each letter) p H B N V Z p-16 0-15 i-9 n-14 t-20 p-16 A t t a с K He now left shifts each ciphertext by alphabet by the number written below it to create plain text as shown below : Note: Toggle the case of Plain text while decrypting Input PHBNVZ point Output [16, 15, 9, 14, 20, 16] Attack