Beruflich Dokumente
Kultur Dokumente
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 66
cryption key remains as public but the decryption key ters(ASCII code 0 to 255). The relative position and the
should be kept as secret key. The public key methods character itself is very important in our method to calcu-
have got both merits as well as demerits. The problem of late the randomization number and the encryption num-
Public key cryptosystem is that we have to do massive ber. Here we take an example how to calculate randomi-
computation for encrypting any plain text. Moreover in zation number, the encryption number from a given text-
some public key cryptography the size of encrypted mes- key. Now we will show how really we calculate the above
sage may increase. In RSA public crypto system we can two parameters:
not use the same key for multiple encryption and hence
we have to define multiple encryption keys and similarly We choose the following table for calculating the
multiple decryption keys which may be a tedious jobs for place value and the power of characters of the incom-
maintaining keys by the user. Due to massive computa- ing key:
tion the public key crypto system may not be suitable in
security of data in sensor networks. So the security prob- Table-1
lem in sensor node is a real problem. However, there are Length of text-key and the corresponding value of base
quite a number of encryption methods have came up in
the recent past appropriate
Length 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
for the sensor nodes. In the
of
present work we are propos-
key(n)
ing a symmetric key method
Base 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2
where we have used a ran-
value(b)
dom key generator for gene-
rating the initial key and that key is used for encrypting
the given source file. The present method is basically a Suppose key entered by the user is “AB”. The length
substitution method where we read 6 characters as 2 of the text-key is 2.
blocks each contains 3 characters from any input file and To calculate the randomization number and encryp-
then search the corresponding blocks in the random key tion number we follow the following steps:
matrix file to get the corresponding encrypted pattern n
and then we write the encrypted message in another file. Step-1: Take Sum=Σ (ASCII Code of Character) * bm
For searching characters from the random key matrix we ----(1)
have used a method which was proposed by Nath et.al(1) m=1
in MSA algorithm. In the present method we have the So if our text-key is “AB” then from equation (1)
provision for encrypting message multiple times. The key we get
matrix contains all possible words comprising of 3 charac- Sum=65*161 + 66 * 162 =17936
ters each generated from all characters whose ASCII code
from 0 to 255 in a random order. The pattern of the key Now we have to calculate 2 parameters from this sum (i)
Randomization number(n1) and (ii) Encryption num-
matrix will depend on text_key entered by the user. To
ber(n2) using the following method:
make the key matrix random we have used our own
(i) To calculate Randomization number(n1):
randomization algorithm which we generate from initial
Calculate sum of product of each digit in Sum and its
text_key. Nath et.al(1) proposed a simple algorithm to
place value in that sum as follows:
obtain the randomization number and encryption num-
num1=1*1+7*2+9*3+3*4+6*5=84
ber from the text_key. To decrypt any file one has to
Now n1=Mod(sum, num1)=Mod(17936 , 84)=44
know exactly what is the key matrix and to find the ran-
Note: if n1=0 then we set n1=num1 and if n1>64
dom matrix theoretically one has to apply 16777216! trial then n1=n1-64
run and which is intractable. We apply our method on
possible files such as executable file, Microsoft word file, (ii) To calculate Encryption number(n2):
excel file, access database, foxpro file, text file, image file, Calculate the product of each digit in the Sum by its
pdf file, video file, audio file, oracle database and we position in the sum in reverse order as follows:
found in all cases it gave 100% correct solution while en- num2=6*1+3*2+9*3+7*4+1*5=72
crypting a file and decrypting a file. The present method Now calculate n2=Mod(sum, num2)
can be used for encrypting digital signature, watermark =Mod(17936,72) =8
before embedding in some cover file to make the entire
system full secured. Note: if n2=0 then we set n2=num2 and if n2>64 then
we set n2=n2-64
2 GENERATION OF 65536X256X3 RANDOM K EY
To create Random key of size(65536x256x3) we have to Now we explain how we have made the random key of
select any text-key which is a secret key. The size of text- size 65536x256x3 which is used for encryption as well as
key must be less than or equal to 16 characters long. for decryption purpose. We create a random key file in a
These 16 characters can be any of the 256 charac- step by step manner as follows. As it is difficult to store
50331648 (=256x256x3x256) elements in array hence we
JOURNAL OF COMPUTING, VOLUME 3, ISSUE 2, FEBRUARY 2011, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 68
Table-3
Randomization steps Table-9:Called leftshift()
ABA CCA AAA CAA
Step-1: Function cycling() ADA ACA DCA BAA
Step-2: Function upshift() DAA CDA DDA DBA
Step-3: Function rightshift() BDA CBA BCA BBA
Step-4: Function downshift()
Step-5: Function leftshift() The above randomization process we apply for n1
Step-6: Repeat Function down- times and in each time we change the sequence of
shift() operations to make the system more random. Once
Step-7: Repeat Function rightshift() the randomization is complete we write one complete
Step-8: Repeat Function upshift() block in the output key file. Now we show how we
Step-9: Repeat Function cycling() apply encryption process on a particular file. For this
we choose our last randomized 4x4 matrix(table-9).
We apply the following encryption methods:
Now we describe the meaning of 5 above functions(Step-
1 to step-5) when we apply on a 4x4x3 matrix as shown Case-I : Suppose we want to encrypt DAA and CDA
JOURNAL OF COMPUTING, VOLUME 3, ISSUE 2, FEBRUARY 2011, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 69
which appears on the same row. Then the encrypted mes- means disk-1 is on
sage will be DDA and DBA. the top position and disk-n is in the bottom posi-
Case –II : Suppose we want to encrypt CCA and ACA tion. The arrangement
where CCA and ACA appears on the same column in the of disks should not be altered at any moment. Fi-
key matrix. The encrypted message will be CDA and nally print how many
CBA. movements have been taken to transfer all disks.
Case-III: Suppose we want to encrypt ACA and DDA Use recursive call.
which appears in two different rows and different col- 4. Input 'n' different numbers and its index. Sort
umns then the encrypted message will be ADA and them in ascending order
DBA. using any sorting method such as (i) Bubble Sort or
The decryption process will be just the opposite path of (ii) Insertion Sort or (iii) Merge Sort method and
encryption process. Our method supports both multiple print the sorted list.
encryption and multiple decryption process. 5. Input ‘n’ numbers and also the number to be
searched.
3 RESULTS AND DISCUSSION: Use linear search method to search the number in
Here we are giving result which we obtain after we ap- the list.
ply encryption method on a text file and also the decryp- If it is found then print where it is found and if the
tion method on the decrypted file to get back original file. number not found
then also print that the number not found.
(i) Text-key used=12 6. Solve linear simultaneous equations using matrix
(ii)Randomization number created by our method : 5 inversion method :
(iii)Encryption number generated by our method : 9
5x1 + x2 + x3 + x4 = 14
The above values were used for encryption and decryp- x1 + 5x2 + x3 + x4 = 18
tion on a given text file(mydoc1.txt): x1 + x2 + 5x3 + x4 = 22
St. Xavier’s College(Autonomous) x1 + x2 + x4 + 5x4 = 26
Department of Computer Science
Assignment sheet on MATLAB for the Workshop on 7. Write a program to copy the content of one file to
MATLAB to be held on 02/10/10 another file.
This assignment sheet is prepared by Dr. Asoke 8. Write a program to split the content of one file to 2
Nath, Dept. of Comp.Sc., SXC or more files.
9. Write a program to search a pattern in any file and
[Note: Participants are requested to familiarize with replace it by a
MATLAB S/W and then try to solve questions from new pattern. Print how many times the pattern has
this assignment sheet. It will not be possible to solve been modified.
all questions in the workshop. However the partici- 10. Write a program to convert all small letters to cap-
pants are requested to do it at home. For any help ital letters in any
you can send a mail to me asokejoy@gmail.com. ] file.
Group-A: Group-B:
1. (i) Input n(1-20). Calculate s=1+2+3+4+...+n. Print 11. Input any image file and extract all pixels from
n,s the image and store
(ii)Input n(1-20). Calculate in an array. Display the image on the screen using
s=(1)+(1+2)+(1+2+3)+(1+2+3+4+n). Print n,s that array.
(iii)Input n(1-20). Calculate s=1-2+3-4+5-6+….n. 12. Input a color image and change it B/W and dis-
Print n,s. play on the screen.
(iv)Input n(1-999999999). Print the sum of digits in 13. Input an image and rotate it by 1800.
the given number and 14. Input 2 images and try to mix the two images.
print it. 15. Input an image and extract some arbitrary portion
2. Input n(2-3000). Print all fibonacci numbers <=n. of the image and
Where f(n)=f(n-1)+f(n-2) for n>2 and fib(n)=1 for display it.
n<=2. 16. Input any sound file(.wav) and play it.
Use (a) non-recursive method , (b) Use recursive 17. Input a sound file play only a few portion of it.
method. 18. Input two sound files and mix those two files.
3. Implement Towers of Hanoi problem by shifting 19. Input any B/W image and try to try to add colors
all disks from Peg-1 to into it.
Peg-2 using Peg-3 one at a time where all the disks 20. Input a sound file and play it in reverse order.
have different
diameters and are arranged in sequential order. It
JOURNAL OF COMPUTING, VOLUME 3, ISSUE 2, FEBRUARY 2011, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 70
Grants Commission for giving financial assistance [2] A new Symmetric key Cryptography Algorithm using extended MSA
through Minor Research Project. JN expresses her grati- method :DJSA symmetric key algorithm , Dripto Chatterjee, Joyshree
tude to A.K.School of IT for allowing to work in research Nath, Suvodeep Dasgupta and Asoke Nath, communicated for publi-
project at St. Xavier’s College. SM is grateful to cation at IEEE conference to held at Singapore from 14/06/2011 to
A.K.School of IT for allowing to work in research project 17/06/2011.
at St. Xavier’s College. DJ,SD and AN are also thankful to [3] Data Hiding and Retrieval, A.Nath, S.Das, A.Chakrabarti, Proceedings
all 3rd year Computer Science Hons. Students (2010-2011 of IEEE International conference on Computer Intelligence and Com-
batch) for their encouragement to finish this work. puter Network held at Bhopal from 26-28 Nov, 2010.
[4] Cryptography and Network , William Stallings , Prectice Hall of India
REFERENCES [5] Modified Version of Playfair Cipher using Linear Feedback Shift Regis-
ter, P. Murali and Gandhidoss Senthilkumar, UCSNS International
[1] Symmetric key cryptography using random key generator, A.Nath,
journal of Computer Science and Network Security, Vol-8 No.12, Dec
S.Ghosh, M.A.Mallik, Proceedings of International conference on SAM-
2008.
2010 held at Las Vegas(USA) 12-15 July,2010, Vol-2,P-239-244