Decrypting an encrypted file in memory and then opening it

Dear Masters

i have encrypted a file on the hard disk, i want to decrypt this file in memory and want to open it by another application,FOR EXAMPLE suppose that i have encrypted an Excel file so i want to decrypt it in memory and i want to open it by excel , because of security reasons(preventing some usesr from reading it's data) i don't want to put decrypted file on the hard drive so i need it to be decrypted then to be opened only in memory, how can i do this ? I know that excel files can be password protected, but this is only an example and the important case for me is to decrypt a file in memory then open it by another application.

please guide me, thank you in advance for your information.

sincerely yours
===============
Milad
miladyyyAsked:
Who is Participating?
 
alainbrydenConnect With a Mentor Commented:
Well I never said "Creating a temporary file in memory" (ie RAM) because you can't create a file in RAM, you can only store data in ram. (that data could be an entire file but it would be awkward working with it, because it can no longer be treated as a file.)
what I had said was "place it into a temporary folder", But I still think you can work with this option.

What I do for instance is I say

open( ...the file you are opening..)
then
save( ..the file you are saving, "C:/temp/mytemp.ext")
make alterations/ decrypt it etc and read from it.
and then when you are done with it:
delete("C:/temp/mytemp.ext")
and all that remains it the encrypted file.
0
 
alainbrydenCommented:
Well if you need to open a decripted file, then I think what you may need to do is encrypt it, then when you want to open it, decrypt it and open the other application through your program in read only mode, and monitor the application, otherwise, if you are opening the file in the application independent of your program, you will need to decrypt it first and place it into a temporary folder on your hard drive before the other application will read it.
0
 
alainbrydenCommented:
For example, if you have an incrypted file, you can open it in your program then excel by first decripting opening the file and decrypting it from within your program, and then giving Excel reference to the file by creating an Excel.Application from within your program, then when you are done with it, you don't save your decrypted changes to the file and it remains, on the hard drive, encrypted. But you can only do this easily with some applications, some won't let an external program create an instance of them, and the way to do it differs with each one.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
miladyyyAuthor Commented:
Dear alainbryden

First of Thank you for your information, the only thiong that i don't know is :

"Creating a temporary file in memory"

So please help me.if any source code is available please guide me.

Thank you in advance
===============
Sincerely Yours
Milad
0
 
alainbrydenCommented:
I certainly don't have an objection :P

I'm pretty sure my reccomendation is accurate to as great an extent as it is able to be, considering the information provided.
0
 
alainbrydenCommented:
well worth at least 50 points anyways
0
All Courses

From novice to tech pro — start learning today.