Professional Documents
Culture Documents
BitLocker Drive Encryption is mainly a tool you can use to prevent data
breaches and data ex-filtration from your hard disk. Thats because
BitLocker encrypts the entire drive, which makes it impossible for
anyone stealing your laptop to remove the hard drive and read the files.
Its a also a good safeguard if you should lose your PC.
3) Vera Crypt
VeraCrypt is free and its available for Windows, OS X and Linux
operating systems.
VeraCrypt adds enhanced security to the algorithms used for system
and partitions encryption making it immune to new developments in
brute-force attacks.
VeraCrypt also solves many vulnerabilities and security issues found in
TrueCrypt.
4) 7Zip
7Zip is a powerful and lightweight solution whose main asset is
simplicity. As many users noticed, 7Zip is capable of extracting most
archives and it features strong AES-256 encryption.
The program is easy to get used to when encrypting your own files and
it uses one of the best compression formats.
5) AxCrypt
Like 7Zip, AxCrypt is a lightweight free encryption tool that integrates
with Windows. You can use it mainly for protecting valuable files from
the system.
The files can be encrypted for a specific period of time and can auto-
decrypt later on, when that file reaches the destination. Its a fast tool
that enables you to select an entire folder or a group of files and
encrypt them fast. Its main purpose is to protect specific files and not
entire hard drives, although it does offer protection against major
cracking methods used by cyber criminals. Plus, you can use it to
encrypt your sensitive data before backing it up in the cloud or on
external hard drives.
6) CrypTool
CrypTool 1 (CT1) is an open-source Windows program for cryptography
and cryptanalysis. Its the most wide-spread e-learning software of its
kind.
getch();
return 0;
}
OUTPUT :---
Question 4: WAP for encryption and decryption of text using
Vernam Cipher
The Vernam Cipher is based on the principle that each plaintext character
from a message is 'mixed' with one character from a key stream. If a
truely random key stream is used, the result will be a truely
'random' ciphertext which bears no relation to the original plaintext. In
that case the cipher is similar to the unbreakable One-Time Pad (OTP).
The ciphertext is generated by applying the logical XOR operation to the
individual bits of plaintext and the key stream. The advantage of using the
XOR operation for this, is that it can be undone by carrying out the same
operation again.
#include<stdio.h>
char arr[26][26];
char message[22],key[22],emessage[22],retMessage[22];
intfindRow(char);
intfindColumn(char);
intfindDecRow(char,int);
int main()
{
inti=0,j,k,r,c;
clrscr();
k=96;
for(i=0;i<26;i++)
{
k++;
for(j=0;j<26;j++)
{
arr[i][j]=k++;
if(k==123)
k=97;
}
} printf("\nEnter message\n");
gets(message);
printf("\nEnter the key\n");
gets(key);
// Encryption
for(i=0;key[i]!=NULL;i++)
{
c=findRow(key[i]);
r=findColumn(message[i]);
emessage[i]=arr[r][c];
}
emessage[i]='\0';
printf("\n Encrypted message is:\n\n");
for(i=0;emessage[i]!=NULL;i++)
printf("%c",emessage[i]);
//decryption
for(i=0;key[i]!=NULL;i++)
{
c=findColumn(key[i]);
r=findDecRow(emessage[i],c);
retMessage[i]=arr[r][0];
}
retMessage[i]='\0';
printf("\n\nMessage Retrieved is:\n\n");
for(i=0;retMessage[i]!=NULL;i++)
printf("%c",retMessage[i]);
getch();
return(0);
}
intfindRow(char c) {
inti;
for(i=0;i<26;i++) {
if(arr[0][i]==c)
return(i);
}}
intfindColumn(char c) {
inti;
for(i=0;i<26;i++)
{
if(arr[i][0]==c)
return(i);
}
}
intfindDecRow(char c,int j)
{
inti;
for(i=0;i<26;i++)
{
if(arr[i][j]==c)
return(i);
}
}
OUTPUT :----
Question 5: WAP for encryption and decryption of text using Hill
Cipher
Each letter is represented by a number modulo 26. Often the simple
scheme A = 0, B = 1, ..., Z = 25 is used, but this is not an essential
feature of the cipher. To encrypt a message, each block of n letters
(considered as an n-component vector) is multiplied by an
invertible n n matrix, against modulus 26. To decrypt the message, each
block is multiplied by the inverse of the matrix used for encryption. The
matrix used for encryption is the cipher key, and it should be chosen
randomly from the set of invertible n n matrices (modulo 26).
#include<stdio.h>
int check(int x)
{
if(x%3==0)
return 0;
int a=x/3;
int b=3*(a+1);
int c=b-x;
return c;
}
void main()
{
intl,i,j;
int temp1;
int k[3][3];
int p[3][1];
int c[3][1];
charch;
printf("\nThis cipher has a key of length 9. ie. a 3*3 matrix.\nEnter the 9
character key. ");
for(i=0;i<3;++i)
{
for(j=0;j<3;++j)
{
scanf("%c",&ch);
if(65<=ch&&ch<=91)
k[i][j]=(int)ch%65;
else
k[i][j]=(int)ch%97;
}}
for(i=0;i<3;++i)
{
for(j=0;j<3;++j)
{
printf("%d ",k[i][j]);
}
printf("\n");
}
printf("\nEnter the length of string to be encoded(without spaces). ");
scanf("%d",&l);
temp1=check(l);
if(temp1>0)
printf("You have to enter %d bogus characters.",temp1);
char pi[l+temp1];
printf("\nEnter the string. ");
for(i=-1;i<l+temp1;++i)
{
scanf("%c",&pi[i]);
}
int temp2=l;
int n=(l+temp1)/3;
int temp3;
int flag=0;
int count;
printf("\n\nThe encoded cipher is : ");
while(n>0)
{
count=0;
for(i=flag;i<flag+3;++i)
{
if(65<=pi[i] && pi[i]<=91)
temp3=(int)pi[i]%65;
else
temp3=(int)pi[i]%97;
p[count][0]=temp3;
count=count+1;
}
int k1;
for(i=0;i<3;++i)
c[i][0]=0;
for(i=0;i<3;++i)
{
for(j=0;j<1;++j)
{
for(k1=0;k1<3;++k1)
c[i][j]+=k[i][k1]*p[k1][j];}}
for(i=0;i<3;++i)
{
c[i][0]=c[i][0]%26;
printf("%c ",(char)(c[i][0]+65));
}
n=n-1;
flag=flag+3;
}
}
OUTPUT :---
Question 6: WAP for encryption and decryption of text using
Vigenere Cipher
The Vigenre cipher, was invented by a Frenchman, Blaise de Vigenre in
the 16th century. It is a polyalphabetic cipher because it uses two or more
cipher alphabets to encrypt the data. In other words, the letters in the
Vigenre cipher are shifted by different amounts, normally done using a
word or phrase as the encryption key .Unlike the monoalphabetic ciphers,
polyalphabetic ciphers are not susceptible to frequency analysis, as more
than one letter in the plaintext can be represented by a single letter in the
encryption.
#include<iostream>
#include<string>
usingnamespace std;
classVigenere{
public:
string key;
Vigenere(string key){
for(inti=0;i<key.size();++i){
if(key[i]>='A'&& key[i]<='Z')
this->key += key[i];
elseif(key[i]>='a'&& key[i]<='z')
this->key += key[i]+'A'-'a';
}}
string encrypt(string text){
string out;
for(inti=0, j =0;i<text.length();++i){
char c = text[i];
if(c >='a'&& c <='z')
c +='A'-'a';
elseif(c <'A'|| c >'Z')
continue;
out+=(c + key[j]-2*'A')%26+'A';
j =(j +1)%key.length();
}
return out;
}
string decrypt(string text){
string out;
for(inti=0, j =0;i<text.length();++i)
{char c = text[i];
if(c >='a'&& c <='z')
c +='A'-'a';
elseif(c <'A'|| c >'Z')
continue;
out+=(c - key[j]+26)%26+'A';
j =(j +1)%key.length();
}
return out;
}
};
int main()
{
Vigenerecipher("VIGENERECIPHER");
string original ="Beware the Jabberwock, my son! The jaws that bite, the
claws that catch!";
string encrypted =cipher.encrypt(original);
string decrypted =cipher.decrypt(encrypted);
cout<< original <<endl;
cout<<"Encrypted: "<< encrypted <<endl;
cout<<"Decrypted: "<< decrypted <<endl;
}
Question 7: WAP to demonstrate DES Algorithm