Sponsored Content
Full Discussion: Masking Password with *'s
Top Forums Programming Masking Password with *'s Post 302481777 by bigdrock44 on Sunday 19th of December 2010 10:45:27 PM
Old 12-19-2010
Quote:
Originally Posted by Corona688
That's two backspaces, with a space between them. I don't think you can print a delete and get anything sensible. I can't see your computer from here, please post your code.
I meant I would print "\b \b", but I just want to give the user the option of deleting characters with backspace or delete.

So I was messing around with implementing backspace and also reading it into into an array today and think I've got it working fairly well. Correct me if I'm wrong, but getchar() turns the input into a unique integer right? Well I want to display the password that was entered just to check, but if everything has been converted into integers, how do I display it?

And I'll narrow my earlier question changing the colors into something that is answerable. Basically I want to do something along these lines:
Code:
  while ((ch = getchar()) != '\n')
   {
      if(ch == '\b')     /*Here is where I want to give the option of using delete*/
      {
         printf("\b \b");
         i--;
      }

      else
      {
         password[i] = ch;

         if((ch == '1')    /*I'm not sure if this is done correcting. I want to print a red "1" if a 1 was typed*/
         {
            printf("\033[1;3;31;49m1\033[0m");         /*Output a red '1'*/
         }

         else((ch == '2')    /*Same issue*/
         {
            printf("\033[1;3;34;49m2\033[0m");         /*Output a blue '2'*/
         }

         else((ch == '3')     /*Same issue*/
          {
             printf("\033[1;3;32;49m3\033[0m");         /*Output a green '3'*/
          }

         i++;
      }
   }

I guess this is kinda similar to my first question, this time comparing something that has been turned into an integer to an input. I commented on the lines I am referring to.
 

10 More Discussions You Might Find Interesting

1. IP Networking

IP Masking

Is it possible for a internal LAN to mask a IP e.g. i have a server ip running the intranet ip being 192.168.0.8 and i want to make that like www.intranet.com is this possible on a internal network ? (1 Reply)
Discussion started by: perleo
1 Replies

2. Shell Programming and Scripting

Masking Content of a String

Hello, I need to know that whether a content of a string can be hidden or masked inside a shell script. My Sample Code is given below <Code> #!/usr/bin/ksh Userid=test DB=temp Passwd=`java Decryption test` # The Above command will get the encryped password for "test" user id and store... (2 Replies)
Discussion started by: maxmave
2 Replies

3. Shell Programming and Scripting

Data Masking

I have a pipe delimited file that I need to 'mask' to before loading to keep some data confidential. I need to maintain the first 4 bytes of certain columns and replace the remaining bytes with an 'x'. I would like to maintain spaces but it's not a requirement. Example, need to mask columns 2... (2 Replies)
Discussion started by: 1superdork
2 Replies

4. Emergency UNIX and Linux Support

Masking of number

BAT:0310:2009-08-0:Y4 :H:D:00003721:03103721.IFH:00138770:05767:00000000001279' EXR:CLP:912.570000' STA:A:9071559:2009-08-10::Wer::Mrs' DEF::531.97:531.97:310221661617::+ABC:BAL:1:N::::5:40.00:0.00:2009-08-10:CN:1111111111109962::3:N:missc :N:PH:00010833:... (5 Replies)
Discussion started by: mad_man12
5 Replies

5. Shell Programming and Scripting

Scripting help/advise on hiding/masking username/password

Hi, I currently have a UNIX script with a function that uses a username and password to connect to the database, retrieve some information and then exit. At the moment, am getting the username and password from a hidden plain text file and permission set to -r--------, i.e. read only to who... (1 Reply)
Discussion started by: newbie_01
1 Replies

6. Shell Programming and Scripting

masking issue

Hi I am facing an issue with the below script which has the below line each field being separated with a tab. I need to mask the 8 and 7th field based on following conditions 1. 8th field is 16 in length and is numerics i will mask the middle 6 digits except the first 6 and last 4. input... (2 Replies)
Discussion started by: mad_man12
2 Replies

7. Shell Programming and Scripting

Masking Password from within a Bash Shell Script

Is there a way to mask the password inside of a script to minimize the impact of a comprimised server? So ssh -o "PasswordAuthentication no" -o "HostbasedAuthentication yes" -l testuser 192.168.3.1 "mysqldump --opt --all-databases -u root -pPassword| gzip" > $backup_dir/mysqldump.gz a... (2 Replies)
Discussion started by: metallica1973
2 Replies

8. Shell Programming and Scripting

Masking algorithm

I have a requirement of masking few specific fields in the UNIX file. The details are as following- File is fixed length file with each record of 250 charater length. 2 fields needs to be masked – the positions are 21:30 and 110:120 The character by character making needs to be done which... (5 Replies)
Discussion started by: n78298
5 Replies

9. UNIX for Dummies Questions & Answers

Masking data

How Can I mask one particular columns using some unix command? (4 Replies)
Discussion started by: dsa
4 Replies

10. Shell Programming and Scripting

Masking with gsub command

My file "test.dat" data as below Requirement is to mask(replace) all english characters with "X" EXCEPT first 7 characters of every line. my command awk '{gsub("]","X")}1' test.dat looks not working properly, Appreciate any suggestion... (6 Replies)
Discussion started by: JSKOBS
6 Replies
XSTDCMAP(1)						      General Commands Manual						       XSTDCMAP(1)

NAME
xstdcmap - X standard colormap utility SYNOPSIS
xstdcmap [-all] [-best] [-blue] [-default] [-delete map] [-display display] [-gray] [-green] [-help] [-red] [-verbose] DESCRIPTION
The xstdcmap utility can be used to selectively define standard colormap properties. It is intended to be run from a user's X startup script to create standard colormap definitions in order to facilitate sharing of scarce colormap resources among clients. Where at all possible, colormaps are created with read-only allocations. OPTIONS
The following options may be used with xstdcmap: -all This option indicates that all six standard colormap properties should be defined on each screen of the display. Not all screens will support visuals under which all six standard colormap properties are meaningful. xstdcmap will determine the best allocations and visuals for the colormap properties of a screen. Any previously existing standard colormap properties will be replaced. -best This option indicates that the RGB_BEST_MAP should be defined. -blue This option indicates that the RGB_BLUE_MAP should be defined. -default This option indicates that the RGB_DEFAULT_MAP should be defined. -delete map This option specifies that a specific standard colormap property, or all such properties, should be removed. map may be one of: default, best, red, green, blue, gray, or all. -display display This option specifies the host and display to use; see X(7). -gray This option indicates that the RGB_GRAY_MAP should be defined. -green This option indicates that the RGB_GREEN_MAP should be defined. -help This option indicates that a brief description of the command line arguments should be printed on the standard error. This will be done whenever an unhandled argument is given to xstdcmap. -red This option indicates that the RGB_RED_MAP should be defined. -verbose This option indicates that xstdcmap should print logging information as it parses its input and defines the standard colormap prop- erties. ENVIRONMENT
DISPLAY to get default host and display number. SEE ALSO
X(7) AUTHOR
Donna Converse, MIT X Consortium X Version 11 xstdcmap 1.0.2 XSTDCMAP(1)
All times are GMT -4. The time now is 10:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy