473,396 Members | 2,037 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.

Check Network Password

Hi all,
For example you have 2 text boxes:
tbxUsername = Environment.UserName.ToString
tbxPassword = ********

How do you check if the password entered by the user matches the same
network(windows) password of ther user?

Thanks,
Henry :)

Nov 21 '05 #1
9 1930
You use LoginUser API, but it fails in Windows 2000 because you need
SE_TCB_NAME (act as part of the operating system) set. It's the $64, 000
question on how to set this because Windows 2000 security would be pointless

If you use XP then you are ok because the fuction succeeds

Remember to use Zero Memory to clear the password from memory afterwards

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #2
"Crouchie1998" <cr**********@spamcop.net> schrieb:
Remember to use Zero Memory to clear the password from memory afterwards


I wouldn't recommend that because the runtime can move the string object in
its lifetime before calling 'ZeroMemory' and thus still parts/copies of the
string's data can exist in memory. .NET 2.0 will contain a 'SecureString'
class which won't suffer from this problem:

'SecureString' Class ('System.Security')
<URL:http://msdn2.microsoft.com/library/7kt014s1(en-us,vs.80).aspx>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
If you look at one of the KB articles about encryption then Microsoft use
ZeroMemory to clear the password. So, you are going against their
recommendations if you don't. Its also mentioned in the Platform SDK to use
it after using LoginUser API function.

What if the user is using the 1.0 or 1.1 Framework & not version 2.0 of the
Framework?

I am reading the Secure String article from the .Net Framework 2.0 Beta 2
Documentation & said that it 'should' be included in the final framework,
not 'would' as yet.

In the .Net Framework 1.0 & 1.1, I would recomment to use
ZeroMemory("[String]", [StringLength * 2])

In the old days of NT, it wasn't even used to clear the login password from
memory & I am not sure its used in XP, but is in 2000.

At the end of the day, it's up-to the user if they want a secure/insecure
application.

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #4
"Crouchie1998" <cr**********@spamcop.net> schrieb:
If you look at one of the KB articles about encryption then Microsoft use
ZeroMemory to clear the password. So, you are going against their
recommendations if you don't. Its also mentioned in the Platform SDK to
use
it after using LoginUser API function.


Do you have the URL of this article? I still think that this recommendation
is rather useless for .NET-based applications.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
Crouchie,
| If you look at one of the KB articles about encryption then Microsoft use
| ZeroMemory to clear the password. So, you are going against their
| recommendations if you don't. Its also mentioned in the Platform SDK to
use
| it after using LoginUser API function.
I would say you are going against their "suggestion" if you don't. Not
"recommendations".

See the "sizeof? is there a .NET equivalent" thread in this newsgroup for
further info on the "problems" of calling ZeroMemory.

Keith Brown's book "The .NET Developer's Guide to Windows Security" from
Addison Wesley contains a plethora of information on security under Win32 &
specifically .NET. I want to say it included a discussion of "zeroing"
memory. You can access the book on-line at:
http://www.pluralsight.com/keith/book/html/book.html, unfortunately I don't
remember which topics discussed "zeroing" memory.

Thinking about it, it may have been one of Keith Brown's MSDN Magazine
articles that discusses "zeroing" memory in .NET, or possible even his
blog...

Hope this helps
Jay

"Crouchie1998" <cr**********@spamcop.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
| If you look at one of the KB articles about encryption then Microsoft use
| ZeroMemory to clear the password. So, you are going against their
| recommendations if you don't. Its also mentioned in the Platform SDK to
use
| it after using LoginUser API function.
|
| What if the user is using the 1.0 or 1.1 Framework & not version 2.0 of
the
| Framework?
|
| I am reading the Secure String article from the .Net Framework 2.0 Beta 2
| Documentation & said that it 'should' be included in the final framework,
| not 'would' as yet.
|
| In the .Net Framework 1.0 & 1.1, I would recomment to use
| ZeroMemory("[String]", [StringLength * 2])
|
| In the old days of NT, it wasn't even used to clear the login password
from
| memory & I am not sure its used in XP, but is in 2000.
|
| At the end of the day, it's up-to the user if they want a secure/insecure
| application.
|
| Crouchie1998
| BA (HONS) MCP MCSE
|
|
Nov 21 '05 #6
Crouchie,
Here's another article about SecureString.

http://msdn.microsoft.com/msdnmag/is...ecurityBriefs/

Hope this helps
Jay

"Crouchie1998" <cr**********@spamcop.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
| If you look at one of the KB articles about encryption then Microsoft use
| ZeroMemory to clear the password. So, you are going against their
| recommendations if you don't. Its also mentioned in the Platform SDK to
use
| it after using LoginUser API function.
|
| What if the user is using the 1.0 or 1.1 Framework & not version 2.0 of
the
| Framework?
|
| I am reading the Secure String article from the .Net Framework 2.0 Beta 2
| Documentation & said that it 'should' be included in the final framework,
| not 'would' as yet.
|
| In the .Net Framework 1.0 & 1.1, I would recomment to use
| ZeroMemory("[String]", [StringLength * 2])
|
| In the old days of NT, it wasn't even used to clear the login password
from
| memory & I am not sure its used in XP, but is in 2000.
|
| At the end of the day, it's up-to the user if they want a secure/insecure
| application.
|
| Crouchie1998
| BA (HONS) MCP MCSE
|
|
Nov 21 '05 #7
Jay, I have the Framework Beta 2 SDK on my development machine.

Here's the article in which Microsoft use ZeroMemory like I described
before:

http://support.microsoft.com/default...b;en-us;301070

You need to look at the very last few lines of code

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #8
Crouchie,
Yes I've seen that code as part of the "sizeof? is there a .NET equivalent"
thread in this newsgroup, the other day.

My statements still stand!

Hope this helps
Jay
"Crouchie1998" <cr**********@spamcop.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
| Jay, I have the Framework Beta 2 SDK on my development machine.
|
| Here's the article in which Microsoft use ZeroMemory like I described
| before:
|
| http://support.microsoft.com/default...b;en-us;301070
|
| You need to look at the very last few lines of code
|
| Crouchie1998
| BA (HONS) MCP MCSE
|
|
Nov 21 '05 #9
Hi guys, I got it :)

Thanks so much!!!

Henry :)
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:<OL**************@TK2MSFTNGP15.phx.gbl>...
Crouchie,
Yes I've seen that code as part of the "sizeof? is there a .NET equivalent"
thread in this newsgroup, the other day.

My statements still stand!

Hope this helps
Jay
"Crouchie1998" <cr**********@spamcop.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
| Jay, I have the Framework Beta 2 SDK on my development machine.
|
| Here's the article in which Microsoft use ZeroMemory like I described
| before:
|
| http://support.microsoft.com/default...b;en-us;301070
|
| You need to look at the very last few lines of code
|
| Crouchie1998
| BA (HONS) MCP MCSE
|
|

Nov 21 '05 #10

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

Similar topics

8
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork =...
7
by: jrefactors | last post by:
I want to ask how password is stored and how to check the authentication? I have heard password is never encrypted and decrypted, but it is hashed. For example, consider a simple email logon...
1
by: Kal | last post by:
Hello, System.Data.SqlClient.SqlException: General network error. Check your network documentation. What does this error means? My web app, suddenly started to show this error today in my...
4
by: Alex | last post by:
Hi All I'm writing scripts in VBS fore years. But now I've to write a tool in Visual Basic .Net which has to connet to a Windows domain. I know how to do this in VBS but I don't find a way in...
1
by: Henry C. Wu | last post by:
Hi, Is there really no easy way to check network password on a Windows 2000 machine? I've managed to do it on Windows XP easily via LoginUser API, but on Windows 2000, it doesnt work. This is...
8
by: Ben Fidge | last post by:
Hi I have a small WinForms app that needs to copy files from a shared drive on a network. If I connect to the mapped drive using Explorer, a password dialog pops-up and I have to provide...
9
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and...
1
by: ekynox | last post by:
Hi guys, have been playing with WMI to add a network printer connection to a Windows XP pc. My environment consists of a server running Windows Server 2003 and Visual Studio 2005 and a test pc...
4
by: Prof. William Battersea | last post by:
Hello, Suppose I have a Vista machine called VISTA and an XP machine called XP in a workgroup named WORKGROUP. Physically they're connected to a router and I can see lists of public and shared...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.