title: Encrypting an image to form another image?
body: <p>Is there a way to encrypt an image in Java so that another image is formed? I'm now using the following code:</p>
  
  <pre><code>Cipher cipher=Cipher.getInstance("AES");    
  cipher.init(Cipher.ENCRYPT_MODE, key);
  enFile=cipher.doFinal(bFile);
  </code></pre>
  
  <p>But the resulting file cannot be opened without decrypting. I found <a href="https://stackoverflow.com/questions/20862143/encrypt-only-the-content-of-an-image-file-not-entire-file">this question</a> in stackoverflow but it is in Android and I couldn't implement it in Java.</p>
  
  <p>Can anyone please suggest a way to implement this in Java or any other way to convert an image into another using AES encryption?</p>