EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Use existing files iin storage

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#19619
Posted: 03/29/2012 01:19:21
by Alexander Plas (EldoS Corp.)

Here is the code which creates the encrypted storage, copies there one file then closes and reopens the storage with the password.

public static void CopyStream(Stream input, Stream output)
{
byte[] buffer = new byte[32768];
int read;
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
{
output.Write(buffer, 0, read);
}
}

private void Form1_Load(object sender, EventArgs e)
{
SolFSStorage.SetRegistrationKey("...");
SolFSStorage.ForceUnmount("");

SolFSStorage Storage = new SolFSStorage();
Storage.FileName = @"C:\1.st";
Storage.StorageEncryption = SolFSEncryption.ecAES256_HMAC256;
Storage.StoragePassword = "123456";
Storage.Open(StorageOpenMode.somCreateAlways);
SolFSStream Stream = new SolFSStream(Storage, @"\1.jpg", FileMode.CreateNew);
CopyStream(new FileStream(@"C:\1.jpg", FileMode.Open), Stream);
Stream.Close();
Storage.Close();

Storage = new SolFSStorage();
Storage.FileName = @"C:\1.st";
Storage.StoragePassword = "123456";
Storage.Open(StorageOpenMode.somOpenExisting);
//pictureBox1.Image = Image.FromStream(new SolFSStream(Storage, @"\1.jpg", FileMode.Open));
string storeFileName = @"\1.jpg";
string mountingPoint = "";
Storage.GetMountingPoint(0, ref mountingPoint);
string sysFileName = @"\\.\" + mountingPoint + storeFileName;
pictureBox1.Image = Image.FromFile(sysFileName);
}

It is still possible to open encrypted storage with SolFSExplorer tool but the password is required.

There is no any backdoors or any other ways to retrieve the information from the encrypted storage without the password.
#19620
Posted: 03/29/2012 01:29:26
by Richa  (Basic support level)
Joined: 03/22/2012
Posts: 22

Thanks Alexander.

I used:

m_Storage.StoragePassword = "mypassword";

to supply the password to the encrypted storage and managed to open it.
But I wanted to ask that, does supplying this password to the storage's properties, encrypt the storage automatically(using AES encryption)?
#19621
Posted: 03/29/2012 01:38:09
by Alexander Plas (EldoS Corp.)

No, you should explicitly set storage encryption mode to encrypt the storage. When you open encrypted storage encryption mode is not required, it will be detected from the storage file. Please use ecAES256_HMAC256 mode, ecAES256_SHA256 mode is a bit less secure and we maintain it for backward compatibility.
#19622
Posted: 03/29/2012 01:52:06
by Richa  (Basic support level)
Joined: 03/22/2012
Posts: 22

Thank you so much for your quick reply. I have added an aditional encryption as well.

Thanks again!

Reply

Statistics

Topic viewed 12139 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!