Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10:25 2. Transposition Cipher (encrypt.c) A very simple transposition cipher encrypt(S) can be described by the following rule: o If the length of S is

image text in transcribed
10:25 2. Transposition Cipher (encrypt.c) A very simple transposition cipher encrypt(S) can be described by the following rule: o If the length of S is 1 or 2, then encrypt(S) is S. o If S is a string of N characters s1 S2...SN and k-IN/2], then enc(S) encrypt(skSk-1. .s251)+ encrypt(snsN-1 .SK) where indicates string cancatenation. For example, encrypt("OK")-"OK" and encrypt("12345678-34127856 Write a program to implement this cipher, given an arbitary text string from keyboard, up to 8192 characters. It's better to write a separate encryption function, similar to the following char encrypt(char string size t length) I you fi11 this out ) Input Format: an abitary string (with the length up to 8192 characters) Sample Input: Test early and often! Output Format Line 1: One integer: the toal number of characters in the string. Line 2: The enciphered string. Sample Output: 21 aeyrleT sttflenn aod

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Q: How do you recruit employees?

Answered: 1 week ago