Sponsored Content
Top Forums Programming How to hide from UNIX strings - obfuscate or hide a literal or constant? Post 302892081 by newbie_01 on Monday 10th of March 2014 06:24:42 PM
Old 03-10-2014
Quote:
Originally Posted by Perderabo
How about...
Code:
char array[20];

array[2] = 'l';
array[4] = 'o';
array[5] = (char)0;
array[1] = 'e';
array[3] = 'l';
array[0] = 'h';

Do that just immediately before you use it. Wipe it out immediately after use. Do you mean do a array[]="" after I do the print?
Hi Perderabo,

Thanks as usual to be the first responder.

I am more or less using the one that you suggested. What do you mean by wipe it out immediately?

BTW, looking at one of your reply to Reading password and echo * character | Unix Linux Forums | Shell Programming and Scripting. If you don't mind me asking, if is possible for read to read a defined variable or does it always require a user intervention to provide an input?

Below is what I end up using.

Code:
#include <stdio.h>

// - UPPER CASE starts at 65
// - LOWER CASE starts at 97

int count;
char uc[26];
char lc[26];

char a, b, c, d, e, f;
char g, h, i, j, k, l;
char m, n, o, p, q, r;
char s, t, u, v, w, x;
char y, z;

//char word[100];
//char *word;

main()
{
   /* Print the numbers 1 through 20 */

   for ( count = 1; count <= 26; count++ )
   {
          // printf("%d :: %c :: %c \n", count, count+64, count+96);
          uc[count] = (char)count+64;
          lc[count] = (char)count+96;
   }

   // printf("\n ------------------------------------------ \n");

   // d=lc[4];
   // b=lc[2];
   // g=lc[7];
   // u=lc[21];
   // r=lc[18];
   // char word[]={ d, b, t, e, s, t };

   char word[]={ lc[4] , lc[2] , lc[20] , lc[5] , lc[19] , lc[20]  };

   //printf("%c%c%c%c%c%c",d,b,g,u,r,u);
   //printf("%c \n",u[26]);
   //printf("%c \n",l[26]);

   //#printf("%s",word);
   puts(word);
   return 0;
}

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Hide Directory name

Hello everyone, i am new to unix and still learning about different commands. Can some one tell me how can i hide my directory name. For instance someone is logged in a directory named $ . I've seen some people hiding their above path name by just one word or letter like $ in order to keep... (7 Replies)
Discussion started by: a25khan
7 Replies

2. HP-UX

How to hide files in unix

Hi all I am new to unix...... i am working on HP-UX I like to know how to hide files and how to view hided files created by other users also please help me Sireesha (1 Reply)
Discussion started by: Sireesha NP
1 Replies

3. Shell Programming and Scripting

How to hide user inputted text for interactive unix shell script?

Hi everybody, Do you know how to hide the text for interactive unix shell script? Just like the case for inputting password during logon. Patrick (1 Reply)
Discussion started by: patrickpang
1 Replies

4. Shell Programming and Scripting

Hide a script ?

Hi all, i have a perl script for my users to run. My sys admin created an account for the users to log in and execute the script. They just type "perl myscript.pl" at the unix prompt to run it. Is there any way that i can hide my script? ,ie, do not allow my users to view the script. either... (5 Replies)
Discussion started by: new2ss
5 Replies

5. Shell Programming and Scripting

Want to hide password

All, In my script I am calling another script.. in that script I need to enter a password. Problem is that everyone is able to see the password when I enter that. Is there any way that when i enter that password it should not display or may look like *******. Or if there any other way that I... (1 Reply)
Discussion started by: arpitk
1 Replies

6. Shell Programming and Scripting

How to hide folders

hello everybody, i would like to hide visibility of the folders , i.e. not to giving any physically visibility to any users . Is there any way to do it other than changing the permission and adding "." post folder name . by changing the permission , we cann't do any activity , but have... (1 Reply)
Discussion started by: manas_ranjan
1 Replies

7. Shell Programming and Scripting

Hide process

Hi friends, I want (a C++ code) to hide process in kernel 2.6, I don't want monitoring even in /proc. please help me. Regards, Eilya (3 Replies)
Discussion started by: Eilya
3 Replies

8. Cybersecurity

how to Hide Passwords From UNIX ps Command

Hi, By reporting the process status with ps, any Unix user will see the command line arguments #ps -ef UID PID PPID C STIME TTY TIME CMD lsc 13837 13825 0 May 11 pts/17 0:01 -ksh oracle 4698 6294 0 12:00:40 ? 0:00 sqlplus -s system/manager appluser 4229 4062 0 12:00:03... (2 Replies)
Discussion started by: bhagirathi
2 Replies

9. Shell Programming and Scripting

ls - hide permissions

I'm listing the files in a particular directory using the ls command... $ ls -ogh total 9.4G -rw-r--r-- 1 1.9G Nov 4 02:29 file1.tar -rw-r--r-- 1 1.9G Nov 11 03:11 file2.tar -rw-r--r-- 1 1.9G Nov 18 02:55 file3.tar -rw-r--r-- 1 1.9G Nov 25 03:11 file4.tar -rw-r--r-- 1 1.9G Dec 2 02:46... (3 Replies)
Discussion started by: cdunavent
3 Replies

10. Shell Programming and Scripting

Hide DB Credentials in unix

Hi, I my unix we have one file that contains all the database credentials. we are calling that file while connecting databse. I need to hide that file....other user should not view that file. How to do this. Please suggest me apart from permisstion(chmod) level suggestion. Regards,... (3 Replies)
Discussion started by: rsivasan
3 Replies
shishi_key_from_string(3)					      shishi						 shishi_key_from_string(3)

NAME
shishi_key_from_string - API function SYNOPSIS
#include <shishi.h> int shishi_key_from_string(Shishi * handle, int32_t type, const char * password, size_t passwordlen, const char * salt, size_t saltlen, const char * parameter, Shishi_key ** outkey); ARGUMENTS
Shishi * handle Shishi library handle create by shishi_init(). int32_t type type of key. const char * password input array containing password. size_t passwordlen length of input array containing password. const char * salt input array containing salt. size_t saltlen length of input array containing salt. const char * parameter input array with opaque encryption type specific information. Shishi_key ** outkey pointer to structure that will hold newly created key information DESCRIPTION
Create a new Key information structure, and set the key type and key value using shishi_string_to_key(). KEY contains a newly allocated structure only if this function is successful. RETURN VALUE
Returns SHISHI_OK iff successful. REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_key_from_string(3)
All times are GMT -4. The time now is 03:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy