public static void decrypt(File inputFile, File outputFile) throws IOException {
		BufferedImage img   = ImageIO.read(inputFile);
		int p1,p2;
		
		/**
		 * Step 1: do the stuff
		 */
		p1 = img.getRGB(0, 0);
		p2 = img.getRGB(1, 0);
		
		int[] bitsPerChannel = new int[3];
		getChannelEncoding(new byte[] { (byte)((p1 >> 16) & 0xff), 
										(byte)((p1 >>  8) & 0xff), 
										(byte)((p1)       & 0xff) }, 
						   new byte[] { (byte)((p2 >> 16) & 0xff), 
										(byte)((p2 >>  8) & 0xff), 
										(byte)((p2)       & 0xff) }, 
										bitsPerChannel);
		
		int next_image_pixel = 2;
		int next_output_bit = 0;
		int written_bytes = 0;
		int size = -4;

		FileOutputStream out = new FileOutputStream(outputFile);
		ByteBuffer lengthBuffer = ByteBuffer.allocate(4);
		
		byte current = 0;
		
		while (written_bytes < size || size < 0) {
			p1 = img.getRGB(next_image_pixel%img.getWidth(), next_image_pixel/img.getWidth());
			next_image_pixel++;
			
			byte[] pixel = new byte[] {
				(byte)((p1 >> 16) & 0xff), 
				(byte)((p1 >>  8) & 0xff), 
				(byte)((p1)       & 0xff),
			};
			
			for (int c=0; c<3; ++c) {
				for (int b=0; b<bitsPerChannel[c]; ++b) {
					if (written_bytes >= size && size >= 0) {
						out.close();
						return;
					}
					
					current |= (((pixel[c] >> b)&0x01) << next_output_bit);
					if (next_output_bit >= 7) {
						next_output_bit = 0;
						
						if (size < 0) {
							lengthBuffer.put(current);
							size ++;
							
							if (size == 0) {
								lengthBuffer.rewind();
								size = lengthBuffer.getInt();
								
								System.out.println("found size: " + size);
							}
						} else {
							out.write((int)current);
							written_bytes ++;
						}
						
						current = 0x0;
					} else {
						next_output_bit ++;
					}
				}
			}
		}
		
		out.close();
	}