Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XML Serialization and Encryption

XML Serialization and Encryption

Scheduled Pinned Locked Moved XML / XSL
csharpsecurityxmljsontutorial
2 Posts 2 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I have objects that I want to save to a file (XML format, generated by serialization). I also want the data to be encrypted. Should I encrypt the objects before they are serialized/saved to XML, or should I serialize and then encrypt the whole XML document? Which method is easier/more efficient, and why? On a side note, where can I find a good, straight-forward tutorial for encryption using .NET (specifically, C#)? Thanks in advance.

    P 1 Reply Last reply
    0
    • L Lost User

      I have objects that I want to save to a file (XML format, generated by serialization). I also want the data to be encrypted. Should I encrypt the objects before they are serialized/saved to XML, or should I serialize and then encrypt the whole XML document? Which method is easier/more efficient, and why? On a side note, where can I find a good, straight-forward tutorial for encryption using .NET (specifically, C#)? Thanks in advance.

      P Offline
      P Offline
      Paul Ingles
      wrote on last edited by
      #2

      Traditionally its better to encrypt something that has little redundancy, i.e. with little repetition. This is often why text files are compressed before they are encrypted, then decrypted and decompressed at the other end. It's difficult to suggest something without a little more info about what it is you're trying to encrypt. Do you mean encrypt individual members of a type, like a string field containing a name or something? For ease its probably better to just encrypt the XML document, if you want to you could always find some .NET code to compress the document beforehand and then encrypt that. -- Paul "I need the secure packaging of Jockeys. My boys need a house!" - Kramer, in "The Chinese Woman" episode of Seinfeld MS Messenger: paul@oobaloo.co.uk Sonork: 100.22446

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups