473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ASPX login page and xml

EMW
Hi,

I am creating a login part on my page and I wanted to store the username and
password info in a xml file at the server.
But to make sure nobody but my program can read the xml file, I was thinking
of using some kind of encryption.

How can I do this?
Is there any known and easy way to do this?

rg,
Eric
Nov 18 '05 #1
2 1188
This article discusses ways of encrypting and decrypting an XML file:

http://www.fawcette.com/vsm/2003_03/...efault_pf.aspx
Dim filename As String = _
"c:\SymmetricExample.xml"

Dim FileWriter As FileStream = New _
FileStream(filename,FileMode.Create)

Dim CryptoWriter As CryptoStream = _
New CryptoStream(FileWriter, _
cryptoprovider.CreateEncryptor( _
key,iv), CryptoStreamMode.Write)

This code creates a stream for decrypting a file:

Dim filename As String = _
"c:\SymmetricExample.xml"

Dim FileReader As FileStream = New _
FileStream(filename, FileMode.Open)

Dim CryptoReader As CryptoStream = _
New CryptoStream(FileReader, _
cryptoprovider.CreateDecryptor( _
key,iv), CryptoStreamMode.Read)

Now that you have a stream for encrypting and decrypting data, you can feed
it into an XmlTextReader object for decrypting or an XmlTextWriter object
for encrypting:

Dim XmlDoc As XmlDocument

Dim XmlReader As XmlTextReader = New _
XmlTextReader(CryptoReader)

XmlDoc = New XmlDocument()

XmlDoc.Load(XmlReader)
"EMW" <SomeOne@MicroSoftdotCom> wrote in message
news:40**********************@dreader2.news.tiscal i.nl...
Hi,

I am creating a login part on my page and I wanted to store the username
and
password info in a xml file at the server.
But to make sure nobody but my program can read the xml file, I was
thinking
of using some kind of encryption.

How can I do this?
Is there any known and easy way to do this?

rg,
Eric


Nov 18 '05 #2
EMW
Thank you!!!

rg,
eric.

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> schreef in bericht
news:eM**************@TK2MSFTNGP10.phx.gbl...
This article discusses ways of encrypting and decrypting an XML file:

http://www.fawcette.com/vsm/2003_03/...efault_pf.aspx

Dim filename As String = _
"c:\SymmetricExample.xml"

Dim FileWriter As FileStream = New _
FileStream(filename,FileMode.Create)

Dim CryptoWriter As CryptoStream = _
New CryptoStream(FileWriter, _
cryptoprovider.CreateEncryptor( _
key,iv), CryptoStreamMode.Write)

This code creates a stream for decrypting a file:

Dim filename As String = _
"c:\SymmetricExample.xml"

Dim FileReader As FileStream = New _
FileStream(filename, FileMode.Open)

Dim CryptoReader As CryptoStream = _
New CryptoStream(FileReader, _
cryptoprovider.CreateDecryptor( _
key,iv), CryptoStreamMode.Read)

Now that you have a stream for encrypting and decrypting data, you can feed it into an XmlTextReader object for decrypting or an XmlTextWriter object
for encrypting:

Dim XmlDoc As XmlDocument

Dim XmlReader As XmlTextReader = New _
XmlTextReader(CryptoReader)

XmlDoc = New XmlDocument()

XmlDoc.Load(XmlReader)
"EMW" <SomeOne@MicroSoftdotCom> wrote in message
news:40**********************@dreader2.news.tiscal i.nl...
Hi,

I am creating a login part on my page and I wanted to store the username
and
password info in a xml file at the server.
But to make sure nobody but my program can read the xml file, I was
thinking
of using some kind of encryption.

How can I do this?
Is there any known and easy way to do this?

rg,
Eric

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Title: What are the Consequences of Aspx page separate from app DLL Hi JL; I am working on a big asp.net application. When we migrate the dll (or dlls) to the production server, all users who are...
7
by: Luboą ©lapák | last post by:
Hi, I have a login page and after click on button Login I check username and password and if it is correct, i want load page, which was there before Login page. How can I do it? In javascript it...
3
by: Tom | last post by:
Hi, I have an index.aspx page which includes top.aspx, left.aspx, main.aspx and bottom.aspx. In the left.aspx, there is a login web control - login.ascx. It keeps session of username and role...
1
by: | last post by:
Hi guys! I am a beginner with aspx (i have some background with .asp). And i am trying tu use a 'code-behind' page in order to execute all transactions in that page and leave as clean as possible...
6
by: John Lau | last post by:
Hi, I am looking at the MS KB Article 306355: HOW TO: Create Custom Error Reporting Pages in ASP.NET by Using Visual C# .NET This article describes how to redirect errors to a custom html...
2
by: Beginner | last post by:
I know this is an old question, but searching all over the internet plus several MS security conferences, still haven't got a straight anwser. Basically, the login.aspx is on one dedicated server...
2
by: Murphy | last post by:
Our website contains subdirectories for each subsidiary company, each company has it's own look and feel to the pages in their subdirectory although they are all part of the main website. The...
4
by: JIM.H. | last post by:
Hello, I have a logon.apsx page and when I clicked LogOff button, user is directed to this page. For the first login user is able to go to myApp.aspx through logon.aspx but once he/she logs of and...
1
by: frekster | last post by:
All, Windows xp pro box with vs 2003 and .net 1.1 installed. Downloaded a project from source safe via vpn to my ome pc to work from home. I have three other projects on my pc that works fine...
6
by: BizWorld | last post by:
Hi, I have a scenario where i need to configure only Login.aspx page to use SSL. All other application will run on HTTP protocol. If someone can guide me how to accomplish this. One of my idea...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.