Decrypt file using Xor in android
<p>I have a encrypted video file. </p>

<p>How to decrypt it using XOR in Android.</p>

<p>EDIT Answer : I thanks for all your response. I have solved it. If some one need the code it is as follows:- </p>

<p>// This code will decode an encoded video by using XOR</p>

<p>public class MainActivity extends Activity {</p>

<pre><code>                @Override
                public void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);


                    decrypt() ;
                //get the path of sdcard
                 File dir = Environment.getExternalStorageDirectory ();
                 //this function play your video  
                                 videoPlayer(dir.getPath(),"dec.3gp",true);

                }

    public void videoPlayer(String path, String fileName, boolean autoplay){

                    getWindow().setFormat(PixelFormat.TRANSLUCENT); 

                    VideoView videoHolder = new VideoView(this); 

            videoHolder.setMediaController(new MediaController(this)); 

             videoHolder.setVideoURI(Uri.parse(path+"/"+fileName)); 
                   //get focus, before playing the video.

                    videoHolder.requestFocus(); 

                    if(autoplay){

                        videoHolder.start(); 

                    }

                    setContentView(videoHolder);

                 }

                static ByteArrayOutputStream ous;
                static InputStream ios;

     //this function will decrypt the encoded video using   key=5
                public static void decrypt() {

                    try {

                  File dir = Environment.getExternalStorageDirectory();

     FileInputStream fis = new FileInputStream(new File(dir,"003.3gp"));

                        byte[] bya=read(new File(dir,"003.3gp"));

    FileOutputStream fos = new FileOutputStream(new File(dir,"dec.3gp"));

                        for(int i=0;i&lt;bya.length;i++){

                        fos.write(bya[i]^5 );
                      }

                        fos.flush();
                        fos.close();
                        fis.close();

                    } catch (IOException e) {
                        Log.d("Tag444", "IOException");
                        e.printStackTrace();
                    }

                }





                public static byte[] read(File file) throws IOException {


                    try {
                        byte []buffer = new byte[4096];
                         ous = new ByteArrayOutputStream();
                        ios = new FileInputStream(file);
                        int read = 0;
                        while ( (read = ios.read(buffer)) != -1 ) {
                            ous.write(buffer, 0, read);
                        }
                    } finally { 
                        try {
                             if ( ous != null ) 
                                 ous.close();
                        } catch ( IOException e) {
                        }

                        try {
                             if ( ios != null ) 
                                  ios.close();
                        } catch ( IOException e) {
                        }
                    }
                    return ous.toByteArray();
                }

            }
</code></pre>
