473,396 Members | 2,016 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,396 software developers and data experts.

xml encryption using VB

Hey all. I'm working on an xml file that pulls some data from another xml document "a password, usename and account info" wich is stored on my local drive for easy access so i dont have to enter the info each time. As is now the data is entered into the xml file manually then saved and when the program runs it reads the data from the xml file i manually entered my data into. This all works fine except the data is left in plain text and can be read by anyone with access to my pc. The solutions seems simple to encrypt the data some how then have it decrypted when the program runs. Ive read alot! So much my head hurts! Ive found several code examples that sound to do what i want but im a little confused how to implement any of the methods ive found or where to start with it.
The code im working with is below. All i need is the data.text in the code below it is <include>LoginData.txt.xml</include> file to be encrypted and saved as encrypted. Creating another page wich asks for the data to be entered then saved through the interface instead of manually can easily be done which is where the encrypting part will most likely take place. Then within the code below decrypt the data so the code below can continue working like normal. Any help, suggestions, ideas anything will help. Thanks in advance.
Expand|Select|Wrap|Line Numbers
  1. <Page IgnoreTab="false" Location="310,210" Name="WindowPage" PackLocation="center,center" PackLocationProp="-202/0001,-174/0001" ScrollExtent="524,374" Size="524,374">
  2. <Scrollbar ArrowPressSound="sounds/button" Control="CharacterSelect" HideIfUnnecessary="true" Location="473,75" MaximumSize="22,16384" MinimumSize="22,60" Name="Scroll" PackLocation="right,top" PackLocationProp="-051/0001,0075/0001" PackSize="f,a" PackSizeProp="0002/0003,0148/0001" ScrollExtent="22,226" Size="22,226" Style="/CommonElements.ScrollbarVertical.data.style"/>
  3. <Listbox BackgroundColor="#FFFFFF" DataSource="CharacterData" LocalTooltip="Click to select, double-click to login" Location="260,77" Margin="10,10,10,10" Name="CharacterSelect" OnDoubleClick="Parent.AutoplayChar.Text=SelectedItem.Name
  4. Parent.AutoplayWorld.Text=SelectedItem.Server
  5. Parent.Username.Text=SelectedItem.Username
  6. Parent.Password.Text=SelectedItem.Password
  7. Parent.ConnectButton.Press=true" OnSelect="Parent.AutoplayChar.Text=SelectedItem.Name
  8. Parent.AutoplayWorld.Text=SelectedItem.Server
  9. Parent.Username.Text=SelectedItem.Username
  10. Parent.Password.Text=SelectedItem.Password" PackSize="a,a" PackSizeProp="0290/0001,0153/0001" RowTemplate="CharacterSelect_template" ScrollExtent="320,221" Size="234,221" Style="/CommonElements.Listbox.data.listbox_style" Tooltip="Click to select, double-click to login"/>
  11. <Text Font="/TextStyles.Normal.NormalStyle" LocalText="Select Character below or enter login data manually on the left:" Location="260,38" Name="SelectChar" ScrollExtent="222,33" Size="222,33" TextAlignmentVertical="Center" TextColor="#F2EFE1">Select Character below or enter login data manually on the left:</Text>
  12. <Button LocalText="Clear All" Location="41,224" MaximumSize="16384,26" MinimumSize="26,26" Name="ClearAllBtn" OnPress="Parent.Username.Text=&apos;&apos; Parent.Password.Text=&apos;&apos; Parent.AutoplayChar.Text=&apos;&apos; Parent.AutoplayWorld.Text=&apos;&apos;" ScrollExtent="69,26" Size="69,26" Style="/CommonElements.SmallPushButton.data.style">Clear All</Button>
  13. <Button LocalText="Clear Character/Server" LocalTooltip="Clears character and server choice so you can login to character select/create screen" Location="110,224" MaximumSize="16384,26" MinimumSize="26,26" Name="ClearCSBtn" OnPress="Parent.AutoplayChar.Text=&apos;&apos; Parent.AutoplayWorld.Text=&apos;&apos;" ScrollExtent="126,26" Size="126,26" Style="/CommonElements.SmallPushButton.data.style" Tooltip="Clears character and server choice so you can login to character select/create screen">Clear Character/Server</Button>
  14. <include>LoginData.txt.xml</include>
  15. <Template Name="CharacterSelect_template" Size="320,20">RowTemplate.xml</Template>
  16. <Text Font="/TextStyles.VeryLarge.VeryLargeStyle" LocalText=":3129920a94361beb:Login" Location="41,53" Name="Login" ScrollExtent="192,48" Size="192,30" TextAlignment="Center" TextAlignmentVertical="Center" TextColor="#F2EFE1">:3129920a94361beb:Login</Text>
  17. <Text Font="/TextStyles.Normal.NormalStyle" LocalText=":3129920afed79bde:Username" Location="19,95" Name="UsernameLabel" ScrollExtent="80,30" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920afed79bde:Username</Text>
  18. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,91" MaximumSize="16384,30" MinimumSize="30,30" Name="Username" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style"></Textbox>
  19. <Text Font="/TextStyles.Normal.NormalStyle" LocalText=":3129920a334bdb7c:Password" Location="19,128" Name="PasswordLabel" ScrollExtent="80,45" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920a334bdb7c:Password</Text>
  20. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,123" MaximumSize="16384,30" MinimumSize="30,30" Name="Password" Password="true" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style"></Textbox>
  21. <Text Font="/TextStyles.Normal.NormalStyle" LocalText=":3129920aee74cd68:Character" Location="19,159" Name="AutoplayCharLabel" OnHide="Visible=True" ScrollExtent="80,45" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920aee74cd68:Character</Text>
  22. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,155" MaximumSize="16384,30" MinimumSize="30,30" Name="AutoplayChar" OnHide="Visible=True" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style"></Textbox>
  23. <Text Font="/TextStyles.Normal.NormalStyle" LocalText=":3129920a0449c1b8:Server" Location="19,194" Name="AutoplayWorldLabel" OnHide="Visible=True" ScrollExtent="80,30" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920a0449c1b8:Server</Text>
  24. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,189" MaximumSize="16384,30" MinimumSize="30,30" Name="AutoplayWorld" OnHide="Visible=True" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style"></Textbox>
  25. <Button IsDefaultButton="true" LocalText=":3129920a94361beb_1:Login" Location="36,267" MaximumSize="16384,38" MinimumSize="38,38" Name="ConnectButton" ScrollExtent="100,38" Size="100,38" Style="/CommonElements.LargePushButton.data.style">:3129920a94361beb_1:Login</Button>
  26. <Button LocalText=":3129920acbc4d4cf:Exit" Location="138,267" MaximumSize="16384,38" MinimumSize="38,38" Name="QuitButton" ScrollExtent="100,38" Size="100,38" Style="/CommonElements.LargePushButton.data.style">:3129920acbc4d4cf:Exit</Button>
  27. <Page BackgroundOpacity="1.000" Location="26,36" Name="RoundedGrouper" RStyleDefault="/CommonElements.RoundedGrouper.data.rect" ScrollExtent="224,226" Size="224,226"/>
  28. <Page BackgroundOpacity="1.000" Location="250,69" Name="RoundedGrouper2" RStyleDefault="/CommonElements.RoundedGrouper.data.rect" ScrollExtent="252,237" Size="252,237"/>
  29. <Page BackgroundOpacity="1.000" Location="17,17" Name="InteriorGrouper" RStyleDefault="/WindowElements.InteriorGrouper.data.default_bkg.rect" ScrollExtent="492,303" Size="492,303">
  30. <Page BackgroundOpacity="1.000" Name="Frame" PackSize="a,a" PackSizeProp="0000/0001,0000/0001" RStyleDefault="/WindowElements.InteriorGrouper.data.frame.rect" ScrollExtent="492,303" Size="492,303"/>
  31. </Page>
  32.  
Jun 4 '07 #1
8 2400
Dököll
2,364 Expert 2GB
Hello, deaddog4201!

What type of GUI is used when the XML file is fired? In other words, what is the login form built from?

Looks like you should be able to change data from the XML file using the GUI, leaving the XML file unexposed.

Hopefully I understand what you are trying to achieve...
Jun 11 '07 #2
not sure what you mean by what type of GUI.... but the process is this the main exe is fired which then reads a ini file telling what ui to use then the ui xml files are loaded the first being the xml file i posted which is loginscene.xml. I made a windows form based program which encrypts and decrypts the data i need and then fires the main .exe and all works however this still leaves the data in the xml file exposed till the program I made is closed which will then re encrypt the needed data on closeing. The encryption code is below. The main thing i need to do here now i guess is some how pass the unencrypted data to the loginscene.xml form without actually writing it the text file or to have the loginscene.xml just decrypt the element on the fly and hold it in memory then dump it on succesful login. Im not sure how i would implement the decrypt part of the code into the actual loginscene.xml file in order for it to decrypt on the fly.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Encrypt(ByVal args() As String)
  2.  
  3.         Dim xmldoc As New XmlDocument()
  4.         Try
  5.             xmldoc.Load("LoginControl.xml")
  6.         Catch ex As Exception
  7.             MessageBox.Show("Error Loading file" & ex.Message & vbCrLf & ex.StackTrace)
  8.  
  9.         End Try
  10.  
  11.         ' Create a new TripleDES object, TripleDes will be the algorithm used to encrypt the XML data 
  12.         Dim sharedkey As New TripleDESCryptoServiceProvider()
  13.  
  14.         ''Save this key to disk to enable the recipient to decrypt
  15.         Dim writer2 As IO.StreamWriter = New IO.StreamWriter("SharedTDESKey.txt")
  16.         Dim str As String = Convert.ToBase64String(sharedkey.Key)
  17.         writer2.WriteLine(str)
  18.         writer2.Close()
  19.  
  20.         'Create a new EncryptedXML object
  21.         Dim exml As EncryptedXml = New EncryptedXml(xmldoc)
  22.  
  23.         'Select the PASSWORD element to be encrypted
  24.         Dim PASSWORDElem As XmlElement = CType(xmldoc.SelectSingleNode("Accounts/Account/PASSWORD"), XmlElement)
  25.  
  26.         'Encrypt the PASSWORD element data using the TripleDES alogrithm, save the results into a byte array
  27.  
  28.         Dim encryptedPASSWORD As Byte() = exml.EncryptData(PASSWORDElem, sharedkey, False)
  29.  
  30.         ' Create an EncryptedData object and populate it.
  31.         Dim ed As New EncryptedData()
  32.  
  33.         ' Specify the namespace URI for XML encryption elements.
  34.         ed.Type = EncryptedXml.XmlEncElementUrl
  35.  
  36.         ' Specify the namespace URI for the TrippleDES algorithm.
  37.         ed.EncryptionMethod = New EncryptionMethod(EncryptedXml.XmlEncTripleDESUrl)
  38.  
  39.  
  40.         ' Create a CipherData element.
  41.         ed.CipherData = New CipherData()
  42.  
  43.         ' Set the CipherData element to the value of the encrypted XML element.
  44.         ed.CipherData.CipherValue = encryptedPASSWORD
  45.  
  46.  
  47.         ' Replace the plaintext XML elemnt with an EncryptedData element.
  48.         EncryptedXml.ReplaceElement(PASSWORDElem, ed, False)
  49.  
  50.         'Write the encrypted data to disk
  51.         Try
  52.             xmldoc.Save("LoginControl.xml")
  53.  
  54.         Catch ex As Exception
  55.             MessageBox.Show("Error Saving file" & ex.Message & vbCrLf & ex.StackTrace)
  56.         End Try
  57.  
  58.     End Sub
  59.  
Expand|Select|Wrap|Line Numbers
  1. Private Sub Decrypt(ByVal args() As String)
  2.  
  3.         Dim sharedkey As New TripleDESCryptoServiceProvider()
  4.  
  5.         Dim reader As IO.StreamReader = New IO.StreamReader("sharedTDESkey.txt")
  6.         Dim data() As Byte = Convert.FromBase64String(reader.ReadToEnd)
  7.         'Assign the retrieved shared key value to the TripleDESCryptoServiceProvider object
  8.         sharedkey.Key = data
  9.  
  10.         Dim encryptedDoc As New XmlDocument()
  11.         encryptedDoc.Load("LoginControl.xml")
  12.  
  13.         ' XmlElement object.
  14.         Dim encryptedElement As XmlElement = CType(encryptedDoc.GetElementsByTagName("EncryptedData")(0), XmlElement)
  15.  
  16.         ' Create an EncryptedData object and populate it.
  17.         Dim ed2 As New EncryptedData()
  18.         ed2.LoadXml(encryptedElement)
  19.  
  20.         ' Create a new EncryptedXml object.
  21.         Dim exml2 As New EncryptedXml()
  22.  
  23.         ' Decrypt the element using the shared key
  24.         Dim decryptedPASSWORD As Byte() = exml2.DecryptData(ed2, sharedkey)
  25.  
  26.         ' Replace the encryptedData element with the plaintext XML element.
  27.         exml2.ReplaceData(encryptedElement, decryptedPASSWORD)
  28.         encryptedDoc.Save("LoginControl.xml")
  29.  
  30.     End Sub
  31.  
Jun 23 '07 #3
Dököll
2,364 Expert 2GB
You answered the question quite well, I did want to know whether you are using a graphical user interface such as VB to read the xml file.

Please give me some time to absorb this and will let you know.

Thanks for your reply!
Jun 23 '07 #4
Dököll
2,364 Expert 2GB
You answered the question quite well, I did want to know whether you are using a graphical user interface such as VB to read the xml file.

Please give me some time to absorb this and will let you know.

Thanks for your reply!
I think you will find a way to encrypt using VB through this forum. I'll have a look now and then for an option meanwhile.

In a bit!
Jul 4 '07 #5
Ok to update I have finished the vb end of my app it loads lets the user edit and save the xml data file and also encrypts the password element of the file. What i need from here is to have the code below changed to handle my xml data file instead of the original one and also to handle the decryption of the password element. And also to have the data automaticly loaded into the textboxes which would eliminate the need for the window on the right side described below in the original code

The code below will load when the game .exe is started. Loading a window with a split screen. On the left are typical login fields, Username,Password,Server,Character. On the right is the loaded data from the include file in the code EQ2LoginData.xml when data in the right side is clicked on it will populate the approppiate textbox on the left side.
Original code looks like this

LoginScene.xml

Expand|Select|Wrap|Line Numbers
  1. <Page IgnoreTab="false" Location="310,210" Name="WindowPage" PackLocation="center,center" PackLocationProp="-202/0001,-174/0001" ScrollExtent="524,374" Size="524,374">
  2. <Scrollbar ArrowPressSound="sounds/button" Control="CharacterSelect" HideIfUnnecessary="true" Location="473,75" MaximumSize="22,16384" MinimumSize="22,60" Name="Scroll" PackLocation="right,top" PackLocationProp="-051/0001,0075/0001" PackSize="f,a" PackSizeProp="0002/0003,0148/0001" ScrollExtent="22,226" Size="22,226" Style="/CommonElements.ScrollbarVertical.data.style"/>
  3. <Listbox BackgroundColor="#FFFFFF" DataSource="LoginControl" LocalTooltip="Click to select, double-click to login" Location="260,77" Margin="10,10,10,10" Name="CharacterSelect" OnDblCLick="Parent.AutoplayChar.Text=SelectedItem.Character
  4. Parent.AutoplayWorld.Text=SelectedItem.Server
  5. Parent.Username.Text=SelectedItem.Username
  6. Parent.Password.Text=SelectedItem.Password
  7. Parent.ConnectButton.Press=true" OnSelect="Parent.AutoplayChar.Text=SelectedItem.Character
  8. Parent.AutoplayWorld.Text=SelectedItem.Server
  9. Parent.Username.Text=SelectedItem.Username
  10. Parent.Password.Text=SelectedItem.Password" PackSize="a,a" PackSizeProp="0290/0001,0153/0001" RowTemplate="CharacterSelect_template" ScrollExtent="320,221" Size="234,221" Style="/CommonElements.Listbox.data.listbox_style" Tooltip="Click to select, double-click to login"/>
  11. <Text Font="/TextStyles.Normal.NormalStyle" LocalText="Select Character below or enter login data manually on the left:" Location="260,38" Name="SelectChar" ScrollExtent="222,33" Size="222,33" TextAlignmentVertical="Center" TextColor="#F2EFE1">Select Character below or enter login data manually on the left:</Text>
  12. <Button LocalText="Clear All" Location="41,224" MaximumSize="16384,26" MinimumSize="26,26" Name="ClearAllBtn" OnPress="Parent.Username.Text=&apos;&apos; Parent.Password.Text=&apos;&apos; Parent.AutoplayChar.Text=&apos;&apos; Parent.AutoplayWorld.Text=&apos;&apos;" ScrollExtent="69,26" Size="69,26" Style="/CommonElements.SmallPushButton.data.style">Clear All</Button>
  13. <Button LocalText="Clear Character/Server" LocalTooltip="Clears character and server choice so you can login to character select/create screen" Location="110,224" MaximumSize="16384,26" MinimumSize="26,26" Name="ClearCSBtn" OnPress="Parent.AutoplayChar.Text=&apos;&apos; Parent.AutoplayWorld.Text=&apos;&apos;" ScrollExtent="126,26" Size="126,26" Style="/CommonElements.SmallPushButton.data.style" Tooltip="Clears character and server choice so you can login to character select/create screen">Clear Character/Server</Button>
  14. <include>EQ2LoginData.xml</include>
  15. <Template Name="CharacterSelect_template" Size="320,20">EQ2LoginData_RowTemplate.xml</Template>
  16. <Text Font="/TextStyles.VeryLarge.VeryLargeStyle" LocalText="Login" Location="41,53" Name="Login" ScrollExtent="192,30" Size="192,30" TextAlignment="Center" TextAlignmentVertical="Center" TextColor="#F2EFE1">:3129920a94361beb:Login</Text>
  17. <Text1 Font="/TextStyles.Normal.NormalStyle" LocalText="Username" Location="19,95" Name="UsernameLabel" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920afed79bde:Username</Text1>
  18. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,91" MaximumSize="16384,30" MinimumSize="30,30" Name="Username" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  19. <Text2 Font="/TextStyles.Normal.NormalStyle" LocalText="Password" Location="19,128" Name="PasswordLabel" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920a334bdb7c:Password</Text2>
  20. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,123" MaximumSize="16384,30" MinimumSize="30,30" Name="Password" Password="true" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  21. <Text3 Font="/TextStyles.Normal.NormalStyle" LocalText="Character" Location="19,159" Name="AutoplayCharLabel" OnHide="Visible=True" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920aee74cd68:Character</Text3>
  22. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,155" MaximumSize="16384,30" MinimumSize="30,30" Name="AutoplayChar" OnHide="Visible=True" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  23. <Text4 Font="/TextStyles.Normal.NormalStyle" LocalText="Server" Location="19,194" Name="AutoplayWorldLabel" OnHide="Visible=True" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920a0449c1b8:Server</Text4>
  24. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,189" MaximumSize="16384,30" MinimumSize="30,30" Name="AutoplayWorld" OnHide="Visible=True" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  25. <Button IsDefaultButton="true" LocalText="Login" Location="36,267" MaximumSize="16384,38" MinimumSize="38,38" Name="ConnectButton" ScrollExtent="100,38" Size="100,38" Style="/CommonElements.LargePushButton.data.style">:3129920a94361beb_1:Login</Button>
  26. <Button LocalText="Exit" Location="138,267" MaximumSize="16384,38" MinimumSize="38,38" Name="QuitButton" ScrollExtent="100,38" Size="100,38" Style="/CommonElements.LargePushButton.data.style">:3129920acbc4d4cf:Exit</Button>
  27. <Page BackgroundOpacity="1.000" Location="26,36" Name="RoundedGrouper" RStyleDefault="/CommonElements.RoundedGrouper.data.rect" ScrollExtent="224,226" Size="224,226"/>
  28. <Page BackgroundOpacity="1.000" Location="250,69" Name="RoundedGrouper2" RStyleDefault="/CommonElements.RoundedGrouper.data.rect" ScrollExtent="252,237" Size="252,237"/>
  29. <Page BackgroundOpacity="1.000" Location="17,17" Name="InteriorGrouper" RStyleDefault="/WindowElements.InteriorGrouper.data.default_bkg.rect" ScrollExtent="492,303" Size="492,303">
  30. <Page BackgroundOpacity="1.000" Name="Frame" PackSize="a,a" PackSizeProp="0000/0001,0000/0001" RStyleDefault="/WindowElements.InteriorGrouper.data.frame.rect" ScrollExtent="492,303" Size="492,303"/>
  31. </Page>
  32. <Page BackgroundOpacity="1.000" Name="DialogFrame" RStyleDefault="/WindowElements.DialogFrame.data.frame.rect" ScrollExtent="524,337" Size="524,337"/>
  33. </Page>
  34. </Page>
  35.  
The two include files this code refers to originally looked like this!
EQ2LoginData.xml
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <DataSource Name="CharacterData">
  3. <Data username="YOURUSERHERE" password="YOURPASSWORDHERE" Name="YOURCHARACTERHERE" server="YOURSERVERHERE" />
  4. </DataSource>
  5.  
EQ2LoginData_RowTemplate.xml
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Page Name="dropdown_template" ScrollExtent="315,24" Size="315,24" Visible="false">
  3. <Text Font="/Fonts.FontArial14" Location="5,0" Margin="1,1,1,1" Name="TextLine" ScrollExtent="315,24" Size="315,24" TextColor="#FBF1D9">$Name$ on $server$ ($username$)</Text>
  4. </Page>
  5.  
The new encrypted file created from my app to replace "ProfitUI_LoginData.xml" looks like this.

EQ2LoginData.xml
"When Encrypted"
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <!DOCTYPE EQ2Accounts SYSTEM "EQ2LoginData.dtd>
  3. <?xml-stylesheet type="text/xsl" href="EQ2LoginData.xsl"?>
  4. <!-- *********** Accounts for EQ2 *********** -->
  5. <EQ2Accounts>
  6.   <EQ2Account EQ2AccountID="SAmeIdAsUserNAme">
  7.     <Username>YOURUSERNAMEHERE</Username>
  8.     <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
  9.       <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
  10.       <CipherData>
  11.         <CipherValue>6McZUG6yyXCb/wpHmsWm03MoBlkNWfj3H0md4up72yLnpZhejNnotslhNdj9Uu3z8Q1RL0KIWadxNsY55mZusB/kPO4AOsMemXSH57KKlQ8</CipherValue>
  12.       </CipherData>
  13.     </EncryptedData>
  14.     <Server>YOURSERVERHERE</Server>
  15.     <Character>YOURCHARACTERHERE</Character>    
  16.   </EQ2Account>
  17. </EQ2Accounts>
  18.  
"When Not Encrypted"

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <!DOCTYPE EQ2Accounts SYSTEM "EQ2LoginData.dtd>
  3. <?xml-stylesheet type="text/xsl" href="EQ2LoginData.xsl"?>
  4. <!-- *********** Accounts for EQ2 *********** -->
  5. <EQ2Accounts>
  6.   <EQ2Account EQ2AccountID="SAmeIdAsUserNAme">
  7.     <Username>YOURUSERNAMEHERE</Username>
  8.     <Password>YOURPASSWORDHERE</Password>
  9.     <Server>YOURSERVERHERE</Server>
  10.     <Character>YOURCHARACTERHERE</Character>    
  11.   </EQ2Account>
  12. </EQ2Accounts>
  13.  
EQ2LoginData.dtd

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-16LE"?>
  2. <!ELEMENT Username (#PCDATA)>
  3. <!ELEMENT EncryptionMethod EMPTY>
  4. <!ATTLIST EncryptionMethod Algorithm CDATA #REQUIRED>
  5. <!ELEMENT CipherValue (#PCDATA)>
  6. <!ELEMENT CipherData (CipherValue)>
  7. <!ELEMENT EncryptedData (EncryptionMethod,CipherData)>
  8. <!ATTLIST EncryptedData 
  9.     Type CDATA #REQUIRED
  10.     xmlns CDATA #REQUIRED>
  11. <!ELEMENT Server (#PCDATA)>
  12. <!ELEMENT Character (#PCDATA)>
  13. <!ELEMENT EQ2Account (Username,EncryptedData,Server,Character)>
  14. <!ATTLIST EQ2Account EQ2AccountID ID #REQUIRED>
  15. <!ELEMENT EQ2Accounts (EQ2Account)+>
  16.  
Not sure if the dtd file would be needed or useful at this point but its used in my apps end of handling the xml file so i included it here just in case! One problem with the dtd file is after decryption it breaks it! That doesnt effect my app because it doesnt handle the decryption and the actual decryption procedure doesnt use the dtd file in anyway so unless its pointed to use the dtd in a procedure someone comes up with if any it could break it there.

The procedure to decrypt the password element is

Expand|Select|Wrap|Line Numbers
  1.         Dim sharedkey As New TripleDESCryptoServiceProvider()
  2.  
  3.         Dim reader As IO.StreamReader = New IO.StreamReader("sharedTDESkey.txt")
  4.         Dim data() As Byte = Convert.FromBase64String(reader.ReadToEnd)
  5.         'Assign the retrieved shared key value to the TripleDESCryptoServiceProvider object
  6.         sharedkey.Key = data
  7.  
  8.         Dim encryptedDoc As New System.Xml.XmlDocument()
  9.         encryptedDoc.Load("EQ2LoginData.xml")
  10.  
  11.         ' XmlElement object.
  12.         Dim encryptedElement As System.Xml.XmlElement = CType(encryptedDoc.GetElementsByTagName("EncryptedData")(0), XmlElement)
  13.  
  14.         ' Create an EncryptedData object and populate it.
  15.         Dim ed2 As New EncryptedData()
  16.         ed2.LoadXml(encryptedElement)
  17.  
  18.         ' Create a new EncryptedXml object.
  19.         Dim exml2 As New EncryptedXml()
  20.  
  21.         ' Decrypt the element using the shared key
  22.         Dim decryptedPASSWORD As Byte() = exml2.DecryptData(ed2, sharedkey)
  23.  
  24.         ' Replace the encryptedData element with the plaintext XML element.
  25.         exml2.ReplaceData(encryptedElement, decryptedPASSWORD)
  26.         encryptedDoc.Save("EQ2LoginDataDecrypted.xml")
  27.  
Notice at the end of the above code will save the results to an xml doc which is actually something we dont want so that needs to be changed.
And vb will not be handleing anything after the file is encrypted the game will be handeling everything! The game is pretty robust though and handles alot of different xml variables so im sure theres a way to code this! One problem is the decryption procedure is in vb and i dont know how to write that into an xml file
like above or how to rewrite the procedure to fit into the LoginScene.xml file.
I kind of have an idea how to get it to read and at least acknowledge my xml file but it doesnt load. Even changeing it to just get my file loaded unencrypted would be progress. in other words completely leave out the encryption part for the time being.

What i started without the encryption part but doesnt work!

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Page IgnoreTab="false" Location="310,210" Name="WindowPage" PackLocation="center,center" PackLocationProp="-202/0001,-174/0001" ScrollExtent="524,374" Size="524,374">
  3. <Scrollbar ArrowPressSound="sounds/button" Control="CharacterSelect" HideIfUnnecessary="true" Location="473,75" MaximumSize="22,16384" MinimumSize="22,60" Name="Scroll" PackLocation="right,top" PackLocationProp="-051/0001,0075/0001" PackSize="f,a" PackSizeProp="0002/0003,0148/0001" ScrollExtent="22,226" Size="22,226" Style="/CommonElements.ScrollbarVertical.data.style"/>
  4. <Listbox BackgroundColor="#FFFFFF" DataSource="EQ2AccountID" LocalTooltip="Click to select, double-click to login" Location="260,77" Margin="10,10,10,10" Name="CharacterSelect" OnLoad="Parent.AutoplayChar.Text=SelectedItem.Character
  5. Parent.AutoplayWorld.Text=EQ2Accounts.EQ2Account.Server
  6. Parent.Username.Text=EQ2Accounts.EQ2Account.Username
  7. Parent.Password.Text=EQ2Accounts.EQ2Account.Password
  8. Parent.ConnectButton.Press=true" OnShow="Parent.AutoplayChar.Text=EQ2Accounts.EQ2Account.Character
  9. Parent.AutoplayWorld.Text=EQ2Accounts.EQ2Account.Server
  10. Parent.Username.Text=EQ2Accounts.EQ2Account.Username
  11. Parent.Password.Text=EQ2Accounts.EQ2Account.Password" PackSize="a,a" PackSizeProp="0290/0001,0153/0001" RowTemplate="CharacterSelect_template" ScrollExtent="320,221" Size="234,221" Style="/CommonElements.Listbox.data.listbox_style" Tooltip="Click to select, double-click to login"/>
  12. <Text Font="/TextStyles.Normal.NormalStyle" LocalText="Select Character below or enter login data manually on the left:" Location="260,38" Name="SelectChar" ScrollExtent="222,33" Size="222,33" TextAlignmentVertical="Center" TextColor="#F2EFE1">Select Character below or enter login data manually on the left:</Text>
  13. <Button LocalText="Clear All" Location="41,224" MaximumSize="16384,26" MinimumSize="26,26" Name="ClearAllBtn" OnPress="Parent.Username.Text=&apos;&apos; Parent.Password.Text=&apos;&apos; Parent.AutoplayChar.Text=&apos;&apos; Parent.AutoplayWorld.Text=&apos;&apos;" ScrollExtent="69,26" Size="69,26" Style="/CommonElements.SmallPushButton.data.style">Clear All</Button>
  14. <Button LocalText="Clear Character/Server" LocalTooltip="Clears character and server choice so you can login to character select/create screen" Location="110,224" MaximumSize="16384,26" MinimumSize="26,26" Name="ClearCSBtn" OnPress="Parent.AutoplayChar.Text=&apos;&apos; Parent.AutoplayWorld.Text=&apos;&apos;" ScrollExtent="126,26" Size="126,26" Style="/CommonElements.SmallPushButton.data.style" Tooltip="Clears character and server choice so you can login to character select/create screen">Clear Character/Server</Button>
  15. <include>EQ2LoginData.xml</include>
  16. <Text Font="/TextStyles.VeryLarge.VeryLargeStyle" LocalText="Login" Location="41,53" Name="Login" ScrollExtent="192,30" Size="192,30" TextAlignment="Center" TextAlignmentVertical="Center" TextColor="#F2EFE1">:3129920a94361beb:Login</Text>
  17. <Text1 Font="/TextStyles.Normal.NormalStyle" LocalText="Username" Location="19,95" Name="UsernameLabel" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920afed79bde:Username</Text1>
  18. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,91" MaximumSize="16384,30" MinimumSize="30,30" Name="Username" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  19. <Text2 Font="/TextStyles.Normal.NormalStyle" LocalText="Password" Location="19,128" Name="PasswordLabel" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920a334bdb7c:Password</Text2>
  20. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,123" MaximumSize="16384,30" MinimumSize="30,30" Name="Password" Password="true" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  21. <Text3 Font="/TextStyles.Normal.NormalStyle" LocalText="Character" Location="19,159" Name="AutoplayCharLabel" OnHide="Visible=True" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920aee74cd68:Character</Text3>
  22. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,155" MaximumSize="16384,30" MinimumSize="30,30" Name="AutoplayChar" OnHide="Visible=True" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  23. <Text4 Font="/TextStyles.Normal.NormalStyle" LocalText="Server" Location="19,194" Name="AutoplayWorldLabel" OnHide="Visible=True" ScrollExtent="80,19" Size="80,19" TextAlignment="Right" TextAlignmentVertical="Center" TextColor="#F0D080">:3129920a0449c1b8:Server</Text4>
  24. <Textbox BackgroundColor="#FFFFFF" BackgroundOpacity="1.000" Cursor="/Cursor.Text" Location="108,189" MaximumSize="16384,30" MinimumSize="30,30" Name="AutoplayWorld" OnHide="Visible=True" RStyleActivated="/CommonElements.Textfield.data.selected.rect" RStyleDefault="/CommonElements.Textfield.data.default.rect" RStyleDisabled="/CommonElements.Textfield.data.disabled.rect" RStyleDisabledActivated="/CommonElements.Textfield.data.disabled.rect" RStyleMouseOver="/CommonElements.Textfield.data.mouseover.rect" RStyleMouseOverActivated="/CommonElements.Textfield.data.selected.rect" RStyleMouseOverSelected="/CommonElements.Textfield.data.selected.rect" RStyleSelected="/CommonElements.Textfield.data.selected.rect" ScrollExtent="129,30" Size="129,30" Style="/CommonElements.Textfield.data.style" />
  25. <Button IsDefaultButton="true" LocalText="Login" Location="36,267" MaximumSize="16384,38" MinimumSize="38,38" Name="ConnectButton" ScrollExtent="100,38" Size="100,38" Style="/CommonElements.LargePushButton.data.style">:3129920a94361beb_1:Login</Button>
  26. <Button LocalText="Exit" Location="138,267" MaximumSize="16384,38" MinimumSize="38,38" Name="QuitButton" ScrollExtent="100,38" Size="100,38" Style="/CommonElements.LargePushButton.data.style">:3129920acbc4d4cf:Exit</Button>
  27. <Page BackgroundOpacity="1.000" Location="26,36" Name="RoundedGrouper" RStyleDefault="/CommonElements.RoundedGrouper.data.rect" ScrollExtent="224,226" Size="224,226"/>
  28. <Page BackgroundOpacity="1.000" Location="250,69" Name="RoundedGrouper2" RStyleDefault="/CommonElements.RoundedGrouper.data.rect" ScrollExtent="252,237" Size="252,237"/>
  29. <Page BackgroundOpacity="1.000" Location="17,17" Name="InteriorGrouper" RStyleDefault="/WindowElements.InteriorGrouper.data.default_bkg.rect" ScrollExtent="492,303" Size="492,303">
  30. <Page BackgroundOpacity="1.000" Name="Frame" PackSize="a,a" PackSizeProp="0000/0001,0000/0001" RStyleDefault="/WindowElements.InteriorGrouper.data.frame.rect" ScrollExtent="492,303" Size="492,303"/>
  31. </Page>
  32. <Page BackgroundOpacity="1.000" Name="DialogFrame" RStyleDefault="/WindowElements.DialogFrame.data.frame.rect" ScrollExtent="524,337" Size="524,337"/>
  33. </Page>
  34. </Page>
  35. </Page>
  36.  
Ive got so close to getting all this to work as a whole seems like ive hit a brick wall. Dont know how else or what better i could do to describe waht im trying to accomplish but if theres anything let me know!
Any help, examples or even style anything i can use to do this is appreciated!
Jul 5 '07 #6
Well I made some progress on my own maybe i can get help from this!
Useing xsl style sheet i was able to convert an unencrypted version of my apps xml file to the need format for the loginscene.xml so form there im trying to use the xslt function ability to call the decryption method and apply the results as the needed out put decrypted password hers the code i got so far. I dont get any errors just a blank "" for the password!

This is the code i came up with

Expand|Select|Wrap|Line Numbers
  1. <?xml version='1.0' ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:result="http://saxon.sf.net/xquery-results" extension-element-prefixes="result" version="1.0" xmlns:a="http://www.w3.org/2001/04/xmlenc#">
  3.     <xsl:output method="xml" encoding="UTF-8"/>
  4.     <lxslt:script language="VBScript" implements-prefix="xmlenc#">                
  5.                 Function Decrypt(ByVal args() As String)
  6.  
  7.         Dim sharedkey As New TripleDESCryptoServiceProvider()
  8.  
  9.         Dim reader As IO.StreamReader = New IO.StreamReader("sharedTDESkey.txt")
  10.         Dim data() As Byte = Convert.FromBase64String(reader.ReadToEnd)
  11.         'Assign the retrieved shared key value to the TripleDESCryptoServiceProvider object
  12.         sharedkey.Key = data
  13.  
  14.         Dim encryptedDoc As New XmlDocument()
  15.         encryptedDoc.Load("EQ2LoginData.xml")
  16.  
  17.         ' XmlElement object.
  18.         Dim encryptedElement As XmlElement = CType(encryptedDoc.GetElementsByTagName("EncryptedData")(0), XmlElement)
  19.  
  20.         ' Create an EncryptedData object and populate it.
  21.         Dim ed2 As New EncryptedData()
  22.         ed2.LoadXml(encryptedElement)
  23.  
  24.         ' Create a new EncryptedXml object.
  25.         Dim exml2 As New EncryptedXml()
  26.  
  27.         ' Decrypt the element using the shared key
  28.         Dim decryptedPASSWORD As Byte() = exml2.DecryptData(ed2, sharedkey)
  29.  
  30.         ' Replace the encryptedData element with the plaintext XML element.
  31.         exml2.ReplaceData(encryptedElement, decryptedPASSWORD)        
  32.                 End Function
  33.                 </lxslt:script>
  34.     <xsl:template match="/">
  35.         <DataSource Name="CharacterData">
  36.             <Data>                
  37.                 <xsl:attribute name="Name">
  38.                     <xsl:value-of select="EQ2Accounts/EQ2Account/@EQ2AccountID"/>
  39.                 </xsl:attribute>
  40.                 <xsl:attribute name="password">
  41.                     <xsl:value-of select="decryptedPASSWORD"/>
  42.                 </xsl:attribute>
  43.                 <xsl:attribute name="server">
  44.                     <xsl:value-of select="EQ2Accounts/EQ2Account/Server"/>
  45.                 </xsl:attribute>
  46.                 <xsl:attribute name="username">
  47.                     <xsl:value-of select="EQ2Accounts/EQ2Account/Character"/>
  48.                 </xsl:attribute>                
  49.             </Data>
  50.         </DataSource>
  51.     </xsl:template>
  52.     <xsl:template match="Username"/>
  53.     <xsl:template match="Password"/>
  54.     <xsl:template match="Server"/>
  55.     <xsl:template match="Character"/>
  56. </xsl:stylesheet>
  57.  
heres the results

Expand|Select|Wrap|Line Numbers
  1. <DataSource Name="CharacterData" xmlns:a="http://www.w3.org/2001/04/xmlenc#" xmlns:lxslt="http://xml.apache.org/xslt"><Data Name="Myusername" username="MYcharacter" server="Myserver" password=""/></DataSource>
  2.  
One other thing im trying to figure out is i added auto="" as an id to the first line of my xml like this
<EQ2Account EQ2AccountID="MynameID" Auto="0">
where the value of Auto is either 0 or 1. 0 false 1 true
only 1 element should be allowed to have a value of 1 all else 0 so i want the above code to only pull the account with the Auto value of 1 as of right now the code pulls the first element in "EQ2Accounts/EQ2Account/@EQ2AccountID"
i can add @Auto but that wont refrence to the value of 1 and if i add ="1" it breaks.
Anyone even care to comment at all!
Jul 16 '07 #7
Dököll
2,364 Expert 2GB
I am going to take it over to the XML Forum therefore so we can continue. You will need to work with me okay!
Jul 17 '07 #8
Dököll
2,364 Expert 2GB
Hello, again deaddog4201!

There is some information in here:

http://www.ibm.com/developerworks/xm...ary/x-encrypt/

And here:

http://www.w3.org/TR/xmlenc-core/#sec-Processing-XML

Leaving for work now. I'll look into it further later. Please stay tuned. and great work getting the VB portion to work.
Jul 17 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

34
by: Blake T. Garretson | last post by:
I want to save some sensitive data (passwords, PIN numbers, etc.) to disk in a secure manner in one of my programs. What is the easiest/best way to accomplish strong file encryption in Python? ...
1
by: Cliff | last post by:
We are trying to connect to 3 different Oracle databases using MS Access as the front-end and ODBC as the connection. The problem that we are having is that 1 of the databases requires a...
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...
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...
7
by: Alan Silver | last post by:
Hello, I am writing a page where sensitive data is collected (over SSL) and stored in a database. I have been looking at the .NET encryption classes, but am a bit confused as to which is best...
3
by: Chuck P | last post by:
I need to deploy and asp.net 2.0 application that has dpapi/machine encrypted connection strings. I tried using the VS Build Publish menu selection and then putting the encryption in the...
4
by: pintu | last post by:
Hello everybody.. I hav some confusion regarding asymmetric encryption.As asymmetric encryption it there is one private key and one public key.So any data is encrypted using private key and the...
11
by: John Williams | last post by:
I've written a simple program to do XOR encryption as my first foray into understanding how encryption works. The code compiles fine, however it segmentation faults on every run. using gdb to...
22
by: j1mb0jay | last post by:
I have had to create a simple string encryption program for coursework, I have completed the task and now have to do a write up on how it could be improved at a later date. If you could look...
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...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.