Solved

Decrypting an encrypted file in memory and then opening it

Posted on 2006-06-20
8
281 Views
Last Modified: 2010-04-17
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
0
Comment
Question by:miladyyy
  • 5
8 Comments
 
LVL 20

Expert Comment

by:alainbryden
Comment Utility
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
 
LVL 20

Expert Comment

by:alainbryden
Comment Utility
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
 

Author Comment

by:miladyyy
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 20

Accepted Solution

by:
alainbryden earned 50 total points
Comment Utility
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
 
LVL 20

Expert Comment

by:alainbryden
Comment Utility
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
 
LVL 20

Expert Comment

by:alainbryden
Comment Utility
well worth at least 50 points anyways
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add mobile access to browser application 3 129
Fix45 challenge 15 83
Specific format 21 140
tidtcpserver connection lost handle 2 41
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now