I think this is because during encryption, I execute
And, during decryption, I also execute
[code]key = New RijndaelManaged()
How can I save the key from the encryption ?[code]key = New RijndaelManaged()
Thank you.
This is the code to encrypt and save the XML file:
This is the code to decrypt the XML file:
[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
' Create a new Rijndael key.
key = New RijndaelManaged()
' Load an XML document.
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Encrypt(xmlDoc, "myElement1", key)
Encrypt(xmlDoc, "myElement2", key)
xmlDoc.Save("myXMLFile.XML")
">
I think this is because during encryption, I execute
[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
key = New RijndaelManaged()
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Decrypt(xmlDoc, key)
And, during decryption, I also execute
[code]key = New RijndaelManaged()
How can I save the key from the encryption ?[code]key = New RijndaelManaged()
Thank you.
This is the code to encrypt and save the XML file:
This is the code to decrypt the XML file:
[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
' Create a new Rijndael key.
key = New RijndaelManaged()
' Load an XML document.
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Encrypt(xmlDoc, "myElement1", key)
Encrypt(xmlDoc, "myElement2", key)
xmlDoc.Save("myXMLFile.XML")
">
I think this is because during encryption, I execute
[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
key = New RijndaelManaged()
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Decrypt(xmlDoc, key)
And, during decryption, I also execute
[code]key = New RijndaelManaged()
How can I save the key from the encryption ?[code]key = New RijndaelManaged()
Thank you.
This is the code to encrypt and save the XML file:
This is the code to decrypt the XML file:
[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
' Create a new Rijndael key.
key = New RijndaelManaged()
' Load an XML document.
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Encrypt(xmlDoc, "myElement1", key)
Encrypt(xmlDoc, "myElement2", key)
xmlDoc.Save("myXMLFile.XML")
">
[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
key = New RijndaelManaged()
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Decrypt(xmlDoc, key)
[code]key = New RijndaelManaged()[/code]
And, during decryption, I also execute
[code]key = New RijndaelManaged()[/code]
How can I save the key from the encryption ?[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
' Create a new Rijndael key.
key = New RijndaelManaged()
' Load an XML document.
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Encrypt(xmlDoc, "myElement1", key)
Encrypt(xmlDoc, "myElement2", key)
xmlDoc.Save("myXMLFile.XML")[/code]
This is the code to decrypt the XML file:
[code]Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Dim key As RijndaelManaged = Nothing
key = New RijndaelManaged()
Dim xmlDoc As New XmlDocument()
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("myXMLFile.XML")
Decrypt(xmlDoc, key)[/code]
JLCPCB – Prototype 10 PCBs for $2 (For Any Color)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w