Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
C# Best way to encrypt & decrypt xmlwriter file
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="BIOS" data-source="post: 467698" data-attributes="member: 15674"><p>You seem to confuse terminology around encryption and hashing. MD5 is not a form of encryption, but an hash function (and a broken one at that) - the key differentiator to note here is an hash is not reversible and as such you cannot "decrypt" data which has been hashed. But you can decrypt an encrypted message, provided you have the key.</p><p></p><p>It's important to understand whether it is truly what you want to do, what are you trying to achieve by encrypting the XML files? If you are storing the key material on the same system as the files, encryption likely won't be any use here.</p><p></p><p>Anyhow, if you still want to do this you probably want to use symmetric key encryption. You can encrypt specific fields of an XML file, see examples: <a href="https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.xml.encryptedxml?view=dotnet-plat-ext-5.0" target="_blank">docs.microsoft.com</a>. Switch out TripleDESCryptoServiceProvider with <a href="https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.aescryptoserviceprovider?view=net-5.0" target="_blank">AesCryptoServiceProvider</a> though, and I'd recommend using AES256 as the algorithm.</p></blockquote><p></p>
[QUOTE="BIOS, post: 467698, member: 15674"] You seem to confuse terminology around encryption and hashing. MD5 is not a form of encryption, but an hash function (and a broken one at that) - the key differentiator to note here is an hash is not reversible and as such you cannot "decrypt" data which has been hashed. But you can decrypt an encrypted message, provided you have the key. It's important to understand whether it is truly what you want to do, what are you trying to achieve by encrypting the XML files? If you are storing the key material on the same system as the files, encryption likely won't be any use here. Anyhow, if you still want to do this you probably want to use symmetric key encryption. You can encrypt specific fields of an XML file, see examples: [URL='https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.xml.encryptedxml?view=dotnet-plat-ext-5.0']docs.microsoft.com[/URL]. Switch out TripleDESCryptoServiceProvider with [URL='https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.aescryptoserviceprovider?view=net-5.0']AesCryptoServiceProvider[/URL] though, and I'd recommend using AES256 as the algorithm. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
C# Best way to encrypt & decrypt xmlwriter file
Top