473,473 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Encrypted input from user

Hi,

I am developing a console application and i would like to get userinput
for

Database User & Password.

The Password should be input as **********

Please can some help me out on this?

Thanks & Regards
JP

Sep 22 '06 #1
1 1343
Heres a simple way of doing it:

static string ReadLineButStarInput()
{
byte star = ASCIIEncoding.ASCII.GetBytes("*")[0];
ConsoleKeyInfo key = Console.ReadKey();
string input = "";

while (key.Key != ConsoleKey.Enter)
{
input += key.KeyChar;

Console.CursorLeft -= 1;
Console.OpenStandardOutput().WriteByte(star);
key = Console.ReadKey();

}
return input;

}

HTH
Ciaran O'Donnell

"gopal" wrote:
Hi,

I am developing a console application and i would like to get userinput
for

Database User & Password.

The Password should be input as **********

Please can some help me out on this?

Thanks & Regards
JP

Sep 22 '06 #2

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

Similar topics

6
by: Ian Davies | last post by:
Hello I would like to query the user table of the mysql database from my VB application to check that a user's password entered in a text field on a form corresponds to that users password in the...
2
by: Leonardo D'Ippolito | last post by:
Hi! I have two .NET win apps that need to communicate on a TCP/IP network. 'App A' must ask 'app B' if it's allowed to do some task, and 'app B' must authorize or prohibit it. How can I do...
3
by: Michael | last post by:
Hi folks, i have to build a web-application for the internet where the user gets a form where he can fill in his name, adress and so on. He also can provide a credit number. The data will be...
2
by: David Kyle | last post by:
Hello, I'm building a web application where I need to have some post data encrypted. An example would be something like this: <input type=hidden value='<%# GetEncriptedData() %>'> ...
0
by: VBTricks.de.vu Webmaster | last post by:
Hello, I'm trying to implement an encrypted communication with a PHP script. All the basic stuff (HTTP protocoll, base64) is working. The only problem is that this method works only for the...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
1
by: Sathyaish | last post by:
I have the following scenario: Algorithm: 3DES Cipher Mode: CBC Key Size: 128-bit Block Size: 64 bit IV: 0x0000000000000000 (an eight byte array of zeros) The results I get using .NET with...
3
by: phforum | last post by:
I have no ideas to encrypt the user input password from the text box.....
3
cassbiz
by: cassbiz | last post by:
Here is what I want to do, if possible. I have a reservation form, where one value (credit card number) needs to be run through an encryption script then get posted to the DB where all of the...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
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...
1
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...
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,...
0
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...
0
muto222
php
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.