473,788 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check Network Password

Hi all,
For example you have 2 text boxes:
tbxUsername = Environment.Use rName.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 1950
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
"Crouchie19 98" <cr**********@s pamcop.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.Securi ty')
<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
"Crouchie19 98" <cr**********@s pamcop.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
"recommendation s".

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

"Crouchie19 98" <cr**********@s pamcop.net> wrote in message
news:%2******** ********@TK2MSF TNGP14.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

"Crouchie19 98" <cr**********@s pamcop.net> wrote in message
news:%2******** ********@TK2MSF TNGP14.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
"Crouchie19 98" <cr**********@s pamcop.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.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******* *******@TK2MSFT NGP15.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
"Crouchie19 98" <cr**********@s pamcop.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.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
50590
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 = WScript.CreateObject("WScript.Network") sPwd = inputbox("Enter password") WshNetwork.MapNetworkDrive "J:", "\\server1\data", false, "xyz_net\John", sPwd Msgbox "Drives has been map successful"
7
2930
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 authentication in a hash table: Key: my email address Value: hash_function(my plan text password)
1
4615
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 production environment, beta environment, development environment, and also on my machine too. When i debugged the app, i see that the error is happening when the
4
8784
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 VB.Net. I've no idea how to logon to the domain via Net.Socket. It is not necessary to map a network drive. I can transfer data via UNC names. Can anybody give me a suggestion how to realize it?
1
272
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 in relation to the discussions below: http://groups.google.com.ph/groups?hl=en&lr=&threadm=44f096ca.0505040648.5cf94fd5%40posting.google.com&rnum=5&prev=/groups%3Fq%3Dhenrycortezwu%26hl%3Den%26lr%3D%26scoring%3Dd
8
13047
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 credentials with permission to access this resource on the machine where it's hosted. This is once for each desktop logon session (ie after every reboot). If I do this, my app can access the network resource fine, but otherwise fails with permission...
9
15534
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 check the password. The thing is I can't access the password attribute to compare with the user's password provided.
1
9637
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 running windows xp. Further, I have setup a full domain controller environment. I have managed to write the code to add the network printer and it works fine when installing the printer on the same machine the code is executing from i.e the server or...
4
16099
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 files on each of them. How do I address these for IO? A search suggested that the form open(r"\\server\folder\folder"), but I tried many combinations guessing what it wants for that path in my case (r"\\WORKGROUP\VISTA", "\\VISTA\PUBLIC", etc),...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.