Professional Documents
Culture Documents
#include<iostream>
int main()
{
char message[100], ch;
int i, key;
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch - key;
message[i] = ch;
}
}
return 0;
}
int main()
{
char message[100], ch;
int i, key;
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch + key;
message[i] = ch;
}
}
return 0;
}
string message;
cout<<"rail fence cypher (general-case)"<<endl;
cout<<"enter the key"<<endl;
cin>>key;
cout<<"enter the message"<<endl;
cin.ignore();
cin>>message;
cout<<"what you want to do??"<<endl<<"1.Encrypt"<<endl<<"2.Decrypt"<<endl;
cout<<"enter the choice"<<endl;
cin>>choice;
if(choice==1)
{
encryptRailFence(message,key);
}
if(choice==2)
{
decryptRailFence(message,key);
}
}
string encryptRailFence(string text, int key)
{
int choice1;
char rail[key][(text.length())];
rail[row][col++] = text[i];
dir_down?row++ : row--;
}
string result;
for (int i=0; i < key; i++)
for (int j=0; j < text.length(); j++)
if (rail[i][j]!='\n')
result.push_back(rail[i][j]);
cout<<result;
cout<<endl;
cout<<"want to decrypt this message?"<<endl;
cout<<"1.yes"<<"2.no i want to do it for a new message"<<endl;
cout<<"enter the choice"<<endl;
cin>>choice1;
if(choice1==1)
{
decryptRailFence(result,key);
}
if(choice1==2)
{
main2();
}
}
string decryptRailFence(string cipher, int key)
{
char rail[key][cipher.length()];
bool dir_down;
if (row == 0)
dir_down = true;
if (row == key-1)
dir_down = false;
rail[row][col++] = '*';
dir_down?row++ : row--;
}
int index = 0;
for (int i=0; i<key; i++)
for (int j=0; j<cipher.length(); j++)
if (rail[i][j] == '*' && index<cipher.length())
rail[i][j] = cipher[index++];
int choice1;
string result;
row = 0, col = 0;
for (int i=0; i< cipher.length(); i++)
{
if (row == 0)
dir_down = true;
if (row == key-1)
dir_down = false;
if (rail[row][col] != '*')
result.push_back(rail[row][col++]);
dir_down?row++: row--;
}
cout<<result;
cout<<endl;
cout<<"want to encrypt this message?"<<endl;
cout<<"1.yes"<<"2.no i want to do it for a new message"<<endl;
cout<<"enter the choice"<<endl;
cin>>choice1;
if(choice1==1)
{
encryptRailFence(result,key);
}
if(choice1==2)
{
main2();
}
}
To select an image of your written signature, click Select Image. In the Select
Signature Image dialog box, find the location of your signature image file, select
the file that you want, and then click Select.
Remove digital signatures from Word or Excel
1.Open the document or worksheet that contains the visible signature you want to
remove.
2.Right-click the signature line.
3,Click Remove Signature.
4.Click Yes.