Using XmlBasics to encrypt a file


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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!
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
bump...
Trent Taylor
Trent Taylor
StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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 Smile  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.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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?
Trent Taylor
Trent Taylor
StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Alien The solution must be a VS 2008 solution.



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



(Jeesh, this is a tough crowd to keep up with Tongue )
Trent Taylor
Trent Taylor
StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)StrataFrame Developer (13K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Oops...yeah, it was Blush .  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. Smile http://forum.strataframe.net/FindPost13102.aspx
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Thanks Trent! And I just installed VS 2008 BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search