﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Using XmlBasics to encrypt a file</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 08:26:41 GMT</lastBuildDate><ttl>20</ttl><item><title>Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13043.aspx</link><description>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.  &lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Also, I note that you are using obsolete encryption methods within this class...any reason for that?&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Thu, 20 Dec 2007 15:06:07 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13107.aspx</link><description>Thanks Trent! And I just installed VS 2008 :D</description><pubDate>Thu, 20 Dec 2007 15:06:07 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13103.aspx</link><description>Oops...yeah, it was&amp;nbsp;:blush: .&amp;nbsp; I have posted an update that has two solutions...one for each version.&amp;nbsp; I did write it in 2.0, so that part will work. :) &lt;A href="http://forum.strataframe.net/FindPost13102.aspx"&gt;http://forum.strataframe.net/FindPost13102.aspx&lt;/A&gt;</description><pubDate>Thu, 20 Dec 2007 13:53:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13099.aspx</link><description>:alien:  The solution must be a VS 2008 solution.  &lt;br&gt;
&lt;br&gt;
I'm going to load up VS 2008 soon...no...really, I've just been busy :blush:&lt;br&gt;
&lt;br&gt;
(Jeesh, this is a tough crowd to keep up with :P )</description><pubDate>Thu, 20 Dec 2007 11:14:49 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13097.aspx</link><description>Greg,&lt;/P&gt;&lt;P&gt;You do not provide a Validation Key when writing the XML file.&amp;nbsp; It is assigned when the XML file is created.&amp;nbsp; I have created a sample that shows how to use this logic.&amp;nbsp; The Xml file is encrypted and used the validation key.&amp;nbsp; When an invalid Validation Key is provided, we actually prevent the records from being loaded rather than throwing an error.&amp;nbsp; I wrote a sample on how to use this that you can find here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forum.strataframe.net/FindPost13096.aspx"&gt;http://forum.strataframe.net/FindPost13096.aspx&lt;/A&gt;</description><pubDate>Thu, 20 Dec 2007 10:24:18 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13085.aspx</link><description>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?</description><pubDate>Wed, 19 Dec 2007 07:45:21 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13078.aspx</link><description>The validation key is for added security.&amp;nbsp; 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.&amp;nbsp; 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.&amp;nbsp; If it didn't line up, then the XML file could not be read...thus...BOOM :)&amp;nbsp; We obviously trapped the error, but it prevented someone from trying to be tricky and added another level of security.&lt;/P&gt;&lt;P&gt;[quote]Also, I note that you are using obsolete encryption methods within this class...any reason for that?&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;This will not be an issue and we use it all of the time.&amp;nbsp; A while back we realized that we had a bug with the CreateMD5Hash when providing too short of a key.&amp;nbsp; 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.&amp;nbsp; 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.&amp;nbsp; 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.</description><pubDate>Tue, 18 Dec 2007 10:10:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Using XmlBasics to encrypt a file</title><link>http://forum.strataframe.net/FindPost13064.aspx</link><description>bump...</description><pubDate>Mon, 17 Dec 2007 13:41:19 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>