CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Set Password

  1. #1
    Join Date
    Mar 2002
    Posts
    50

    Set Password

    Hi

    Can we set password to XML File as we can set password to database?

    Thanks in advance

    Nit

  2. #2
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346

    ??????????????????????

    what are you asking?
    do you wish to restrict access to an xml file so that not just anyone can open it and start typing away? be a little more specific please, and you'll get more responses.

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

  3. #3
    Join Date
    Mar 2002
    Posts
    50
    Yes I want to restrict access to an xml file so that not just anyone can open it and start typing away .

    I have a Security Database with a Single Table Users .Which contains Username and password for Admin and other users i want to replace the Users Table with an XML file Users.XML ,This Security.Mdb has a password can XMl file also have a Password to Open .
    Hope i am Clear

    Thanks

    Nit

  4. #4
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346
    This Security.Mdb has a password can XMl file also have a Password to Open .
    Not in the way you were hoping, no. XML files are little more than text files with a .xml extension (in fact that's all they are) they are opened with a normal text editor, so, unlike the security header information in .mdb files (opened by access), they open normally without requiring passwords by a program such as access. Basically you can protect the file from an outside source, many servers have security functions built in that you can put to use. Other things to look into would be encryption, if the xml files are to be interpreted by a program (i'll use C++ executable for example) they can be de-encrypted for use by the program. I like to use simple (however highly effective) encryption measures, usually XOR encryption works the best. With this, the xml file when opened will appear to be nothing more than gobely-gook, it won't be a valid xml file either (can't be interpreted by a web browser). However, the way that XOR encryption works, it can be de-encrypted when needed using the encryption key. So instead of requiring passwords which can be a hassle and have security holes, just encrypt it and it should serve your purposes well. To look up XOR encryprion, just google. If it's a web app their are other things you can do besides XOR, if it's a server side language look into MD5 encryption (which is theoretically uncrackable, as long as you don't leave the key out in the open). Either way, go with encryption, it's your best bet.

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured