You are on page 1of 5

IPASJ International Journal of Electronics & Communication (IIJEC)

Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm


Email: editoriijec@ipasj.org
ISSN 2321-5984

A Publisher for Research Motivation........

Volume 4, Issue 3, March 2016

DATA HIDING AND RETRIEVAL USING


DIGITAL SIGNAL
Satish Kumar Garg1, Arun Gaur2, S. P. Gupta3
1

Govt. P G College, Ambala Cantt-133001 (Haryana)


2

Hindu P G College, Sonipat-131001 (Haryana)

University College Kurukshetra University Kurukshetra-136119 (Haryana)

ABSTRACT
In the present work the authors have introduced a modified cryptographic method, called algorithm SKG 3.12, for data encryption and
decryption of any text file, which is implemented in five phases (1) First, by converting each character into corresponding binary code using 8-bit
ASCII Code thus we get 8N bits for a text of N characters (2) Secondly, creating a binary string of 0s and 1s such that total number of 0s and
1s is 8N, the consecutive numbers of 0s and 1s in this string may be from 1 to 7 (3) Thirdly, by swapping the integral multiple of leftmost N1st
bit with corresponding N1st rightmost bit till 4Nth bit if remainder of (8N+1/N1) is zero otherwise upto 8Nth bit. (4) Fourthly, using XOR Gate on
binary strings obtained at phases two and three and (5) Finally, converting binary string obtained at phase four into corresponding characters
using 8-bit ASCII Code. This algorithm can be applied to any text consisting of 10 or more characters. The results obtained after application
of this algorithm are difficult to decode.

Keywords: Encryption, Decryption, XOR Gate, swapping of bits

1. INTRODUCTION
In ancient time, the secret information was sent through confidential persons to maintain the secrecy of the
information, but with the advent of technology, the confidential information is sent in coded form and then the
authentic receiver decodes the coded information to get the original information. Now-a-days we are living in an era of
science and technology most of us use net surfing to get any information available around the globe. In present days
most of the data is transferred from one place to another place through internet[1]-[2] due its very high speed of data
transfer and low cost of using internet but the security and originality of data which is being transmitted via internet
has become very challenging because there is always a possibility that any hacker may hack our data. So it is not safe to send vital data
from one place to another place. The vital data may be our PIN number or pass word. Hence the data should be protected from
the hackers otherwise any massive disaster may happen all-on-a-sudden, called e-disaster. In order to make secure the system
one should consider the security primary attributes such as confidentiality, integrity, availability etc. and secondary
attributes such as authenticity, non-repudiation, accountability etc. There are a large number of methods and techniques
available to achieve these security goals, one of these is Cryptography which is science of converting meaningful data
in a form which seems to be meaningless to an hacker. It is a study of mathematical techniques related to aspects of
data security such as confidentiality, data integrity, entity authentication, and data origin authentication [3]-[4]. The
cryptographic algorithm can be classified into two categories: (i) Symmetric Key Cryptography where one key is used
for both encryption and decryption purpose and (ii) Public Key Cryptography where two different keys are used one for
encryption and the other for decryption purpose. Due to massive computation the public key cryptographic method may
not be suitable in security of data in sensor networks[5]. The authors have developed an algorithm named as algorithm
SKG 3.00 which is successful for encrypting any string consisting of 10 or more characters[6] in which bit level
manipulation of the message using XOR Gate and a trigger pulse of width of 1 to 7 units is used. In the present work,
algorithm SKG 3.12, the authors have added a second level of security, that is, interchange of the position of bits.

2. THEORY
In the present study, the authors have used XOR Gate which is reversible gate. The output of XOR Gate is equal to
input if control input is 0 and is reverse of input if control input is 1[6]. One of the inputs of the XOR Gate is used for
digital signal and another input for the string of characters/text in the binary form. The algorithm SKG 3.12 is basically
combination of algorithms SKG 1.0 and SKG 3.00[7], [6]. The algorithm SKG 3.12 is implemented in five phases:
(1) First, by converting each character into corresponding binary code using 8-bit ASCII Code thus we get 8N bits for a text of N
characters
(2) Secondly, creating a digital signal which is a binary string of 0s and 1s such that total number 0s and 1s is 8N, the
consecutive numbers of 0s and 1s in this string may be from 1 to 7.

Volume 4, Issue 3, March 2016

Page 1

IPASJ International Journal of Electronics & Communication (IIJEC)


A Publisher for Research Motivation........

Volume 4, Issue 3, March 2016

Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm


Email: editoriijec@ipasj.org
ISSN 2321-5984

(3) Thirdly, by swapping the integral multiple of leftmost N1st bit with corresponding N1st rightmost bit till 4Nth bit if remainder of
(8N+1/N1) is zero otherwise upto 8Nth bit.
(4) Fourthly, using XOR Gate on binary strings obtained at phases two and three and
(5) Finally, converting binary string obtained at phase four into corresponding characters using 8-bit ASCII Code
When any text of 10 characters is converted into binary form using 8-bit ASCII Code, we get 80 bits which
contains about 50% of 0s and 1s each. Therefore, total number of possible combinations is about 80!/(40!)2=
10751020. The Super Computer available is Teraflop which is capable of doing 1012 floating point calculations per
second, so a teraflop super computer shall take about 3409 Years to find all possible combinations[6].

3. PSEUDO CODE FOR ENCRYPTION ALGORITHM


// Read the text input and check length of Input, if less than 10, give error message
Step 1: Start
Step 2: Read input text N
Step 3: If (N.length()< 10)
Print error message that program is not applicable;
//Convert the text of N characters to binary form using 8-bit ASCII Code
Step 4: initialize character array str[]// copying each character of text N to character array str[]
Step 5: for(i=0; i<N.length(); i++)
{
If(i==N.length() 1)
Str[i] = N.substring(i);
else
Str[i] = N.substring(I, i+1);
}
Step 6: initialize byte array bytes[] // copy each text character of character array converted to byte char
Step 7: for(i=0; i<str.length; i++)
{
bytes[i]= (byte) Str[i];
}
Step 8: for each byte in array, convert each byte to binary bits and create string of those binary bits
// Generate a string of consecutive 0s and 1s such that total no. of 0s and 1s is 8N and no. of consecutive 0s
and 1s is 1 to 7
Step 9: Read value of ck // number of characters to occur consecutively
Step 10: string st = ; // empty string
Step 11: bitsetb1[l]; bitsetb2[l];
Step 12: for(integer i=0; i<l; i++) // Loop on string of all bits
{
ifa1[i] = = 1
Set bit in bitset b1;
}
for(integer i=0; i<l; i++) // Loop on string of all bits
{
if((i%(2*ck))<ck)
st=st+"0";
else
{
st=st+"1";
Set bit in bitset b2;
}
}
Step 13: print bits string and string st string on which XOR operations is being performed
Step 14: b1.xor(b2); // apply Exclusive OR operation on obtained strings
Step 15: st = ; // clear string st to store the result XOR string
Step 16: for(i=0;i<l;i++)
{

Volume 4, Issue 3, March 2016

Page 2

IPASJ International Journal of Electronics & Communication (IIJEC)


A Publisher for Research Motivation........

Volume 4, Issue 3, March 2016

Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm


Email: editoriijec@ipasj.org
ISSN 2321-5984

if(b1.get(i))
st=st + "1";
else
st=st + "0";
}
Step 17: return string st to output file
// Interchange the leftmost integral multiple of N1 bits with corresponding rightmost integral multiple of N1 bits
Step 18: initialize l = length of binary string //this will be used at number of places in
program
Step 19: initialize integer j (to store length to be traversed [loop through])
Step 20: Read value of N1
Step 21: integer r = remainder of (binary+1) modulus N1
Step 22: if (r==0)
j = l/2;
else
j = l;
Step 23: for(i=1;N1*i<=j;i++)
{
ch = charAt(N1*i-1);
Replace/ set charAt((N1*i)1)th position with charAt((l+1)-(N1*i))th position;
Replace/ set charAt((l+1)-(N1*i))th position with char stored in variable ch;
}
// Convert 8N bits so obtained into the text of N characters using 8-bit ASCII Code
Step 24: String s2 = ;
Step 25: String s=binary; // to store the binary string
Step 26: char nextChar; // declare the variable to store next significant character in string
Step 27: for(inti = 0; i<s.length(); i += 8) //this is a little tricky, as we want [0, 7], [9, 16], etc
{
nextChar = Integer value of s.substring(i, i+8);
s2 = s2 + nextChar;
}
Step 33: return s2 to output file // return the final string
Decryption Algorithm is just reverse of the Encryption Algorithm

4. IMPLEMENTATION OF ALGORITHM SKG 3.12:


We have implemented the said algorithm SKG 3.12 on Java platform for different values of Ck = 1 to 7 and N1 = 1 to
8N/3.
e.g., for input text:
Located in Kurukshetra, the land of Bhagwadgita, Kurukshetra University is a premier institute of higher
learning in India. Its foundation stone was laid on January 11, 1957 by Bharatratna Dr. Rajender Prasad, the first
President of the Indian Republic
The output is given Table 1. From Table 1, it is clear that if we change even a single variable (Ck or N1) then
output of the Algorithm SKG 3.12 is entirely different.
Table 1: Comparison of Encrypted Output using Algorithms SKG 1.0, SKG 3.00 and SKG 3.12
S. No.
Comparison of Encrypted Output using Algorithms SKG 1.0, SKG 3.00 and SKG 3.12
1.

Encrypted Output using Algorithm SKG 3.00 for Ck=2


\PRGVWZ]xFAFX@[VGARG[V_R]W\Uq[RTDRWTZGRxFAFX@[ VGAR f]ZEVA@ ZGJZ@
RCAV^ZVAZ]@GZGFGV\U[ZT[VA_VRA]Z]TZ]z]WZRzG@U\F]WRGZ\]@G\]VDR@_RZW\]yR]FRAJQJq[RARG ARG]RwAaRYV]WVAcAR@RWG[VUZA@GcAV @ZWV] G\UG[Vz] WZR]a VCFQ_ ZP
Encrypted Output using Algorithm SKG 1.0 for N1=3
colbtpe n idrI shttfo,tnhdilerd tfrih ewt gdaaarK rudnhjar .UD vntsrtyrasB b e59e ,i1 trauna n dgalrsae
enotg nnitndnaofIst .uidaI oi sninrawl ehiihofoJetutiysn1 r1im7rpya hi atiareainr aRteeskeruP ,sti,dahgafB
so Pnas eet ar ehekunuKaniRdeuaciL
Encrypted Output using Algorithm SKG 3.12 for Ck=2 and N1=3

Volume 4, Issue 3, March 2016

Page 3

IPASJ International Journal of Electronics & Communication (IIJEC)


Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
Email: editoriijec@ipasj.org
ISSN 2321-5984

A Publisher for Research Motivation........

Volume 4, Issue 3, March 2016

K^xFRc?ZJX?NJZ(rrJzzZS?ZbrzCZ?JNxJC?Z|N:JJJ-RrXDH@P
VCF*B?XZ^ZKZc?:Z-ZNzB8 ZXNX?N?X? *Z? Nz?zZ?83zFrS
ZZ?JJ2NZZRbSk?ZBXrkSF4#:HJrS zC: -?*?(BZcpXjj?r^8zcXK|
2

Encrypted Output using Algorithm SKG 3.00 for Ck=3


P-}xQrQ?iwy}]h<rs^{xh<:noh<$unhu}Qnu<ohyQzQuypn
ruUu<8oQsxu-<s<oQ}<-<;rn-@<@)F~^nnrX <#vx<! }x]
h<n<!yxhQzQtUu<#lp
Encrypted Output using Algorithm SKG 1.0 for N1=3
colbtpe n idrI shttfo,tnhdilerd tfrih ewt gdaaarK rudnhjar .UD vntsrtyrasB b e59e ,i1 trauna n dgalrsae
enotg nnitndnaofIst .uidaI oi sninrawl ehiihofoJetutiysn1 r1im7rpya hi atiareainr aRteeskeruP ,sti,dahgafB
so Pnas eet ar ehekunuKaniRdeuaciL
Encrypted Output using Algorithm SKG 3.12 for Ck=3 and N1=3
d?L?]???<D??D|M????l@ ?l?? e? F?w
?lmX?dDLD\ ?4? Hu, ??H?
??|?? ?@?|@D4,?D?| x?|L?l@,? m?L?? ???DE
?q?<?L?dX?
Encrypted Output using Algorithm SKG 3.00 for Ck=2
\PRGVWZ]xFAFX@[VGARG[V_R]W\Uq[RTDRWTZGRxFAFX@[VGARf]ZEVA @ZGJZ@RCA
V^ZVAZ]@GZGFGV\U[ZT[VA_VRA]Z]TZ]z]WZRzG@U\F]WRGZ\]@G\]VDR@_RZW\]yR]FRAJ
QJq[RARGARG]RwAaRYV]WVAcAR@RWG[VUZA@GcAV@ZWV]G\UG[Vz]WZR]aVCFQ_ZP
Encrypted Output using Algorithm SKG 1.0 for N1=4
cocbuedR n idru ehe fa,tnheisanP ofrihaehad,dtaarKureksejtr .Un aerartyras ypr75ie ,in yitune n hdihe sle
enits ioiIndna.f tsI ouidat nn gnonrawa rlagi ofoJatuarts11 r19me b aBhi atistnviDr aRaehndur P ,saig twg
fB st drel det ortthskInuKani eptaliL
Encrypted Output using Algorithm SKG 3.12 for Ck=2 and N1=4
n\FN?x^HZ??JFJ?D?xLNB ?N JN?
LHJ?J?FFRF?BDVNFN?\JNFHZD?\LB?FN\^\?
H\L?NJ^?JFX???- ? BZRXBL@ ?HD^FzH^
?NBN^?NN?L ?NFbFZJHNZ
Encrypted Output using Algorithm SKG 3.00 for Ck=3
P-}xQrQ?iwy}]h<rs^{xh<:noh<$unhu}Qnu<ohyQzQuypn
ruUu<8oQsxu-<s<oQ}<-<;rn-@<@)F~^nn rX<#vx<!}x]
h<n<!yxhQzQtUu<#lp
Encrypted Output using Algorithm SKG 1.0 for N1=4
cocbuedR n idru ehe fa,tnheisanP ofrihaehad,dtaarKureksejtr .Un aerartyras ypr75ie ,in yitune n hdihe sle
enits ioiIndna.f tsI ouidat nn gnonrawa rlagi ofoJatuarts11 r19me b aBhi atistnviDr aRaehndur P ,saig twg
fB st drel det ortthskInuKani eptaliL
Encrypted Output using Algorithm SKG 3.12 for Ck=3 and N1=4
A-,2a>H??.?<uv:5?~vW?>c?6?>a4: <*a?>8 * 6ve?~P>} <46a
*a 8X>-?a>g?~- :4X8 ?? *s?2% .?85 6w?Xz
H1Nv?42w42c?x%6g?q4-8< 6qL~a4%?>?, a?>a?0M?u?(5:e?a,

5. RESULTS AND DISCUSSION


The algorithm SKG 3.12 is successful for encrypting any text/string consisting of 10 or more characters. Minimum time
required to decryt any text/string consisting of 10 or more characters is about 3000 years [6] which is sufficiently large
to decrypt any text. The comparative analysis of Algorithms SKG 1.0, SKG 3.00 and SKG 3.12 is shown in Table 2.
Table 2: Comparative Analysis of Algorithms SKG 1.0, SKG 3.00 and SKG 3.12
S.No.

Metrics

1.

Security Parameters

2.

Nature

Volume 4, Issue 3, March 2016

Algorithm SKG 1.0

Algorithm SKG 3.00

Algorithm SKG 3.12

Simple

Simple

Complex

Page 4

IPASJ International Journal of Electronics & Communication (IIJEC)


Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
Email: editoriijec@ipasj.org
ISSN 2321-5984

A Publisher for Research Motivation........

Volume 4, Issue 3, March 2016


3.

Encryption/Decryption Algorithm

Same

Same

Different

4.

Character/Bit Oriented

Character
Oriented

Bit
Oriented

Bit
Oriented

5.

Min. No. of Characters

30

10

10

19

6.

Total No. of Possible Permutations

8.8810

7.

Min. Time required to find all


Permutations

1028 Days

22

10.751022

3409 Years

3409 Years

10.7510

Previously existing method for data security was algorithm SKG 1.0, which was proposed on concept of transpose
cipher. Then we have proposed algorithm SKG 3.00, which is based on the concept of modulation of digitized data on
digital form of clock pulse, but the proposed algorithm SKG 3.12 is more complex as compare to algorithms SKG 1.0
& 3.00 because here we have used double security parameters i.e., transpose/swapping variable and width of
modulating pulse.

6. CONCLUSION
The proposed algorithm SKG 3.12 was tested in Java platform for different values of Ck(= 1 to 7) and N1 (= 1 to
8N/3). In all cases the result seems to be satisfactory. It has been estimated that to crack the code we will require more
time than the data will reside on the medium to travel. So, it can be said that the proposed scheme will produce an
efficient secured algorithm for data transfer in both wired and wireless networks.
The following conclusions are drawn :
(1) The proposed algorithm SKG 3.12 is more complex as compare to algorithms SKG 1.0 & 3.00 because
here we have used double security parameters i.e., transpose/swapping variable and width of modulating pulse.
(2) In the proposed algorithm SKG 3.12, the encryption algorithm and decryption algorithm are different.

References
[1] S. K. Garg, Review of Secured Routing for Wireless Ad hoc Network, International Journal of Computing
and Business Research, 2(1), 2011.
[2] S. K. Garg, Wireless Network Security Threats, International Journal of Information Dissemination and
Technology, 1(2), pp. 110-113, 2011.
[3] T. Karygiannis, and L. Owens, Wireless Network Security, NIST Special Publication, 2002
[4] W. Stallings, Cryptography and Network Security: Principles and Practice, 5th Edition: Prentice Hall, 2011.
[5] R. H. Karpinski, Reply to Hoffman and Shaw, Datamation, 16(10), pp. 11, 1970.
[6] S. K. Garg, Information Security By Using Controlled NOT Gate: Algorithm SKG 3.00, International
Journal of Electronics Engineering, 6(2), pp. 20-24, 2014.
[7] S. K. Garg, Information Security By Interchanging Characters: Algorithm SKG 1.0, International Journal
of
Information Technology and Knowledge Management, 6(2), pp. 129-131, 2013.

Volume 4, Issue 3, March 2016

Page 5

You might also like