StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Using XmlBasics to encrypt a fileExpand / Collapse
Author
Message
Posted 12/14/2007 7:40:21 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 10:03:03 PM
Posts: 1,322, Visits: 3,439
I'm attempting to use the XmlBasics class in the XML namespace of SF. I need to encrypt the file, but am having a bit of trouble figuring out how to do that.

I do not understand how the validation key works, and if it is related to encryption. I also do not understand how the key/vector is set for the encryption of XML files. They seem to be hard coded. I've reviewed the training material from the class and am still confused.

Also, I note that you are using obsolete encryption methods within this class...any reason for that?

Thanks!
Post #13043
Posted 12/17/2007 1:41:19 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 10:03:03 PM
Posts: 1,322, Visits: 3,439
bump...
Post #13064
Posted 12/18/2007 10:10:56 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 3:20:54 PM
Posts: 4,769, Visits: 4,731
The validation key is for added security.  We used this for a simple application that we used that launches applications with a different Windows user so that the application could run with Administrative privleges while the logged in user runs as a restricted user.  We did not want the end-user to be able to copy the XML file from one machine to the next, so we used a hash based off of different parts of the machine information to set the validation key.  If it didn't line up, then the XML file could not be read...thus...BOOM   We obviously trapped the error, but it prevented someone from trying to be tricky and added another level of security.

Also, I note that you are using obsolete encryption methods within this class...any reason for that?

This will not be an issue and we use it all of the time.  A while back we realized that we had a bug with the CreateMD5Hash when providing too short of a key.  We could not remove the method as it is used in security as well as other methods (including this one) and it could have a broad impact it we just changed that method.  So we created another that worked as we needed it to and just made the other obsolete so that you would not use it in any new code.  In fact, most of the methods in the XMLBasics have been updated to work outside of the obsolete method, but there were a few that could not be changed as it would have a negative impact on those files already encrypted in the field.

Post #13078
Posted 12/19/2007 7:45:21 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 10:03:03 PM
Posts: 1,322, Visits: 3,439
Thanks for the info. I'm still unclear on how to use the validation key. When is it set and how is it used during opening/further writing?
Post #13085
Posted 12/20/2007 10:24:18 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 3:20:54 PM
Posts: 4,769, Visits: 4,731
Greg,

You do not provide a Validation Key when writing the XML file.  It is assigned when the XML file is created.  I have created a sample that shows how to use this logic.  The Xml file is encrypted and used the validation key.  When an invalid Validation Key is provided, we actually prevent the records from being loaded rather than throwing an error.  I wrote a sample on how to use this that you can find here:

http://forum.strataframe.net/FindPost13096.aspx

Post #13097
Posted 12/20/2007 11:14:49 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 10:03:03 PM
Posts: 1,322, Visits: 3,439
The solution must be a VS 2008 solution.

I'm going to load up VS 2008 soon...no...really, I've just been busy

(Jeesh, this is a tough crowd to keep up with )
Post #13099
Posted 12/20/2007 1:53:09 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 3:20:54 PM
Posts: 4,769, Visits: 4,731
Oops...yeah, it was  .  I have posted an update that has two solutions...one for each version.  I did write it in 2.0, so that part will work. http://forum.strataframe.net/FindPost13102.aspx
Post #13103
Posted 12/20/2007 3:06:07 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 10:03:03 PM
Posts: 1,322, Visits: 3,439
Thanks Trent! And I just installed VS 2008
Post #13107
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 2:20am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.141. 14 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.