#include <iostream>
#include <bits/stdc++.h>
|
#define | ull unsigned long long |
|
#define | pb push_back |
|
#define ull unsigned long long |
string fillBlanks |
( |
string |
s, |
|
|
ull |
l |
|
) |
| |
11 while(s.size() != l) {
18 cout <<
"IMPLEMENTATION OF TRANSPOSITION CIPHER USING COLUMNAR TRANPOSITION" <<endl;
20 vector<string> message;
21 vector<string> enc_message;
22 ull i,j,len,key_len, order_size;
25 string temp_key =
key;
27 while(getline(cin, str)){
28 if(str.empty()){
break;}
31 double time_taken = clock();
34 enc_message = message;
35 message[len - 1] =
fillBlanks(message[len - 1], key_len);
37 cout << message[i] <<endl;
40 vector<ull> ordered, unordered;
41 sort(temp_key.begin(), temp_key.end());
42 for(i=0;i<key_len;i++) {
45 order_size = ordered.size();
46 for(i=0;i<order_size;i++) {
47 for(j = 0;j<order_size;j++) {
48 if(temp_key[j] == key[i]) {
56 for(i=0;i<key_len;i++) {
58 enc_message[j][unordered[i] - 1] = message[j][ordered[i]-1];
61 for(i=0;i<key_len;i++) {
63 cout<< enc_message[j][i];
68 time_taken = (clock() - time_taken)/CLOCKS_PER_SEC;
69 cout << time_taken <<endl;
71 }
string fillBlanks(string s, ull l)
Definition: TransCipher.cpp:9
#define ull
Definition: TransCipher.cpp:7
key
Definition: DESKeygen.py:182