Click to See Complete Forum and Search --> : Set Password


nit
September 18th, 2002, 12:13 AM
Hi

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

Thanks in advance

Nit

Waldo2k2
September 18th, 2002, 09:01 PM
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.

nit
September 18th, 2002, 11:08 PM
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

Waldo2k2
September 19th, 2002, 11:23 AM
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 (www.google.com). 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.