You are on page 1of 6

caeser cypher decrypt

#include<iostream>

using namespace std;

int main()
{
char message[100], ch;
int i, key;

cout << "Enter a message to decrypt: ";


cin.getline(message, 100);
cout << "Enter key: ";
cin >> key;

for(i = 0; message[i] != '\0'; ++i){


ch = message[i];

if(ch >= 'a' && ch <= 'z'){


ch = ch - key;

if(ch < 'a'){


ch = ch + 'z' - 'a' + 1;
}

message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch - key;

if(ch > 'a'){


ch = ch + 'Z' - 'A' + 1;
}

message[i] = ch;
}
}

cout << "Decrypted message: " << message;

return 0;
}

caeser cypher encrypt


#include<iostream>

using namespace std;

int main()
{
char message[100], ch;
int i, key;

cout << "Enter a message to encrypt: ";


cin.getline(message, 100);
cout << "Enter key: ";
cin >> key;

for(i = 0; message[i] != '\0'; ++i){


ch = message[i];

if(ch >= 'a' && ch <= 'z'){


ch = ch + key;

if(ch > 'z'){


ch = ch - 'z' + 'a' - 1;
}

message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch + key;

if(ch > 'Z'){


ch = ch - 'Z' + 'A' - 1;
}

message[i] = ch;
}
}

cout << "Encrypted message: " << message;

return 0;
}

rail fence full


using namespace std;
#include<iostream>
#include<conio.h>
#include<stdio.h>
#include<string.h>
string encryptRailFence(string message,int);
string decryptRailFence(string message, int);
void main2();
int main()
{
main2();
}
void main2()
{
int key,choice;

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())];

for (int i=0; i < key; i++)


for (int j = 0; j < text.length(); j++)
rail[i][j] = '\n';

bool dir_down = false;


int row = 0, col = 0;

for (int i=0; i < text.length(); i++)


{
if (row == 0 || row == key-1)
dir_down = !dir_down;

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()];

for (int i=0; i < key; i++)


for (int j=0; j < cipher.length(); j++)
rail[i][j] = '\n';

bool dir_down;

int 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;

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();
}
}

john the ripper


use to unhash the hashed
1.openwall.com/john
2.john the ripper 1.7.9
3.save to desktop
4.right click-->extract all
5.clear john1792.. extract to desktop
6.delete the zip folder
7.rename extracted folder as john
8.go to local disk c
9.paste john in c
10. open it
11.open run
12.minimize
13.in start menu search cmd
14.right click-->open file location
15.copy command prompt
16. paste it in run opened in step 11.
17.in run folder create a new text document and name it hash
18. open sherylcanter in chrome.
19.type username
20.type password
21.click create
22.Des encryted username id pswd generated.
23.copy stepp 22 and paste it in hash file in step-17
24.save it
25.open command prompt paste it in run
26.type cd c:/ press enter
27.type cd john press enter
28.type cd run press enter
29.cls press enter
30.finally screen will show--> c:\john\run>
31.type john press enter
32.type c\john\run>john hash.txt
33.press enter

password protected word document


1.create the document
2.click microsoft button
3.point to prepare
4.click encrypt the document
5.In the Encrypt Document dialog box, in
Password box, type a password, and then click OK.
(AES 128-bit advanced encryption. , 255 max)
6.In the Confirm Password dialog box,
in the Reenter password box, type the password
and then click OK.
7.To save the password, save the file
Remove password protection from a Word document
1.Use the password to open the document.
2.Click the Microsoft Office Button
3.point to Prepare, and then click Encrypt Document.
4.In the Encrypt Document dialog box, in the Password box,
delete the encrypted password, and then click OK.
5.Save the file.
Set a password to modify a Word document

In addition to setting a password to open a


Word document, you can set a password to allow others
to modify the document.
1.Click the Microsoft Office Button
2.click Save As, and on the bottom of the Save As dialog, click Tools.
3.On the Tools menu, click General Options. The General Options dialog opens.
4.Under File sharing options for this document, in the Password to modify box, type
a password.
5.In the Confirm Password dialog, re-type the password. Click OK.
6.Click Save.
(works for excel too)
Create a signature line in Word or Excel
1.In the document or worksheet, place your pointer where you want to create a
signature line.
2,On the Insert tab, in the Text group, click the Signature Line list, and then
click Microsoft Office Signature Line.
3.In the Signature Setup dialog box, type information that will appear beneath the
signature line:
4.Select one or both of the following check boxes:
Sign the signature line in Word or Excel
1.In the file, right-click the signature line.
2.From the menu, select Sign.
3.To add a printed version of your signature, type your name in the box next to the
X.

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.

You might also like