473,386 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

File Encryption Question

I have a component that encrypts/decrypts files using Rijndael
encryption. The component works flawlessly but I want to try to
extend its capablities and this is my general question:

I have an "in" and a "out" function.

The in function supplys the name of the location of where the file to
be encrypted resides and the "out" function specifies the location of
where to write the outputed encrypted file. Both function require a
string.

Instead of writing this encrypted file back to the drive I would like
to store it in a variable, read information from this file, and then
dump the variable.

IE. Opening a package looking in, but not destroying anything.

What is the best approach to doing this...

I'm trying to avoid, writing decrypted files to the drive and then
having to securely delete them.
Nov 21 '05 #1
2 1177
pe***@mclinn.com (Peter) wrote in news:dcde2a5a.0408180718.f9db9f4
@posting.google.com:
Instead of writing this encrypted file back to the drive I would like
to store it in a variable, read information from this file, and then
dump the variable.


Can you stream the file to a byte array... or an IO stream like
MemoryStream?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #2
* pe***@mclinn.com (Peter) scripsit:
I have a component that encrypts/decrypts files using Rijndael
encryption. The component works flawlessly but I want to try to
extend its capablities and this is my general question:

I have an "in" and a "out" function.

The in function supplys the name of the location of where the file to
be encrypted resides and the "out" function specifies the location of
where to write the outputed encrypted file. Both function require a
string.

Instead of writing this encrypted file back to the drive I would like
to store it in a variable, read information from this file, and then
dump the variable.


Take a look at the 'System.IO.BinaryReader'. You can use this class to
read the contents of a file into a byte array. Depending on how your
encryption algorithms work, you may want to specify a 'MemoryStream' as
output stream, and later use a 'BinaryReader' + 'BinaryWriter' to read
data fro0m the memory stream and write it to the output file.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dan V. | last post by:
Situation: I have to connect with my Windows 2000 server using VS.NET 2003 and C# and connect to a remote Linux server at another company's office and query their XML file. Their file may be...
14
by: Ray Cassick \(Home\) | last post by:
Ok, time to ask the question here.. I have been battling over this one for sometime now and just have to ask it. I have created a few classes that I use to act a security keys. These classes get...
0
by: DreamFly | last post by:
You can use this software to encrypt your important files which you don't want others to see with AES encryption algorithm. Cool File Encryption adopts the international standard cryptographic...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
2
by: Nickneem | last post by:
I made a key generator according to the specs of a shareware partner so customers can register online. It generates a key from a 'secret' and a combination of name and email / zip and then...
14
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
25
by: eggie5 | last post by:
I have a form where a user can change his password, but I'm confused on how to prevent this from being transmitted in plain text. Well, I know how not to transmit it in plain text - use any type...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
3
by: =?Utf-8?B?TG9yZW4=?= | last post by:
I’m trying to encrypt and decrypt a file in vb.net. I am using the TripleDESCryptoServiceProvider encryption found in System.Security.Cryptography. Below is the code for my Encrypt and Decrypt...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.