Medical Encryption and Compression for Secure using LSB change and Random Numbers Generation s Algorithms G. Thippanna *1, Research Scholar, Dept. of CS & T, Sri Krishnadevaraya University, India. gt.pana2012@gmail.com. Dr. T. Bhaskara Reddy 2 Research Supervisor and HOD, Dept. of Computer Science & Technology, S.K. University, India ABSTRACT Multimedia applications have become very popular. Valuable multimedia content such as digital images, however, is susceptible to unauthorized access while in storage and during transmission over a network. Streaming digital images also require high network bandwidth for transmission. For effective image transmission over the Network/ Internet, therefore, both security and bandwidth issues must be considered. In this paper entitles Medical Encryption, decryption using LSB change Algorithm will make a cipher image. In this paper used LSB changed values, after applying LSB, make 3 random numbers and add simultaneously to LSB changed values, and apply mode of 255 conditions to any values is approximate to 0-255. Key Words: images, LSB Technique, random numbers, mod operations. I. INTRODUCTION Nowadays on an internet the amount of digital visualization i.e. images, data...etc., is increasing rapidly. Lot of information which is transmitted through internet / networks in the form of images / data. Basically there are two main technology [3] are used. The first is based on the content protection is that encryption, in this technique to decrypts using a required key. In the second is based on protection of secretly embedding data / image with other image / data. In todays the challenging is the performance of encryption and compression. There are many encryption roles are there. When we applied simultaneously the technique of these on image / data, the contained information s are available in the form of unreadable and unrecognization, even the hackers are also not to interested / are not to take risky step to hack such typed information from the communication. In every day in the field different encryption techniques are already introduced, among them this entitle Medical Encryption and Compression for Secure using LSB change Algorithm technique is some more better from all of those existed technique. Here in our proposed technique compression techniques are also used. Encryption and decryption is process to provide a security to images, the consequence of this method to transfer the image information with security from one place to another. In this paper entitle Medical Encryption, decryption using LSB change Algorithm will make a cipher image in the format of this method the image is available in unrecognized format. In this paper used LSB changed values, after applying LSB add 3 random numbers simultaneously to LSB changed values, and apply mode of 255 conditions to any values is exasted of image value 0-255. The need of this technique is helpful used in the navy and army if any information secretly from one place to another. Even though the country boots are can t to degrade the information. II. PROPOSED WORK In this technique we should take a raw image as a source input file, because the raw image have not any header file, it is easy to allow the changes. After we took raw image as input file convert into digital format later arrange in reverse form of digital format. Apply the Lease Sequence Bit (LSB) on reverse digital format. We should make three random numbers an d add these three random numbers to applied LSB values simultaneously, applied mod 256 to previous steps it makes the encrypted cipher image in unreadable format. And using compression technique we applied this compression technique on cipher image it will reduces the size of cipher image is call Compressed Encrypted image. The followed steps and figure will explain in detail of proposed method. Step 1: should take RAW image as source input image file. Step 2: Convert this RAW image to digital format. Step 3: Apply reverse values of digital image format to step 2. Step 4: Apply LSB technique on step3. Step 5: Make three random numbers. Step 6: Add those three random keys to applied LSB values. Step 7: Apply Mod 256 to step 6. Step8: cipher image is created is called Encrypted image. RES Publication 2012 Page 6
Step 9: apply compression technique on delivered cipher image. Step 10: Created compressed Encrypt image in form of unreadable format. Encrypted Apply Compression Technique Compressed Encrypted image Digital format of Apply mod 256 Reverse values of Digital image format Apply LSB Make 3 random Numbers Add these 3 random numbers simultaneously to Applied LSB values Fig 1: Shows the forward Technique for proposed method. These above steps explained the proposed work in detail; Cryptography deals with taking a message and making it appear to random noise, unreadable to an outside world. It does nothing to hide the presence of message to itself. Often steganography is used in conjunction to cryptography so that message remains unreadable even if detected. This paper is to create across platform that can effectively encrypt a message and hide it inside a digital image file. As there are many application of combining cryptography and steganography like it allows for two parties to communicate secretly and covertly. It allows for some morally conscious people to safely whistle blow on internal actions. One of the other main uses is for the transportation of high level or top secret documents between international governments. Procedure for Encryption //Read the pixels from an input image String path = "path of the image Buffered image = IO.read(new File(path)); // to convert image into pixel matrix extractdata(buffered image) int w = image.getwidth(); int h = image.getheight(); WritableRaster raster = image.getraster(); int[][] data = new int[h][w]; for (int y = 0; y < h; y++) for (int x = 0; x < w; x++) data[y][x] = raster.getsample(x, y, 0); //Replace the pixels by some numerical value settab(int s,string[] arr) int k=1,c=258; for(int i=0;i<256;i++) if(s==i) c=(integer.parseint(arr[i])); //Generate the Key value randomgen() //Reverse values of Digital Format for(p=m-1;p>=0;p--) for(q=n-1;q>=0;q--) rev[p][q]=clmsb(matrix[p][q]); //System.out.print(" + "+rev[p][q]); fio.write(rev[p][q]); Generate the key value using random generation technique. And get the new matrix of 8*8 size // transpose the matrix RES Publication 2012 Page 7
Transpose the newly randomly generated matrix. //apply the exception law Apply exception law on randomly generated matrix and encode matrix. And get the new matrix. resexc(int[][] a,int[][] b) int xr[][]=new int[8][8]; for(int i=0;i<8;i++) for(int j=0;j<8;j++) xr[i][j]=(a[i][j])^(b[i][j]); //find the trace of the above matrix //Ceaser Substitution and generate the encrypted image rescipher(int[][] data,int key) int res[][]=new int[8][8]; for(int i=0;i<h;i++) for(int j=0;j<w;j++) res[i][j]=data[i][j]+key; //peform the random row transposition randcol() for(int i = -1; i < w; i++) numbers.add(i+1) Collections.shuffle(numbers); for(int j=0; j<=w; j++) rand.add(numbers.get(j)); uniquecol(int[][] mat,arraylist<integer> rand) int k=0; while(k<=w) int i=0; i=rand.get(k); if(i<8) for(int j=0; j<8; j++) mylist.add(new Integer(mat[i][j])); k=k+1; else if(!compsust(cbyte,pbyte)) fods.write(cbyte); bpdata=(byte)(bpdata 0x01); pbyte=cbyte; else nbyte=fis.read(); if(nbyte==-1) if(noofbits==8) bpdata=0; noofbits=0; bpcount++; count++; if(compsust(nbyte,pbyte)) if(noofbits==8) bpdata=(byte)(bpdata 0x01); mergebyte=finddiff(pbyte,cbyte); mergebyte=mergebyte<<4; sbyte=finddiff(pbyte,nbyte); mergebyte=mergebyte (0x0f&sByte); fods.write(mergebyte); else if(noofbits==8) if(noofbits==8) RES Publication 2012 Page 8
fods.write(nbyte); bpdata=(byte)(bpdata 0x01); pbyte=nbyte; if(noofbits==8) FileInputStream fids=new FileInputStream(dsFile); FileInputStream fibp=new FileInputStream(bpFile); while((cbyte=fibp.read())!=-1) fobpds.write(cbyte); while((cbyte=fids.read())!=-1) fobpds.write(cbyte); apply() lstnodes.add(j,nd); Node first=null,second=null; Node rt=null; while(true) if(lstnodes.size()==0) first=(node)lstnodes.removefirst(); if(lstnodes.size()==0) second=(node)lstnodes.removefirst(); rt=new Node(); rt.prob=first.prob+second.prob; rt.leftchild=second; rt.rightchild=first; for(j=0;j<lstnodes.size();j++) cur=(node)lstnodes.get(j); if(cur.prob>=rt.prob) lstnodes.add(j,rt); root=first; String hmc; preorder(root,""); try FileInputStream is=new FileInputStream(inFile); FileOutputStream fos=new FileOutputStream(outFile); int cbyte; byte hmccode=0; byte noofbits=0; while((cbyte=fis.read())!=-1) key=new Integer(cByte); hmc=(string)hmctable.get(key); for(i=0;i<hmc.length();i++) if(hmc.charat(i)=='1') hmccode=(byte)(hmccode 0x01); if(noofbits==8) fos.write(hmccode); noofbits=0; hmccode=0; hmccode=(byte)(hmccode<<1); while(ekeys.hasmoreelements()) key=(integer)ekeys.nextelement(); hmc=(string)hmctable.get(key); fop.write(key.intvalue()); len=(byte)hmc.length(); fos.write(len); for(i=0;i<hmc.length();i++) if(hmc.charat(i)=='1') hmccode=(byte)(hmccode 0x01); if(noofbits==8) fok.write(hmccode); noofbits=0; hmccode=0; hmccode=(byte)(hmccode<<1); preorder(node troot,string hc) if(troot!=null) troot.hcode=hc; if(troot.isleaf) RES Publication 2012 Page 9
hmctable.put(new Integer(troot.pixel),troot.hcode); preorder(troot.leftchild,hc+"0"); preorder(troot.rightchild,hc+"1"); Least Significant Bit Algorithm ALGORITHM 1 1. Select a cover image of size M*N as an input. 2. 2. The message to be hidden is embedded in RGB component only of an image. 3. Use a pixel selection filter to obtain the best areas to hide information in the cover image to obtain a better rate. The filter is applied to Least Significant Bit(LSB) of every pixel to hide information, leaving most significant bits (MSB). 4. After that Message is hidden using Bit Replacement method. Begin Declare answer variable; answer = rn.nextint (2) + 1; Read (answer); End End. III. RESULTS Here in this technique we compare the proposed method (Technique) with another existed method, is gives a better results than of existed Fig -3 Fig 2: Algorithm of LSB Algorithm of Least Significant Bit Pseudo code to make three random numbers: Begin declare n, I, randomnum variables; n = maximum - minimum + 1; int i = rn.nextint() % n; randomnum = minimum + i; End OR Declare Start // start declaration section Begin Random rn; // Declare random number keys. End Random rn = new Random (); loop 0 to 2 maximum close //Close declaration RES Publication 2012 Page 10 Fig-4 Fig 3 & 4: show the figure comparison between original and retrieved images after applies the proposed method. S no Name Size Cipher Img size Huff Comp SFE RAW GIF 1 Baboon 16384 16,384 15119 15,461 14,641 2 Brain 12610 12,610 8807 10,160 7,139 3 Madhuri 16384 16,384 15232 15,683 13,275 4 Shoulder 18225 18,225 14,118 15,211 11,596 Table-1 : Show the information about Different Compression applied on s
20000 18000 16000 14000 12000 10000 8000 6000 4000 2000 0 Size International Journal of Modern Electronics and Communication Engineering (IJMECE) ISSN: 2321-2152 Cipher Img size Graph-1: Show the information about Different Compression applied on s Here in the above table and graph describes about the information of encrypted compressed images. at every time compressed cipher images less size than its original cipher image. Streaming digital images also require high network bandwidth for transmission. For effective image transmission over the Network/ Internet, therefore, both security and bandwidth issues must be considered. In the manner this compressed encrypted images are more secure at time of transmits in communication from one place to another, even adversary is hack the communication he couldn t understand. So the security for the digital images has become highly important since the communication by transmitting of digital products over the open network occur very frequently. IV. 1 Baboon 2 Brain 3 Madhuri 4 Shoulder Huff Compre SFE CONCLUSION Gif In secure transformation of encrypted image is to provide high network security for transformation. In this paper we propose encrypt and compress the images using LSB changing and random number generates algorithms for medical images. The main contribution of this entitles work will shows A comparisons study between the information about Different Compression applied on Encrypted s. Since this method of image encryption uses the graphical equivalent of a one-time key, it should theoretically be unbreakable. To work properly, however, each key image must be used once and only once. In future the video based encryption has been achieved and to provide high security separate key should be used for encryption and decryption. REFERENCES 1. Mr. G. Thippanna, Dr. T.bhaskara reddy, a re-examine of gen on an assortment of images, Compression techniques Wicket: interface=:2::::, 2012 Nov-Dec ISSN No. 0976-5697, pp: 112 119. 2. http://www.cscjournals.org/manuscript/journals/ijcss/volu me1/issue1/ijcss-4.pdf. 3. W. Puech and J.M. Rodrigues. A New Crypto- Watermarking Method for Medical s Safe Transfer. In Proc. 12th European Signal Processing. Conference (EUSIPCO 04), pages 1481 1484, Vienna, Austria, 2004. 4. Fallahpour M and Sedaaghi M H 2007 High capacity lossless data hiding based on histogram modification. IEICE Electronics Express 4: 205 210. 5. Tseng H W and Hsieh C P 2008 Reversible data hiding based on image histogram modification. Imaging Sci. J. 56: 271 278. 6. Stork, M., Digital chaotic systems examples and application for data transmission, Electrical and Electronics Engineering, 2009. 7. AN APPROACH TO REVERSIBLE INFORMATION HIDING FOR IMAGES Santosh Arjun, IEEE Member, NVIDIA, Bangalore, India. Narasimha Rao, IEEE Student Member Electronics and Communication Engineering. AUTHOR CONTRIBUTIONS Mr. G. Thippanna, Research Scholar (Ph.D.). He has completed his Post Graduation in 2008 from S.V. University, Tirupati. He had 4 years of teaching experience and 4 years of research experience, til now 4 international papers. His research interests are in the field of image Processing, computer networks. Dr. T. Bhsakara Reddy, Associate Professor. Department of Computer Science and Technology at S.K University, Anantapur A.P. He holds the post of Deputy Director of Distance education at S.K. University and He also the CSE Coordinator of Engineering at S.K. University. He has completed his M. Sc and Ph. D in computer science from S.K. University. He has acquired M. Tech from Nagarjuna University. He has been continuously imparting his knowledge to several students from the last 17 years. He has published 47 National and International publications. He has completed major research project (UGC). Four Ph. D and Three M. Phil have been awarded under his guidance. His research interests are in the field of image Processing, computer networks, data mining and data ware house. and its algorithms, (IJARCS), http://www.ijarcs.info/? RES Publication 2012 Page 11