You are on page 1of 12

INTRODUCTION

The subject of encryption is fundamental to a complete network security strategy.


With increased use of public facilities such as the Internet comes a need to guarantee message
confidentiality and integrity for many applications. In the past, security was a matter of
physically securing the data and limiting access to the data. Where data communications was
involved from site to site, the data often traveled over point-to-point dedicated circuits, which
afforded a reasonably degree of privacy and integrity since the actual path traveled by the
data was fixed and determinable, and relatively secure from casual eavesdropping.

Encryption has primarily been used to prevent the disclosure of confidential


information, but can also be used to provide authenticity of the source of the message, verify
the integrity of received data, provide the digital equivalent of a handwritten signature, and
nonrepudiation. Nonrepudiation assures that a transacting party cannot deny that the
transaction took place.

Here we are using strings and for loop

STRINGS: The character data type allows to store a single character only but to store a
single character only but to store more no of characters like name of the person,city where he
lives were done by using an array of characters and such an array of characters is called
string, which is enclosed in ‘ ‘.

A string is like a sentence with more no of words, separated by space hence each
and every string is ended with a string terminator represented by “\0”

DECLARATION OF A STRING:

Char name[size];

LOOPS: you may encounter situations, when a block of code needs to be executed several
number of times. In general, statements are executed sequentially: The first statement in a
function is executed first, followed by the second, and so on.

Page 1 of 12
Programming languages provide various control structures that allow for more complicated
execution paths.

A loop statement allows us to execute a statement or group of statements multiple


times. Given below is the general form of a loop statement in most of the programming
languages.

C programming language provides the following types of loops to handle looping


requirements.

Loop control statements change execution from its normal sequence. When execution
leaves a scope, all automatic objects that were created in that scope are destroyed.

for loop:
Executes a sequence of statements multiple times and abbreviates the code that
manages the loop variable.

A for-loop statement is available in most imperative programming languages. Even ignoring


minor differences in syntax there are many differences in how these statements work and the
level of expressiveness they support. Generally, for-loops fall into one of the following
categories:

Page 2 of 12
AIM

 To write a square code for the given message


 One classic method for composing secret messages is called a square code. The
spaces are removed from the English text and the characters are written into a square
(or rectangle). For example, the sentence "If man was meant to stay on the ground
god would have given us roots" is 54 characters long, so it is written into a rectangle
with 7 rows and 8 columns.
ifmanwas
meanttos
tayonthe
groundgo
dwouldha
vegivenu
sroots
The coded message is obtained by reading down the columns going left to right. For
example, the message above is coded as:
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
In your program, have the user enter a message in english with no spaces between the
words.Have the maximum message length be 81 characters. Display the encoded message.
(Watch out that no "garbage" characters are printed.)Here are some more examples:
Input Output
haveaniceday hae and via ecy
feedthedog fto ehg ee dd
chillout clu hlt io

2.1Advantages: -
 Code can be transmitted easily by without any hacking.
 Security mode of transmission will be high.
 Encryption key services prevent service providers from accessing data.
 Encryption help us to meet regulation.

Page 3 of 12
2.2 Disadvantages: -
 It is a very complex technology. Management of encryption keys must be an added
administrative task for often overburdened IT staff.

 One big disadvantage of encryption as it relates to keys is that security of data


becomes the security of the encryption key. Lose that key, and you effectively lose
data.
 The one of the main disadvantage any one can expect is this code can be easily

2.3 Future Enhancements: -

The future enhancements of encryption are:

 Here we are following with only one dimension array i.e., by taking a single matrix
and taking the given message and copying into columns first.
 So, in future we may change this to diagonally and by taking the message first into the
right side of the matrix
 Another feature that may be added to the proposed selective schemes ids the
‘selection criteria’. Encryption technique can be chosen dynamically as the content is
being distributed and the selection criteria can be changed as needed by the
application.

Page 4 of 12
SYSTEM REQUIREMENTS

 SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : Turbo-C
Operating system: Windows 10

 HARDWARE REQUIREMENTS:

The hardware requirements that map towards the software are as follows:

RAM :8GB

Processor :i5

Page 5 of 12
FLOW CHART DIAGRAM

Start

Int a, b, c , i ,j

for(i=0,j=0;a[i]!='\0';i++)
{
if(a[i]==' ')
{ continue; }
else
{ b[j++]=a[i]; }
}

k=strlen(b);

for(k=0,i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
c[i][j]=b[k++];
} Page 6 of 12

printf("\n");
}
for(i=0;i<5;i++)
{ for(j=0;j<10;j++)
{ printf("%c",c[j][i]);
}
printf("\t");
}

Stop

Page 7 of 12
IMPLEMENTATION

#include<stdio.h>

#include<string.h>

int main()

int i,j,k;

static char a[100],b[100],c[5][10];

printf("\n enter your message");

gets(a);

for(i=0,j=0;a[i]!='\0';i++)

if(a[i]==' ')

continue;

else

b[j++]=a[i];

printf("\n the string is %s",b);

Page 8 of 12
k=strlen(b);

printf("\n the string lenght is %d",k);

for(k=0,i=0;i<5;i++)

for(j=0;j<5;j++)

c[i][j]=b[k++];

printf("\n");

for(i=0;i<5;i++)

for(j=0;j<10;j++)

printf("%c",c[j][i]);

printf("\t");

return 0;

Page 9 of 12
ALGORITHM

STEP 1:- Start

STEP 2:- Read a,b,c,i,j;

STEP 3:- Display ("\n enter your message");

STEP 4:- for (i=0,j=0;a[i]!='\0';i++)

STEP 4.1:- if (a[i]==' ')


STEP 4.2:- continue
STEP 4.3:- else
STEP4.4:- b [j++]=a[i]
STEP5: Display ("\n the string is %s",b);

STEP 6: k= strlen (b);

STEP 7: Display ("\n the string lenght is %d",k);

STEP 8:- for (k=0,i=0;i<5;i++)

STEP 8.1:-for (j=0;j<5;j++)


STEP 8.2:- c[i][j]=b[k++];
STEP8.3:- ("\n");
STEP 9:- for (i=0;i<5;i++)

STEP 9.1:- for (j=0;j<10;j++)


STEP 9.2 :- ("%c", c[j][i]);

STEP 9.3:- printf ("\t");


STEP 10:- stop

Page 10 of 12
INTEGRATION AND SYSTEM TESTING

OUTPUTS

ScreenShots:

Page 11 of 12
CONCLUSION

More and more users nowadays understand the idea of Internet's openness and danger
of web surfing, which explains the growing popularity of data encryption. The latter is being
frequently applied even to such common communications as instant messaging and emailing.
And that is worth it, as otherwise with a lack of security mechanism any data transferred over
the Internet may be easily stolen and viewed by anyone. It is even more dangerous in case of
critical data that can be compromised in many ways, particularly if it is being stored in
servers than can change its owner over the years. But when people understand how
detrimental may be the crimes like data or identity theft, data encryption becomes worth
pursuing.

Page 12 of 12

You might also like