How Can I Use Memory Stream to read and write a file

getemerson

New member
Joined
Mar 1, 2003
Messages
4
Location
Surrey, UK
Fellow programmers - your challenge.

Overview:
Im using file io class to read a file, decrypt it, create a decrypted copy back to hard drive before launching the decrypted copy in realplayer. This all works just peachy but ...

Problem:
The decrypted copy is now in view and obviously vunerable outside of the application for all to view and copy.

What I need:
Im guessing that i can somehow use one of the io.stream classes
to copy the file into memory so I dont have to create a copy on the hard drive.

Is this at all possible???

I hope this makes sense -

I dont as yet have sample code to do this -

Any suggestion/code will be greatly appreciated.

Mark
 
You can probably keep a copy in memory using the MemoryStream class, but its not meant to be a file. You cant access it like a file, and Im pretty sure its readonly too. There wouldnt be a way for RealPlayer to access it even if it _was_ meant to be an in-memory file.
 
Memory Stream - Encryption - Decryption

Thank you for your response. :D

I suppose the burning question is then ...

Is there any other vb.net solution that will enable me to hide and work with a decrypted file within the application.

What about using assemblies and resourse files to wrap the files ? - This is quite a new area for me so I havnt explored these options - yet!

Bear in mind that the user will probably have admin rights on their PC so I cant use windows authentication based on their profile.

Im currently using the diagnostic class to launch the .ram extesnion file (realplayer) in this case. This all works fine as previously mentioned.

You can see my problem - the copy created on the hard drive using the stream class is now decrypted/vunerable and in full view for the user to find and copy. Undesirable.

Ive thought of using the Windows Media Rights Manager SDKs - This would actually solve most of my issues. But at the moment we are looking at an in-house applicatoin.

Thank you in advance for any pointers on this.


Mark
:D
 
I honestly cant see a way of doing what you want. Youre restricted to using whatever RealPlayer can open, which presumably is just a file. You could always give the file a Hidden attribute I suppose.

Just a thought, if RealPlayer can open URLs, you might be able to create a dummy webserver to serve your decrypted stream and have RealPlayer connect to that. A little far fetched, but then, so is your requirement :)
 
Back
Top